:root {
  --ink: #232823;
  --ink-soft: #505a53;
  --paper: #f3f6ff;
  --paper-2: #ffffff;
  --line: #e9e6df;
  --line-strong: #dcd8cf;
  --hover: #f6f4ef;
  --muted: #838b85;
  --accent: #14614a;
  --accent-2: #0e4a39;
  --accent-soft: #edf3ef;
  --clay: #c4694f;
  --clay-soft: #fdf4ef;
  --cream: #f4f0e6;
  --gold: #b8860b;
  --danger: #a4161a;
  --danger-bg: #fff1ef;
  --ok: #14614a;
  --radius: 18px;
  --radius-lg: 26px;
  --shadow: 0 1px 2px rgba(35, 40, 35, 0.03), 0 16px 40px -32px rgba(35, 40, 35, 0.4);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1000px 620px at 10% -10%, rgba(20, 97, 74, 0.10), transparent 62%),
    radial-gradient(820px 540px at 100% 0%, rgba(184, 134, 11, 0.08), transparent 58%),
    linear-gradient(180deg, #f3f6ff 0%, #eef4ff 100%);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, .serif {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.022em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); }
h2 { font-size: clamp(1.45rem, 2.8vw, 2rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
hr { border: none; border-top: 1px solid var(--line); margin: 2rem 0; }

.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(720px, 100% - 2.5rem); margin-inline: auto; }
.mt { margin-top: 1.5rem; }
.mt-2 { margin-top: 2.5rem; }
.muted { color: var(--muted); font-size: 0.9rem; }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* ---------- logo lockup ---------- */
.brand { display: flex; align-items: center; gap: 0.6rem; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 34px; height: 34px; display: block; flex: none; border-radius: 50%; }
.brand .wordmark { display: flex; flex-direction: column; line-height: 1; }
.brand .wordmark .name {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.12rem; font-weight: 700; letter-spacing: -0.01em; color: var(--ink);
}
.brand .wordmark .sub {
  font-size: 0.58rem; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--muted); margin-top: 0.28rem;
}
.brand .wordmark .wordmark-svg {
  height: 19px; width: 67px; display: block; flex: none; align-self: flex-start; color: var(--ink);
}
.brand .wordmark .sub + .wordmark-svg, .brand .wordmark .wordmark-svg + .sub { margin-top: 0.3rem; }
.inline-form { display: inline; margin: 0; }

/* ---------- hamburger + side panel ---------- */
.menu-btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; width: 44px; height: 44px; padding: 0; flex: none;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--paper-2); cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.menu-btn:hover { background: var(--hover); border-color: var(--line-strong); }
.menu-btn span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); }
.menu-btn.inline { display: none; }
.menu-btn.floating {
  position: fixed; top: 14px; left: 14px; z-index: 60;
  background: var(--paper-2); box-shadow: var(--shadow);
}
body.is-student { padding-top: 4.35rem; }
body.is-student footer { padding-bottom: 5.5rem; }

/* ---------- floating notifications (students) ---------- */
.notif { position: fixed; right: 16px; bottom: 16px; z-index: 60; }
.notif-btn {
  position: relative; width: 54px; height: 54px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--paper-2); cursor: pointer;
  box-shadow: 0 10px 26px -16px rgba(17, 24, 39, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.notif-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -16px rgba(17, 24, 39, 0.5); border-color: var(--line-strong); }
.notif-icon { width: 26px; height: 26px; fill: var(--ink); display: block; }
.notif-badge {
  position: absolute; top: 6px; right: 5px; min-width: 19px; height: 19px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0; border: 2px solid var(--paper-2);
}
.notif-badge[hidden] { display: none; }
.notif-panel {
  position: absolute; right: 0; bottom: calc(100% + 12px);
  width: min(368px, calc(100vw - 32px)); max-height: min(68vh, 520px); overflow-y: auto;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 28px 70px -28px rgba(17, 24, 39, 0.45);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}
.notif.open .notif-panel { opacity: 1; visibility: visible; transform: none; }
.notif-head {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.8rem 1rem; background: var(--paper-2); border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.notif-mark {
  border: none; background: none; cursor: pointer; padding: 0.15rem 0.2rem;
  font: inherit; font-size: 0.76rem; font-weight: 600; color: var(--accent);
}
.notif-mark:hover { text-decoration: underline; }
.notif-list { padding: 0.4rem; }
.notif-item {
  display: flex; gap: 0.6rem; padding: 0.7rem 0.75rem; border-radius: 10px;
  color: inherit; text-decoration: none; align-items: flex-start;
}
.notif-item:hover { background: var(--hover); text-decoration: none; }
.notif-mark-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-top: 0.42rem; flex: none; opacity: 0; }
.notif-item.unread .notif-mark-dot { opacity: 1; }
.notif-text { display: flex; flex-direction: column; gap: 0.12rem; min-width: 0; }
.notif-title { font-size: 0.88rem; font-weight: 600; color: var(--ink); line-height: 1.35; }
.notif-body { font-size: 0.82rem; color: var(--ink-soft); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-time { font-size: 0.72rem; color: var(--muted); margin-top: 0.15rem; }
.notif-empty { padding: 1.1rem 1rem; margin: 0; font-size: 0.86rem; color: var(--muted); }

/* floating install prompt */
.pwa-install {
  position: fixed; right: 16px; bottom: 16px; z-index: 59;
  width: 54px; height: 54px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--accent-2); background: var(--accent); color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 26px -16px rgba(17, 24, 39, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.pwa-install--with-notif { bottom: 82px; }
.pwa-install[hidden] { display: none; }
.pwa-install:hover { transform: translateY(-1px); background: var(--accent-2); box-shadow: 0 14px 30px -16px rgba(17, 24, 39, 0.5); }
.pwa-install svg { width: 24px; height: 24px; display: block; }
.pwa-hint {
  position: fixed; right: 16px; bottom: 80px; z-index: 59;
  width: min(270px, calc(100vw - 32px));
  padding: 0.85rem 0.95rem; background: var(--paper-2);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 28px 70px -28px rgba(17, 24, 39, 0.45);
  font-size: 0.82rem; line-height: 1.45; color: var(--ink-soft);
}
.pwa-install--with-notif + .pwa-hint { bottom: 146px; }
.pwa-hint[hidden] { display: none; }
.pwa-hint strong { display: block; margin-bottom: 0.2rem; font-size: 0.86rem; color: var(--ink); }

.menu-overlay {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(17, 24, 39, 0.42);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.menu-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }

.drawer {
  position: fixed; top: 16px; bottom: 16px; left: 16px; z-index: 80;
  width: min(308px, calc(100vw - 32px));
  display: flex; flex-direction: column;
  padding: 1.1rem 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(233, 230, 223, 0.9);
  border-radius: 30px;
  box-shadow: 0 32px 80px -34px rgba(17, 24, 39, 0.5), 0 2px 10px rgba(35, 40, 35, 0.05);
  transform: translateX(calc(-100% - 28px));
  visibility: hidden;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.28s ease;
  overflow-y: auto;
}
.drawer.open { transform: none; visibility: visible; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 1rem; padding: 0 0.15rem; }
.drawer-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: none; border-radius: 50%;
  background: none; cursor: pointer; color: var(--muted);
  font-size: 1.5rem; line-height: 1; padding: 0;
}
.drawer-close:hover { background: var(--hover); color: var(--ink); }
.drawer-nav { display: flex; flex-direction: column; gap: 0.3rem; }
.drawer-nav > a {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.45rem 0.55rem; border-radius: 999px;
  border: 1px solid transparent;
  color: var(--ink-soft); font-size: 0.93rem; font-weight: 600;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.drawer-nav > a:hover { background: var(--hover); color: var(--ink); text-decoration: none; border-color: var(--line); }
.drawer-nav > a.active { background: var(--accent-soft); color: var(--accent-2); border-color: #d6e7dd; }
.drawer-ico {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper-2); border: 1px solid var(--line); color: var(--ink-soft);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.drawer-ico svg { width: 18px; height: 18px; display: block; }
.drawer-nav > a:hover .drawer-ico { border-color: var(--line-strong); color: var(--ink); }
.drawer-nav > a.active .drawer-ico { background: #ffffff; border-color: #cfe2d7; color: var(--accent); }
.drawer-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-badge {
  margin-left: auto; flex: none; min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--clay); color: #ffffff;
  font-size: 0.66rem; font-weight: 700;
}
.drawer-badge[hidden] { display: none; }
.drawer-foot { margin-top: auto; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.drawer-foot .btn { margin-top: 0.15rem; }
.drawer-foot .btn svg { width: 17px; height: 17px; flex: none; }
body.menu-open { overflow: hidden; }

.footer-brand { display: inline-flex; align-items: center; gap: 0.5rem; }
.footer-brand img { width: 26px; height: 26px; border-radius: 8px; display: block; }
.footer-brand strong { color: var(--ink); font-size: 0.95rem; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
}
.topbar .inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 0; }
.nav { display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }
.nav a { padding: 0.45rem 0.7rem; border-radius: 8px; color: var(--ink-soft); font-size: 0.92rem; font-weight: 500; }
.nav a:hover { background: var(--hover); text-decoration: none; color: var(--ink); }
.nav a.active { color: var(--accent-2); background: var(--accent-soft); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.72rem 1.3rem; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 500; letter-spacing: 0.005em; font-size: 0.92rem; cursor: pointer;
  background: var(--ink); color: #ffffff;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: #101512; color: #ffffff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.accent { background: var(--accent); color: #ffffff; }
.btn.accent:hover { background: var(--accent-2); color: #ffffff; }
.btn.ghost { background: #ffffff; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.danger { background: var(--danger); color: #ffffff; }
.btn.danger:hover { background: #8a1215; color: #ffffff; }
.btn.sm { padding: 0.4rem 0.8rem; font-size: 0.82rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- hero ---------- */
.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 3rem; position: relative; overflow: hidden; }
.hero-logo { width: 68px; height: 68px; display: block; border-radius: 18px; margin-bottom: 1.25rem; }
.hero .kicker {
  display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
  border: 1px solid #cfe0d7; background: #eef6f2; padding: 0.3rem 0.7rem; border-radius: 999px;
  margin-bottom: 1.4rem;
}
.hero p.lede { font-size: clamp(1.05rem, 2vw, 1.25rem); max-width: 54ch; color: var(--ink-soft); }
.hero .cta { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 2rem; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 3.5rem; align-items: start; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; } }

.fee-card {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow);
}
.fee-card .price { font-family: Georgia, serif; font-size: 2.6rem; line-height: 1; color: var(--ink); }
.fee-card ul { list-style: none; padding: 0; margin: 1rem 0 0; }
.fee-card li { display: flex; gap: 0.6rem; padding: 0.45rem 0; border-top: 1px dashed var(--line); font-size: 0.94rem; color: var(--ink-soft); }
.fee-card li:first-child { border-top: none; }
.fee-card li::before { content: "—"; color: var(--accent); }

/* ---------- no refund band ---------- */
.norefund {
  background: #9b2226; color: #fff; text-align: center;
  font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase;
  font-size: 0.74rem; padding: 0.62rem 1rem;
}
.norefund strong { text-decoration: underline; text-underline-offset: 3px; }
.norefund a { color: #ffffff; text-decoration: underline; }
.notice-box {
  border: 2px solid var(--danger); background: var(--danger-bg); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; color: #6d1114; font-size: 0.95rem;
}
.notice-box h4 { color: var(--danger); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.78rem; margin-bottom: 0.4rem; font-family: inherit; }
.notice-box p:last-child { margin-bottom: 0; color: #6d1114; }

/* ---------- sections & cards ---------- */
section { padding: 3rem 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.card {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; box-shadow: var(--shadow);
}
.card + .card { margin-top: 1rem; }
.card h3 { margin-bottom: 0.35rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 820px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }
.step-num { font-family: "Iowan Old Style", Palatino, Georgia, serif; font-size: 0.78rem; color: var(--accent); font-weight: 500; letter-spacing: 0.12em; }

/* ---------- forms ---------- */
label { display: block; font-size: 0.82rem; font-weight: 500; margin-bottom: 0.4rem; color: var(--ink-soft); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=url], select, textarea {
  width: 100%; padding: 0.78rem 0.95rem; border: 1px solid var(--line-strong); border-radius: 12px;
  background: #ffffff; font: inherit; font-size: 0.95rem; color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(20, 97, 74, 0.09);
}
textarea { resize: vertical; min-height: 110px; }
.field + .field { margin-top: 0.9rem; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.88rem; color: var(--ink-soft); }
.check input { margin-top: 0.25rem; width: 1rem; height: 1rem; flex: none; }
.form-card { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow); }

/* ---------- flash ---------- */
.flash { border-radius: 10px; padding: 0.8rem 1rem; font-size: 0.92rem; margin-bottom: 1.25rem; border: 1px solid; }
.flash.ok { background: #ecf7f1; border-color: #bfdccd; color: #0b4a38; }
.flash.err { background: var(--danger-bg); border-color: #e8c3c0; color: #7d1215; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); }
td { padding: 0.7rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

/* ---------- badges ---------- */
.badge {
  display: inline-block; font-size: 0.74rem; font-weight: 500; letter-spacing: 0.01em;
  padding: 0.24rem 0.7rem; border-radius: 999px;
  background: var(--hover); color: var(--ink-soft); white-space: nowrap;
}
.badge.ok { background: var(--accent-soft); color: var(--accent-2); }
.badge.warn { background: #faf1dc; color: #7d5a10; }
.badge.err { background: #fbeeec; color: #92302c; }
.badge.info { background: #eff3ef; color: #43544a; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; }
.stat { background: var(--paper-2); border: 1px solid var(--line); border-radius: 16px; padding: 0.95rem 1.1rem; }
.stat .n { font-family: "Iowan Old Style", Palatino, Georgia, serif; font-size: 1.6rem; line-height: 1.15; font-weight: 500; }
.stat .l { font-size: 0.75rem; letter-spacing: 0.04em; color: var(--muted); }

/* ---------- app shell ---------- */
.apphead { padding: 2rem 0 1rem; }
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin: 1.25rem 0 1.5rem; overflow-x: auto; }
.tabs a { padding: 0.6rem 0.9rem; font-size: 0.92rem; font-weight: 600; color: var(--ink-soft); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.active { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- lessons ---------- */
.lesson-item {
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
  padding: 1rem 1.15rem; background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 16px; margin-bottom: 0.6rem; transition: border-color 0.15s, transform 0.1s;
}
.lesson-item:hover { border-color: var(--line-strong); text-decoration: none; }
.lesson-item h3 { margin: 0 0 0.15rem; font-size: 1.05rem; }
.lesson-item .meta { font-size: 0.82rem; color: var(--muted); }
.lesson-notes { white-space: pre-wrap; font-size: 1rem; line-height: 1.75; color: #1f2937; }
.lesson-notes p { color: inherit; }
.video-frame { position: relative; padding-top: 56.25%; background: #000; border-radius: 12px; overflow: hidden; margin: 1rem 0; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-el { width: 100%; border-radius: 12px; background: #000; }
.file-list { list-style: none; padding: 0; margin: 0.75rem 0 0; }
.file-list li { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 0.5rem; font-size: 0.9rem; background: var(--paper-2); }

/* ---------- Q&A ---------- */
.q { background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.15rem; margin-bottom: 0.75rem; }
.q.highlight { animation: flashbg 2s ease; }
@keyframes flashbg { from { background: #eef6f2; } to { background: var(--paper-2); } }
.q-head { display: flex; justify-content: space-between; gap: 0.75rem; align-items: baseline; margin-bottom: 0.35rem; }
.q-who { font-weight: 700; font-size: 0.88rem; }
.q-body { white-space: pre-wrap; margin: 0; color: #1f2937; }
.q-meta { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.answers { margin-top: 0.85rem; padding-left: 0.9rem; border-left: 2px solid #e5e7eb; }
.answer { padding: 0.55rem 0; }
.answer + .answer { border-top: 1px dashed var(--line); }
.answer .who { font-size: 0.8rem; font-weight: 700; color: var(--accent); }
.answer .when { font-size: 0.72rem; color: var(--muted); margin-left: 0.4rem; }
.answer p { margin: 0.2rem 0 0; color: #1f2937; white-space: pre-wrap; }
.reply-form { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.reply-form input { flex: 1; }
.live { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #17a673; box-shadow: 0 0 0 0 rgba(23,166,115,0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 6px rgba(23,166,115,0); } 100% { box-shadow: 0 0 0 0 rgba(23,166,115,0); } }

/* ---------- footer ---------- */
footer.site-footer {
  position: relative; overflow: hidden;
  background: #f8f8ff; border-top: 1px solid #e8e8f2;
  margin-top: 4.5rem; padding: 3.25rem 0 0;
  font-size: 0.85rem; color: #6f7280;
}
footer.site-footer::before {
  content: ""; position: absolute; top: -170px; left: 50%;
  width: min(800px, 130%); height: 330px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(20, 97, 74, 0.1), rgba(20, 97, 74, 0));
  pointer-events: none;
}
.site-footer .wrap { position: relative; }

.foot-top { display: grid; grid-template-columns: 1.4fr 0.6fr; gap: 2rem; align-items: end; }
.foot-brand { display: inline-flex; align-items: center; gap: 0.55rem; }
.foot-brand img { width: 26px; height: 26px; border-radius: 50%; display: block; }
.foot-brand strong { color: #2f332f; font-size: 0.95rem; font-weight: 500; }
.foot-title {
  margin: 0.85rem 0 0.3rem; font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: clamp(1.45rem, 2.8vw, 1.95rem); font-weight: 500; line-height: 1.2;
  letter-spacing: -0.02em; color: #2e322e;
}
.foot-line { margin: 0; max-width: 44ch; font-size: 0.88rem; line-height: 1.7; color: #787c88; }

.foot-cta { display: flex; gap: 0.55rem; justify-content: flex-end; flex-wrap: wrap; }
.foot-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.78rem 1.35rem; border-radius: 999px; font-size: 0.86rem; font-weight: 500;
  border: 1px solid transparent; transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}
.foot-btn.primary { background: var(--accent); color: #ffffff; }
.foot-btn.primary:hover { background: var(--accent-2); color: #ffffff; text-decoration: none; }
.foot-btn.quiet { background: transparent; border-color: #dcdce8; color: #3f4350; }
.foot-btn.quiet:hover { background: #ffffff; color: #3f4350; text-decoration: none; }
.foot-btn:active { transform: translateY(1px); }

.foot-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem;
  margin-top: 3rem; padding-top: 2.25rem; border-top: 1px solid #e9e9f2;
}
.foot-col { display: flex; flex-direction: column; gap: 0.55rem; }
.foot-head { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: #9b9eaa; margin-bottom: 0.35rem; }
.foot-col a {
  position: relative; width: fit-content; font-size: 0.85rem; color: #5b5f6c;
  transition: color 0.15s ease;
}
.foot-col a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 0;
  background: var(--accent); transition: width 0.22s ease;
}
.foot-col a:hover { color: var(--accent); text-decoration: none; }
.foot-col a:hover::after { width: 100%; }
.foot-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.foot-facts li { position: relative; padding-left: 0.9rem; font-size: 0.85rem; color: #5b5f6c; }
.foot-facts li::before {
  content: ""; position: absolute; left: 0; top: 0.55em; width: 5px; height: 5px;
  border-radius: 50%; background: var(--accent); opacity: 0.45;
}

.foot-wordmark {
  margin: 2.75rem 0 -0.08em; text-align: center;
  font-family: "Iowan Old Style", Palatino, Georgia, serif; font-weight: 500;
  font-size: clamp(3.4rem, 12vw, 9rem); line-height: 0.8; letter-spacing: -0.045em;
  color: #e9e9f5; user-select: none; pointer-events: none; white-space: nowrap;
}

.foot-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 0.6rem 1.5rem;
  flex-wrap: wrap; padding: 1.15rem 0 1.35rem;
  border-top: 1px solid #e9e9f2; font-size: 0.75rem; color: #969aa6;
}
.foot-bottom-links { display: inline-flex; align-items: center; gap: 0.5rem; }
.foot-bottom a { color: #6c7080; }
.foot-bottom a:hover { color: var(--accent); text-decoration: none; }
.foot-sep { color: #c6c8d3; }

/* legal */
.legal h2 { margin-top: 2.2rem; }
.legal ul { color: var(--ink-soft); padding-left: 1.2rem; }
.legal li { margin-bottom: 0.5rem; }

/* ---------- small screens ---------- */
@media (max-width: 820px) {
  .topbar .nav { display: none; }
  .menu-btn.inline { display: inline-flex; }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .wrap, .narrow { width: min(1120px, 100% - 1.9rem); }
  section { padding: 2.25rem 0; }
  .hero { padding-top: 2rem; }
  .norefund { font-size: 0.66rem; letter-spacing: 0.03em; line-height: 1.5; padding: 0.55rem 0.85rem; }
  .fee-card, .card, .form-card { padding: 1.15rem; }
  .fee-card .price { font-size: 2.1rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats .n { font-size: 1.35rem; }
  .lesson-item { flex-direction: column; align-items: stretch; }
  .lesson-item .btn { width: 100%; }
  .q-head { flex-direction: column; align-items: flex-start; gap: 0.1rem; }
  .reply-form { flex-direction: column; }
  .reply-form .btn { width: 100%; }
  .row { gap: 0.6rem; }
  .row > input, .row > select { min-width: 0; flex: 1 1 100%; }
  .btn { min-height: 42px; }
  .btn.sm { min-height: 36px; }
  .tabs { margin: 1rem 0 1.25rem; }
  .tabs a { padding: 0.55rem 0.7rem; font-size: 0.88rem; }
  .auth .side { padding: 1.75rem 1.25rem; }
  .notif { right: 12px; bottom: 12px; }
  .notif-btn { width: 50px; height: 50px; }
  .notif-icon { width: 24px; height: 24px; }
  .pwa-install { right: 12px; bottom: 12px; width: 50px; height: 50px; }
  .pwa-install--with-notif { bottom: 72px; }
  .pwa-hint { right: 12px; bottom: 70px; }
  .pwa-install--with-notif + .pwa-hint { bottom: 132px; }
  footer { margin-top: 2.5rem; padding: 2rem 0; }
  table { font-size: 0.85rem; }
}
@media (max-width: 340px) {
  .brand .wordmark .sub { letter-spacing: 0.18em; }
  .stats { grid-template-columns: 1fr; }
}

/* auth split */
.auth { display: grid; grid-template-columns: 1fr 1fr; gap: 0; min-height: calc(100vh - 62px); }
.auth .side { padding: clamp(2rem, 5vw, 4rem); display: flex; flex-direction: column; justify-content: center; }
.auth .panel { background: #ffffff; border-left: 1px solid var(--line); }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth .side:first-child { padding-bottom: 1rem; } .auth .panel { border-left: none; border-top: 1px solid var(--line); } }

/* ============================================================
   Landing page — soft, quiet, visual first
   ============================================================ */
.lp { overflow-x: clip; }
.lp-wrap { width: min(1060px, 100% - 2.5rem); margin-inline: auto; }
.lp-hero { padding: clamp(1.5rem, 3.4vw, 2.6rem) 0 clamp(0.5rem, 1.5vw, 1rem); }

.lp-eyebrow {
  display: inline-flex; align-items: center; gap: 0.55rem; margin: 0 0 1.15rem;
  padding: 0.4rem 0.9rem; border-radius: 999px;
  background: #ffffff; border: 1px solid var(--line);
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: #63706a; font-weight: 500;
}
.lp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.lp-stage {
  max-width: 820px; margin: 0 auto;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--cream);
  box-shadow: 0 30px 70px -50px rgba(35, 40, 35, 0.55);
}
.lp-stage img { display: block; width: 100%; height: auto; }
.lp-caption {
  margin: 0.85rem 0 0; text-align: center;
  font-size: 0.78rem; color: var(--muted); letter-spacing: 0.01em;
}

.lp-intro { max-width: 660px; margin: clamp(1.9rem, 4vw, 3rem) auto 0; text-align: center; }
.lp-intro h1 { margin: 0 0 0.5rem; font-size: clamp(2.2rem, 5.2vw, 3.4rem); font-weight: 500; letter-spacing: -0.03em; }
.lp-lede { font-size: clamp(1.02rem, 2vw, 1.18rem); color: #49534c; margin: 0 0 1rem; line-height: 1.55; }
.lp-body { font-size: 0.96rem; line-height: 1.85; color: #6b746d; margin: 0; }
.lp-note { font-size: 0.79rem; color: var(--muted); margin: 1.15rem 0 0; }
.lp-tiny { font-size: 0.76rem; margin: 0.85rem 0 0; text-align: center; color: rgba(255, 255, 255, 0.62); }
.lp-tiny a { color: rgba(255, 255, 255, 0.85); }

.lp-actions { display: flex; gap: 0.65rem; justify-content: center; flex-wrap: wrap; margin-top: 1.6rem; }

/* quiet buttons — thin weight, no heavy shadows */
.lp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.82rem 1.5rem; border-radius: 999px; border: 1px solid transparent;
  font-size: 0.9rem; font-weight: 500; letter-spacing: 0.005em; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}
.lp-btn:hover { text-decoration: none; }
.lp-btn:active { transform: translateY(1px); }
.lp-btn.primary { background: var(--accent); color: #ffffff; }
.lp-btn.primary:hover { background: var(--accent-2); }
.lp-btn.quiet { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.lp-btn.quiet:hover { background: #ffffff; border-color: #c9c4b9; }
.lp-btn.light { background: #ffffff; color: var(--accent-2); }
.lp-btn.light:hover { background: #f3f6f2; }
.lp-btn.block { display: flex; width: 100%; }

/* sections */
.lp-section { padding: clamp(2rem, 4.5vw, 3.4rem) 0; }
.lp-label {
  margin: 0 0 0.7rem; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); font-weight: 500;
}
.lp-label.soft { color: rgba(255, 255, 255, 0.66); }
.lp-label.clay { color: var(--clay); }
.lp-section h2 { margin: 0 0 0.8rem; font-weight: 500; }

.lp-sheet {
  background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.4rem);
}
.lp-sheet.warm { background: #f6f8f4; border-color: #e6ece3; }

/* "What you will learn" — photo behind frosted glass */
.lp-photo {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 0; border-color: rgba(255, 255, 255, 0.4);
  background: #1d2b25; color: #ffffff;
  box-shadow: 0 34px 70px -38px rgba(18, 45, 35, 0.6);
}
.lp-photo::before {
  content: ""; position: absolute; inset: -7%; z-index: -2;
  background: url("/img/learn-students.jpg") center / cover no-repeat;
  filter: blur(3px) saturate(1.04) brightness(0.9);
  transform: scale(1.05);
}
.lp-photo::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(172deg, rgba(9, 32, 25, 0.72) 0%, rgba(9, 32, 25, 0.4) 42%, rgba(7, 24, 19, 0.52) 100%);
}
.lp-photo-glass {
  position: relative;
  padding: clamp(1.5rem, 3vw, 2.4rem);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: calc(var(--radius-lg) - 1px);
}
.lp-photo h2 { color: #ffffff; text-shadow: 0 1px 14px rgba(6, 22, 17, 0.4); }
.lp-photo .lp-body { color: rgba(255, 255, 255, 0.82); }
.lp-photo .lp-topics li {
  background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.85);
}
.lp-photo .lp-topic { color: #ffffff; }

.lp-split { display: grid; grid-template-columns: 1.32fr 0.78fr; gap: 1.15rem; align-items: start; }
.lp-twins { display: grid; grid-template-columns: 1fr 1fr; gap: 1.15rem; }

.lp-topics { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.lp-topics li {
  background: #fbfaf7; border: 1px solid #f0eee6; border-radius: 16px;
  padding: 1rem 1.1rem; font-size: 0.88rem; line-height: 1.7; color: #6b746d;
}
.lp-topic { display: block; margin-bottom: 0.2rem; font-size: 0.94rem; color: var(--ink); }

.lp-fee {
  background: var(--accent); color: #ffffff; border-radius: var(--radius-lg);
  padding: clamp(1.6rem, 3vw, 2.1rem);
  position: sticky; top: 88px;
}
.lp-fee-amount {
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: clamp(2rem, 4vw, 2.5rem); font-weight: 500; line-height: 1.1;
  margin: 0.5rem 0 0.35rem; letter-spacing: -0.02em; color: #ffffff;
}
.lp-fee-note { margin: 0; font-size: 0.85rem; color: rgba(255, 255, 255, 0.68); }
.lp-fee .lp-btn.primary { background: #ffffff; color: var(--accent-2); margin-top: 1.5rem; }
.lp-fee .lp-btn.primary:hover { background: #f1f5f1; }

.lp-list { list-style: none; padding: 0; margin: 1.3rem 0 0; }
.lp-list li {
  position: relative; padding-left: 1.35rem; margin-bottom: 0.62rem;
  font-size: 0.89rem; line-height: 1.65; color: #5f6862;
}
.lp-list li::before {
  content: ""; position: absolute; left: 0; top: 0.58em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 0.45;
}
.lp-fee .lp-list li { color: rgba(255, 255, 255, 0.82); }
.lp-fee .lp-list li::before { background: #ffffff; opacity: 0.5; }

.lp-quiet {
  margin: 1.3rem 0 0; padding-top: 1rem; border-top: 1px solid #eeebe4;
  font-size: 0.81rem; line-height: 1.7; color: var(--muted);
}

.lp-steps { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; }
.lp-steps li { background: #ffffff; border: 1px solid var(--line); border-radius: 22px; padding: 1.5rem 1.4rem; }
.lp-step { font-size: 0.72rem; letter-spacing: 0.18em; color: var(--accent); }
.lp-steps h3 { margin: 0.85rem 0 0.35rem; font-size: 1.06rem; font-weight: 500; }
.lp-steps p { margin: 0; font-size: 0.88rem; line-height: 1.75; color: #6b746d; }

.lp-policy { background: #fdf8f2; border: 1px solid #ece1d4; border-radius: var(--radius-lg); padding: clamp(1.5rem, 3vw, 2.5rem); }
.lp-policy h2 { color: #40342c; }
.lp-policy .lp-body { color: #6f5f53; max-width: 74ch; }
.lp-accs { display: grid; gap: 0.55rem; margin-top: 1.5rem; max-width: 700px; }
.lp-accs details { background: #ffffff; border: 1px solid #efe5d8; border-radius: 14px; padding: 0.85rem 1.05rem; }
.lp-accs summary { cursor: pointer; list-style: none; font-size: 0.88rem; color: #5b4b41; }
.lp-accs summary::-webkit-details-marker { display: none; }
.lp-accs summary::after { content: "+"; float: right; color: #a68f7c; }
.lp-accs details[open] summary::after { content: "–"; }
.lp-accs p { margin: 0.7rem 0 0; font-size: 0.87rem; line-height: 1.8; color: #6f5f53; }

.lp-close { background: var(--accent); color: #ffffff; border-radius: 30px; padding: clamp(2rem, 5vw, 3.2rem); text-align: center; }
.lp-close h2 { color: #ffffff; font-size: clamp(1.7rem, 4vw, 2.4rem); margin-bottom: 0.6rem; }
.lp-close p { color: rgba(255, 255, 255, 0.78); max-width: 44ch; margin: 0 auto 1.6rem; font-size: 0.95rem; }

@media (max-width: 900px) {
  .lp-split, .lp-twins { grid-template-columns: 1fr; }
  .lp-fee { position: static; }
  .lp-steps { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .lp-wrap { width: min(1060px, 100% - 1.9rem); }
  .lp-topics { grid-template-columns: 1fr; }
  .lp-stage { border-radius: 20px; }
  .lp-actions .lp-btn { flex: 1 1 100%; }
  .lp-sheet, .lp-policy { border-radius: 20px; }
  .lp-eyebrow { font-size: 0.66rem; letter-spacing: 0.1em; }
}

/* ---------- landing header (no hamburger) ---------- */
.topbar.minimal .inner { padding: 0.85rem 0; }
.lp-header-actions { display: flex; align-items: center; gap: 1.35rem; }
.lp-header-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.6rem 1.2rem; border-radius: 999px; border: 1px solid transparent;
  font-size: 0.86rem; font-weight: 500; letter-spacing: 0.005em; line-height: 1.2;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}
.lp-header-btn:active { transform: translateY(1px); }
.lp-header-btn.solid { background: var(--accent); color: #ffffff; }
.lp-header-btn.solid:hover { background: var(--accent-2); color: #ffffff; text-decoration: none; }
.lp-header-btn.quiet { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.lp-header-btn.quiet:hover { background: #ffffff; border-color: #c9c4b9; color: var(--ink); text-decoration: none; }

/* ---------- swipe-up motion ---------- */
@keyframes lp-swipe-up {
  from { opacity: 0; transform: translate3d(0, 44px, 0); }
  60% { opacity: 1; }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
.lp-eyebrow { animation: lp-swipe-up 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.lp-stage { animation: lp-swipe-up 0.95s cubic-bezier(0.22, 0.61, 0.36, 1) 0.06s both; }
.lp-caption { animation: lp-swipe-up 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 0.22s both; }
.lp-intro { animation: lp-swipe-up 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) 0.26s both; }

.has-reveal [data-reveal] {
  opacity: 0; transform: translate3d(0, 52px, 0);
  transition: opacity 0.75s ease, transform 0.95s cubic-bezier(0.16, 0.84, 0.3, 1);
  transition-delay: var(--d, 0s);
  will-change: opacity, transform;
}
.has-reveal [data-reveal].is-in { opacity: 1; transform: translate3d(0, 0, 0); }

@media (prefers-reduced-motion: reduce) {
  .lp-eyebrow, .lp-stage, .lp-caption, .lp-intro { animation: none; }
  .has-reveal [data-reveal] { opacity: 1; transform: none; transition: none; }
}

@media (max-width: 780px) {
  .foot-top { grid-template-columns: 1fr; align-items: start; gap: 1.5rem; }
  .foot-cta { justify-content: flex-start; }
  .foot-cta .foot-btn { flex: 1 1 100%; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 1.75rem 1.25rem; margin-top: 2.25rem; padding-top: 1.9rem; }
  .foot-wordmark { margin-top: 2rem; text-align: left; font-size: 13.6vw; }
  .foot-bottom { flex-direction: column; align-items: flex-start; gap: 0.55rem; }
  .lp-header-actions { gap: 0.9rem; }
}
@media (max-width: 380px) {
  .foot-grid { grid-template-columns: 1fr; }
}


/* ---------- profile menu ---------- */
.profile { position: relative; }
.profile-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: none; background: none; cursor: pointer; border-radius: 999px;
}
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-2);
  border: 1px solid #d5e4db; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.avatar svg { width: 21px; height: 21px; display: block; }
.profile-btn:hover .avatar { background: #e2eee7; border-color: #c6dbcf; }
.profile-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 70;
  width: 236px; padding: 0.4rem;
  background: #ffffff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 24px 50px -30px rgba(35, 40, 35, 0.5);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}
.profile.open .profile-menu { opacity: 1; visibility: visible; transform: none; }
.profile-who {
  display: flex; flex-direction: column; gap: 0.1rem;
  padding: 0.55rem 0.65rem 0.6rem; margin-bottom: 0.3rem; border-bottom: 1px solid var(--line);
}
.profile-who strong { font-size: 0.87rem; font-weight: 500; color: var(--ink); }
.profile-who span { font-size: 0.75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.profile-menu a, .profile-logout {
  display: block; width: 100%; text-align: left; padding: 0.55rem 0.65rem;
  border: none; border-radius: 10px; background: none; font: inherit;
  font-size: 0.85rem; color: var(--ink-soft); cursor: pointer;
}
.profile-menu a:hover, .profile-logout:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.profile-menu form { margin: 0.25rem 0 0; padding-top: 0.25rem; border-top: 1px solid var(--line); }
.profile-logout { color: #92302c; }
.profile.floating { position: fixed; top: 14px; right: 14px; z-index: 61; }
.profile.floating .profile-btn {
  padding: 3px; background: var(--paper-2);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}

/* drawer settings */
.drawer-settings { margin-top: 0.35rem; }
.drawer-settings .drawer-ico { color: var(--accent); }

@media (max-width: 640px) {
  .profile-menu { right: -6px; }
  .profile.floating .profile-menu { right: 0; }
}

/* ---------- group chat ---------- */
.chat-card {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  position: relative; min-height: 0;
}
.chat-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #f7df9a, #c9962a 50%, #f7df9a);
  opacity: 0.9; z-index: 1;
}
.chat-card--fit { min-height: 0; }
.chat-card--fit .chat-list { height: auto; flex: 1; min-height: 0; }

.chat-head {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.8rem 1rem; border-bottom: 1px solid #f0e6cf;
  background: linear-gradient(180deg, #fdfaf1, #fffdf8);
}
.chat-head-icon {
  flex: none; width: 36px; height: 36px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #9a7314; background: radial-gradient(circle at 30% 25%, #fff7dd, #f3e2b0);
  box-shadow: 0 0 0 1px rgba(184, 134, 11, 0.18), 0 6px 16px -8px rgba(184, 134, 11, 0.55);
}
.chat-head-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.chat-head-text strong { font-size: 0.86rem; color: #4a3f22; }
.chat-head-text span { font-size: 0.74rem; color: #8a7c55; line-height: 1.4; }

.chat-list {
  height: clamp(340px, 56dvh, 620px); overflow-y: auto; padding: 1rem 1rem 0.5rem;
  background: linear-gradient(#fcfcfb, #fbfaf7); display: flex; flex-direction: column;
  gap: 0.8rem; scroll-behavior: smooth; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.chat-empty { margin: auto; text-align: center; max-width: 330px; padding: 2rem 1rem; }
.chat-empty h3 { margin: 0.6rem 0 0.2rem; }
.chat-empty p { font-size: 0.85rem; margin: 0; }
.chat-empty-icon {
  width: 48px; height: 48px; border-radius: 16px;
  background: radial-gradient(circle at 30% 25%, #fff7dd, #f3e2b0);
  color: #9a7314; display: flex; align-items: center; justify-content: center; margin: 0 auto;
  box-shadow: 0 0 0 1px rgba(184, 134, 11, 0.16), 0 10px 22px -14px rgba(184, 134, 11, 0.7);
}
.chat-msg { display: flex; gap: 0.6rem; align-items: flex-end; max-width: 86%; }
.chat-msg.mine { margin-left: auto; flex-direction: row-reverse; }
.chat-avatar {
  flex: none; width: 30px; height: 30px; border-radius: 50%; background: #e8efe9;
  color: var(--accent-2); display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; border: 1px solid #d7e3da;
}
.chat-msg.mine .chat-avatar { background: var(--accent); color: #ffffff; border-color: var(--accent); }
.chat-bubble-wrap { min-width: 0; }
.chat-meta {
  display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
  margin-bottom: 0.18rem; font-size: 0.72rem; color: var(--muted);
}
.chat-msg.mine .chat-meta { justify-content: flex-end; }
.chat-name { font-weight: 700; color: var(--ink); font-size: 0.76rem; }
.chat-time { font-size: 0.68rem; color: var(--muted); }
.chat-bubble {
  background: #ffffff; border: 1px solid var(--line); border-radius: 14px 14px 14px 4px;
  padding: 0.6rem 0.8rem; font-size: 0.92rem; color: #1f2937;
  word-break: break-word; box-shadow: 0 1px 1px rgba(35, 40, 35, 0.03);
}
.chat-text { white-space: pre-wrap; display: block; }
.chat-photo {
  display: block; margin-top: 0.45rem; max-width: 260px;
  border-radius: 12px; overflow: hidden; border: 1px solid rgba(35, 40, 35, 0.08);
}
.chat-photo:hover { text-decoration: none; }
.chat-photo img { display: block; width: 100%; height: auto; max-height: 340px; object-fit: cover; }
.chat-bubble--photo { padding: 0.28rem; }
.chat-bubble--photo .chat-photo { margin-top: 0; }
.chat-msg.mine .chat-bubble {
  background: var(--accent); color: #ffffff; border-color: var(--accent);
  border-radius: 14px 14px 4px 14px;
}
.chat-form {
  display: flex; gap: 0.5rem; align-items: flex-end; padding: 0.7rem 0.8rem;
  border-top: 1px solid var(--line); background: var(--paper-2); flex: none;
}
.chat-compose { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.chat-form input { width: 100%; border-radius: 999px; padding: 0.7rem 1rem; }

.chat-attach, .chat-send {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; border: 1px solid transparent;
  transition: transform 0.12s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.chat-attach {
  background: #fffdf3; color: #9a7314; border-color: #ecdfba;
  box-shadow: 0 0 0 1px rgba(184, 134, 11, 0.06), 0 8px 18px -12px rgba(184, 134, 11, 0.6);
}
.chat-attach:hover { background: #fdf6e0; }
.chat-send {
  background: linear-gradient(145deg, #f5d986, #c9962a 55%, #a97d18);
  color: #2b2208;
  box-shadow:
    0 0 0 1px rgba(184, 134, 11, 0.28),
    0 10px 24px -10px rgba(201, 150, 42, 0.85),
    0 0 24px rgba(234, 196, 106, 0.35);
}
.chat-send:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(184, 134, 11, 0.35),
    0 14px 28px -10px rgba(201, 150, 42, 0.9),
    0 0 30px rgba(234, 196, 106, 0.45);
}
.chat-send:active { transform: translateY(1px); }
.chat-attach[disabled], .chat-send[disabled] { opacity: 0.55; cursor: not-allowed; box-shadow: none; }

.chat-preview {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0.45rem; border: 1px solid #ecdfba; background: #fffdf5; border-radius: 12px;
}
.chat-preview[hidden] { display: none; }
.chat-preview img { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; flex: none; }
.chat-preview-label {
  flex: 1; min-width: 0; font-size: 0.74rem; color: #8a7c55;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-preview-remove {
  flex: none; width: 24px; height: 24px; border-radius: 50%; border: none;
  background: #f4ead2; color: #6b5a2e; cursor: pointer; font-size: 1rem; line-height: 1;
}

.chat-hint { margin: 0; padding: 0 1rem 0.8rem; font-size: 0.7rem; color: var(--muted); background: var(--paper-2); }
.chat-hint--err { color: var(--danger); font-weight: 600; }

@media (max-width: 640px) {
  .chat-msg { max-width: 94%; }
  .chat-card { border-radius: 16px; }
  .chat-list { height: clamp(300px, 52dvh, 560px); }
  .chat-card--fit .chat-list { height: auto; }
  .chat-photo { max-width: 220px; }
  .chat-form { padding: 0.55rem 0.6rem; gap: 0.4rem; }
  .chat-attach, .chat-send { width: 42px; height: 42px; }
  .chat-head { padding: 0.65rem 0.8rem; }
}

/* ---------- upline private chat (floating) ---------- */
.upline-chat { position: fixed; left: 16px; bottom: 16px; z-index: 75; }
.upline-chat__toggle {
  position: relative; width: 54px; height: 54px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--accent); color: #ffffff;
  cursor: pointer; box-shadow: 0 14px 30px -14px rgba(20, 97, 74, 0.6);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.upline-chat__toggle:hover { transform: translateY(-1px); box-shadow: 0 18px 36px -14px rgba(20, 97, 74, 0.65); }
.upline-chat__toggle svg { width: 26px; height: 26px; }
.upline-chat__badge {
  position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center; border-radius: 999px;
  background: var(--clay); color: #ffffff; font-size: 0.66rem; font-weight: 700;
  border: 2px solid var(--paper);
}
.upline-chat__badge[hidden] { display: none; }
.upline-chat__window {
  position: absolute; left: 0; bottom: calc(100% + 12px);
  width: min(372px, calc(100vw - 32px)); height: min(540px, 70vh);
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 28px 70px -28px rgba(17, 24, 39, 0.45);
  display: flex; flex-direction: column; overflow: hidden;
}
.upline-chat__window[hidden] { display: none; }
.upline-chat__head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.8rem 0.9rem; border-bottom: 1px solid var(--line); background: var(--paper-2);
}
.upline-chat__head strong { display: block; font-size: 0.92rem; color: var(--ink); }
.upline-chat__head span { display: block; font-size: 0.7rem; color: var(--muted); margin-top: 0.05rem; }
.upline-chat__close {
  border: none; background: var(--hover); border-radius: 50%; width: 30px; height: 30px;
  cursor: pointer; font-size: 1.05rem; line-height: 1; color: var(--ink-soft);
}
.upline-chat__close:hover { background: var(--line); color: var(--ink); }
.upline-chat__contacts { flex: 1; overflow-y: auto; padding: 0.4rem; }
.upline-chat__contact {
  display: flex; align-items: center; gap: 0.65rem; width: 100%; text-align: left;
  padding: 0.65rem 0.7rem; border: none; background: none; border-radius: 12px;
  cursor: pointer; font: inherit;
}
.upline-chat__contact:hover { background: var(--hover); }
.upline-chat__avatar {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem; font-weight: 700; border: 1px solid #d7e3da;
}
.upline-chat__contact-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.upline-chat__contact-top { display: flex; align-items: center; gap: 0.45rem; min-width: 0; }
.upline-chat__contact-name {
  font-size: 0.86rem; font-weight: 700; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.upline-chat__contact-rel {
  flex: none; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase; color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: 0.1rem 0.4rem;
}
.upline-chat__contact-last {
  font-size: 0.75rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.upline-chat__unread {
  flex: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: #ffffff; font-size: 0.64rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.upline-chat__thread { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.upline-chat__thread[hidden] { display: none; }
.upline-chat__thread-head {
  display: flex; align-items: center; gap: 0.55rem; padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line); background: var(--paper-2);
}
.upline-chat__thread-head strong { display: block; font-size: 0.86rem; color: var(--ink); }
.upline-chat__thread-head span { display: block; font-size: 0.66rem; color: var(--muted); }
.upline-chat__back {
  flex: none; width: 30px; height: 30px; border: none; border-radius: 8px;
  background: var(--hover); color: var(--ink); cursor: pointer; font-size: 1rem;
}
.upline-chat__back:hover { background: var(--line); }
.upline-chat__messages {
  flex: 1; overflow-y: auto; padding: 0.75rem; background: linear-gradient(#fcfcfb, #fbfaf7);
  display: flex; flex-direction: column; gap: 0.5rem;
}
.upline-chat__msg { max-width: 88%; display: flex; flex-direction: column; gap: 0.12rem; }
.upline-chat__msg.mine { align-self: flex-end; align-items: flex-end; }
.upline-chat__bubble {
  background: #ffffff; border: 1px solid var(--line); border-radius: 12px 12px 12px 4px;
  padding: 0.5rem 0.7rem; font-size: 0.88rem; color: #1f2937;
  white-space: pre-wrap; word-break: break-word;
}
.upline-chat__msg.mine .upline-chat__bubble {
  background: var(--accent); color: #ffffff; border-color: var(--accent);
  border-radius: 12px 12px 4px 12px;
}
.upline-chat__msg-time { font-size: 0.64rem; color: var(--muted); }
.upline-chat__thread-empty { margin: auto; text-align: center; font-size: 0.8rem; color: var(--muted); padding: 1.5rem; }
.upline-chat__form {
  display: flex; gap: 0.45rem; padding: 0.6rem 0.7rem;
  border-top: 1px solid var(--line); background: var(--paper-2);
}
.upline-chat__form input { flex: 1; min-width: 0; padding: 0.55rem 0.8rem; border-radius: 999px; font-size: 0.86rem; }
.upline-chat__form button {
  flex: none; border: none; border-radius: 999px; background: var(--accent); color: #ffffff;
  padding: 0.55rem 0.9rem; font-size: 0.8rem; font-weight: 700; cursor: pointer;
}
.upline-chat__form button:hover { background: var(--accent-2); }
.upline-chat__form button[disabled] { opacity: 0.55; cursor: not-allowed; }
.upline-chat__hint { margin: 0; padding: 0 0.8rem 0.55rem; font-size: 0.66rem; color: var(--muted); background: var(--paper-2); }
.upline-chat__hint--err { color: var(--danger); font-weight: 600; }
.upline-chat__empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 1.6rem 1.2rem;
}
.upline-chat__empty[hidden] { display: none; }
.upline-chat__empty-icon {
  width: 46px; height: 46px; border-radius: 15px; background: var(--accent-soft);
  color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 0.6rem;
}
.upline-chat__empty strong { font-size: 0.9rem; color: var(--ink); }
.upline-chat__empty p { font-size: 0.8rem; color: var(--muted); margin: 0.25rem 0 0; max-width: 240px; }

.upline-chat--panel .upline-chat__toggle { display: none; }
.upline-chat--panel .upline-chat__window { position: fixed; left: 16px; bottom: 16px; }

@media (max-width: 640px) {
  .upline-chat { left: 12px; bottom: 12px; }
  .upline-chat__window { width: calc(100vw - 24px); height: min(72vh, 560px); }
  .upline-chat__toggle { width: 50px; height: 50px; }
  .upline-chat--panel .upline-chat__window { left: 12px; bottom: 12px; }
}

/* ---------- group chat launch button (dashboard) ---------- */
.group-chat-fab {
  position: fixed; left: 16px; bottom: 16px; z-index: 74;
  width: 54px; height: 54px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--accent); color: #ffffff;
  box-shadow: 0 14px 30px -14px rgba(20, 97, 74, 0.6);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.group-chat-fab:hover { transform: translateY(-1px); box-shadow: 0 18px 36px -14px rgba(20, 97, 74, 0.65); color: #ffffff; }
.group-chat-fab svg { width: 26px; height: 26px; display: block; }

@media (max-width: 640px) {
  .group-chat-fab { left: 12px; bottom: 12px; width: 50px; height: 50px; }
}

/* ---------- invite / share ---------- */
.invite {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 70;
}
.invite__btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1.05rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper-2); color: var(--ink);
  font: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 16px 34px -18px rgba(17, 24, 39, 0.55);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.invite__btn:hover { transform: translateY(-1px); border-color: var(--line-strong); box-shadow: 0 20px 40px -18px rgba(17, 24, 39, 0.6); }
.invite__btn svg { width: 20px; height: 20px; }
.invite__sheet {
  position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%);
  width: min(330px, calc(100vw - 32px));
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 28px 70px -28px rgba(17, 24, 39, 0.45); overflow: hidden;
}
.invite__sheet[hidden] { display: none; }
.invite__head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.7rem 0.7rem 0.7rem 1rem; border-bottom: 1px solid var(--line);
}
.invite__head strong { font-size: 0.92rem; color: var(--ink); }
.invite__close {
  width: 28px; height: 28px; border: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--hover); color: var(--ink-soft); font-size: 1rem; line-height: 1; cursor: pointer;
}
.invite__close:hover { background: var(--line); color: var(--ink); }
.invite__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.3rem; padding: 0.55rem; }
.invite__opt {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
  padding: 0.6rem 0.25rem; border: none; border-radius: 12px; background: none;
  font: inherit; font-size: 0.68rem; font-weight: 600; color: var(--ink-soft);
  text-decoration: none; cursor: pointer;
}
.invite__opt:hover { background: var(--hover); color: var(--ink); }
.invite__opt svg { width: 24px; height: 24px; }
.invite__opt--wa { color: #1f9d55; }
.invite__opt--fb { color: #1877f2; }
.invite__opt--x { color: var(--ink); }
.invite__opt--tg { color: #229ed9; }
.invite__hint {
  margin: 0; padding: 0.15rem 0.8rem 0.7rem; text-align: center;
  font-size: 0.7rem; color: var(--muted);
}
.invite__hint[hidden] { display: none; }
.invite__hint--ok { color: var(--accent); font-weight: 700; }
@media (max-width: 640px) {
  .invite { bottom: 74px; }
  body.is-student footer { padding-bottom: 8.5rem; }
}

/* ---------- referrals: header + balance tiles ---------- */
.ref-hero {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin: 0.25rem 0 1.5rem;
}
.ref-kicker {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: #8a6a12; background: linear-gradient(180deg, #fdf7e6, #faf0d6);
  border: 1px solid #ecd9a5; padding: 0.3rem 0.7rem; border-radius: 999px; margin-bottom: 0.7rem;
}
.ref-kicker svg { width: 13px; height: 13px; }
.ref-hero h1 { font-size: clamp(1.7rem, 4vw, 2.2rem); margin: 0 0 0.2rem; }
.ref-hero p { margin: 0; font-size: 0.95rem; color: var(--ink-soft); }
.ref-balances {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem; margin-bottom: 1.75rem;
}
.ref-bal {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 0.4rem;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 18px;
  padding: 0.9rem 1rem 1rem;
  box-shadow: 0 1px 2px rgba(35, 40, 35, 0.03), 0 18px 34px -34px rgba(35, 40, 35, 0.5);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.ref-bal::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(184, 134, 11, 0.6), transparent);
  opacity: 0; transition: opacity 0.2s ease;
}
.ref-bal:hover { transform: translateY(-2px); border-color: #e7dcc0; box-shadow: 0 22px 40px -30px rgba(35, 40, 35, 0.55); }
.ref-bal:hover::after { opacity: 1; }
.ref-bal__ico {
  width: 36px; height: 36px; border-radius: 12px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 0.15rem;
}
.ref-bal__ico svg { width: 19px; height: 19px; }
.ref-bal__l {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
}
.ref-bal__n {
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: 1.25rem; line-height: 1.15; color: var(--ink);
}
.ref-bal--gold { background: linear-gradient(180deg, #fffdf7, #fdf5e3); border-color: #eddbaa; }
.ref-bal__ico--gold {
  background: linear-gradient(160deg, #fff5d4, #f6dc9a); color: #8a6a12;
  box-shadow: inset 0 0 0 1px #eedfb4, 0 6px 16px -9px rgba(184, 134, 11, 0.9);
}
.ref-bal--gold .ref-bal__n { color: #6b5209; }

@media (max-width: 720px) {
  .ref-balances { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ref-bal__n { font-size: 1.15rem; }
}
@media (max-width: 420px) {
  .ref-balances { grid-template-columns: 1fr; }
  .ref-hero { align-items: flex-start; }
}

/* ---------- referrals: section headings, steps, payout cards ---------- */
.ref-h2 {
  display: flex; align-items: center; gap: 0.55rem;
  font-size: 1.15rem; margin: 0 0 0.55rem;
}
.ref-h2__ico,
.ref-section__ico {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 10px;
  background: linear-gradient(160deg, #fff6d9, #f6e2ae); color: #8a6a12;
  box-shadow: inset 0 0 0 1px #efdfb6, 0 6px 14px -10px rgba(184, 134, 11, 0.9);
}
.ref-h2__ico svg { width: 16px; height: 16px; }
.ref-help {
  font-size: 0.85rem; line-height: 1.6; color: var(--muted);
  margin: -0.15rem 0 0.9rem; max-width: 62ch;
}
.ref-section {
  display: flex; align-items: center; gap: 0.55rem;
  font-size: 1.3rem; margin: 2.4rem 0 0.25rem;
}
.ref-section + .ref-help { margin: 0 0 0.9rem; }
.ref-steps { list-style: none; margin: 0 0 0.25rem; padding: 0; display: grid; gap: 0.55rem; }
.ref-steps li {
  position: relative; padding-left: 1.6rem;
  font-size: 0.92rem; line-height: 1.55; color: var(--ink-soft);
}
.ref-steps li::before {
  content: ""; position: absolute; left: 0.15rem; top: 0.45rem;
  width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(160deg, #f7dfa0, #d9b45a);
  box-shadow: 0 0 0 3px rgba(247, 223, 160, 0.35);
}
.ref-payout {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 18px;
  padding: 1rem 1.1rem; margin-bottom: 0.8rem;
  box-shadow: 0 1px 2px rgba(35, 40, 35, 0.03), 0 18px 34px -34px rgba(35, 40, 35, 0.5);
}
.ref-payout__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.ref-payout__who { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.ref-avatar {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #fdf3d6, #f5dfa6); color: #6b5209;
  font-weight: 700; font-size: 0.95rem;
  box-shadow: inset 0 0 0 1px #eedfb4;
}
.ref-payout__amt { text-align: right; flex: none; }
.ref-payout__amt .serif { font-size: 1.15rem; color: var(--ink); line-height: 1.2; }
.ref-payout__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-top: 0.6rem; }
.ref-payout__dest { font-size: 0.85rem; color: var(--ink-soft); }
@media (max-width: 520px) {
  .ref-payout__top { flex-direction: column; gap: 0.5rem; }
  .ref-payout__amt { text-align: left; }
}
/* ---------- group chat: full-height room ---------- */
.chat-page { padding: 0.75rem 0 1rem; }
.chat-page .chat-card { flex: 1; }
.chat-head-text strong { font-size: 0.95rem; }
[data-chat-count] { font-variant-numeric: tabular-nums; }
.chat-live {
  margin-left: auto; flex: none;
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.69rem; font-weight: 700; letter-spacing: 0.02em;
  color: #8a6a12; background: #fffdf4; border: 1px solid #ecdfba;
  border-radius: 999px; padding: 0.25rem 0.6rem;
}
.chat-live .dot {
  width: 7px; height: 7px; border-radius: 50%; background: #c9962a;
  box-shadow: 0 0 0 3px rgba(201, 150, 42, 0.18);
}
@media (max-width: 640px) {
  .chat-page { padding: 0.5rem 0 0.6rem; }
  .chat-live { font-size: 0.64rem; padding: 0.2rem 0.5rem; }
}

/* ---------- shared: gold header pill on lessons / Q&A / settings ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- songs & listening credits ---------- */
.credit-note {
  font-size: 0.86rem; line-height: 1.6; color: var(--ink-soft);
  background: var(--accent-soft); border: 1px solid #d6e7dd; border-radius: 12px;
  padding: 0.7rem 0.95rem; margin: 0 0 1.75rem;
}
.credit-note strong { color: var(--accent-2); }
.song-list { display: flex; flex-direction: column; gap: 0.75rem; }
.song-card {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1rem 1.15rem; background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.song-card:hover { border-color: var(--line-strong); box-shadow: 0 18px 34px -30px rgba(35, 40, 35, 0.55); }
.song-cover {
  width: 52px; height: 52px; border-radius: 14px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--accent-soft), #dcebe3); color: var(--accent);
}
.song-cover svg { width: 24px; height: 24px; }
.song-main { flex: 1; min-width: 0; }
.song-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; flex-wrap: wrap; }
.song-title { margin: 0 0 0.15rem; font-size: 1.05rem; }
.song-meta { font-size: 0.8rem; color: var(--muted); }
.song-earn { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.song-audio { width: 100%; margin-top: 0.7rem; height: 42px; accent-color: var(--accent); }
.song-note { margin: 0.55rem 0 0; font-size: 0.85rem; color: var(--ink-soft); }
.song-card form { flex: none; }

@media (max-width: 620px) {
  .song-card { flex-wrap: wrap; }
  .song-cover { width: 42px; height: 42px; border-radius: 12px; }
  .song-cover svg { width: 20px; height: 20px; }
  .song-main { flex: 1 1 100%; order: 2; }
  .song-card form { order: 3; margin-left: auto; }
}

/* ---------- student dashboard top ---------- */
.apphead--student {
  padding-top: 0.85rem;
  padding-bottom: calc(4.75rem + env(safe-area-inset-bottom));
}

.latest-card {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 0.8rem;
  margin-bottom: 1rem; padding: 0.8rem 1rem;
  border: 1px solid #ebd8a2; border-radius: 18px;
  background: linear-gradient(115deg, #fffdf6 0%, #fbf2d8 45%, #fffdf6 100%);
  box-shadow: 0 16px 34px -30px rgba(184, 134, 11, 0.75), inset 0 1px 0 #ffffff;
  color: var(--ink); text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.latest-card:hover {
  transform: translateY(-2px); border-color: #e2ca8b; text-decoration: none;
  box-shadow: 0 22px 42px -28px rgba(184, 134, 11, 0.85), inset 0 1px 0 #ffffff;
}
.latest-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.latest-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, 0.85) 50%, transparent 65%);
  transform: translateX(-120%);
  animation: latest-sheen 6s ease-in-out infinite;
}
.latest-card > * { position: relative; z-index: 1; }
.latest-card__icon {
  flex: none; width: 40px; height: 40px; border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #fff5d4, #f2d791); color: #8a6a12;
  box-shadow: inset 0 0 0 1px #eedfb4, 0 8px 18px -12px rgba(184, 134, 11, 0.9);
}
.latest-card__icon svg { width: 22px; height: 22px; }
.latest-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.12rem; }
.latest-card__label {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: #8a6a12;
}
.latest-card__viewport {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
}
.latest-card__track { display: flex; width: max-content; animation: latest-marquee 17s linear infinite; will-change: transform; }
.latest-card__title {
  flex: none; padding-right: 3rem;
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: 1.02rem; font-weight: 600; line-height: 1.25;
  color: var(--ink); white-space: nowrap;
}
.latest-card:hover .latest-card__track,
.latest-card:hover::after { animation-play-state: paused; }
.latest-card__arrow {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fffdf5; border: 1px solid #ecd9a5; color: #8a6a12;
  transition: transform 0.18s ease, background 0.18s ease;
}
.latest-card__arrow svg { width: 17px; height: 17px; }
.latest-card:hover .latest-card__arrow { transform: translateX(3px); background: #fdf6e0; }

/* Latest card: course photo with a subtle glitch layer */
.latest-card--glitch {
  color: #fff; min-height: 128px;
  border-color: rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(90deg, rgba(12, 20, 36, 0.94) 0%, rgba(12, 20, 36, 0.72) 46%, rgba(12, 20, 36, 0.22) 100%),
    url("/img/course.jpg") right 68% / 190% auto no-repeat;
  box-shadow: 0 18px 36px -30px rgba(10, 18, 34, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.latest-card--glitch:hover {
  border-color: rgba(255, 255, 255, 0.38);
  box-shadow: 0 24px 44px -28px rgba(10, 18, 34, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.latest-card--glitch::before {
  content: ""; position: absolute; inset: -6% -4%; pointer-events: none; z-index: 0;
  background: url("/img/course.jpg") right 68% / 190% auto no-repeat;
  opacity: 0.18;
  animation: latest-glitch 8s steps(1, end) infinite;
  will-change: transform, opacity;
}
.latest-card--glitch .latest-card__label { color: #f4d98e; }
.latest-card--glitch .latest-card__title { color: #fff; text-shadow: 0 1px 10px rgba(6, 12, 24, 0.7); }
.latest-card--glitch .latest-card__icon {
  background: rgba(255, 255, 255, 0.16); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}
.latest-card--glitch .latest-card__arrow {
  background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.32); color: #fff;
}
.latest-card--glitch:hover .latest-card__arrow { background: rgba(255, 255, 255, 0.26); }

@keyframes latest-glitch {
  0%, 91%, 100% { transform: translate3d(0, 0, 0); opacity: 0.16; clip-path: inset(0 0 0 0); }
  92% { transform: translate3d(-7px, 1px, 0); opacity: 0.45; clip-path: inset(8% 0 68% 0); }
  93% { transform: translate3d(8px, -2px, 0); opacity: 0.32; clip-path: inset(54% 0 18% 0); }
  94% { transform: translate3d(-4px, 2px, 0); opacity: 0.5; clip-path: inset(30% 0 42% 0); }
  95% { transform: translate3d(5px, 0, 0); opacity: 0.28; clip-path: inset(72% 0 6% 0); }
  96% { transform: translate3d(0, 0, 0); opacity: 0.16; clip-path: inset(0 0 0 0); }
}
@keyframes latest-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes latest-sheen {
  0%, 55% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}
@media (prefers-reduced-motion: reduce) {
  .latest-card, .latest-card__track, .latest-card::after, .latest-card::before, .latest-card__arrow {
    animation: none; transition: none;
  }
  .latest-card__title[aria-hidden="true"] { display: none; }
}
@media (max-width: 640px) {
  .latest-card { padding: 0.7rem 0.75rem; gap: 0.65rem; border-radius: 16px; }
  .latest-card--glitch { min-height: 104px; }
  .latest-card::after, .latest-card--glitch::before { animation: none; opacity: 0; }
  .latest-card__icon { width: 36px; height: 36px; border-radius: 12px; }
  .latest-card__title { font-size: 0.95rem; padding-right: 2.4rem; }
  .latest-card__arrow { width: 30px; height: 30px; }
  .apphead--student { padding-bottom: calc(9.5rem + env(safe-area-inset-bottom)); }
}

.student-top {
  width: 100%;
  padding: 0.35rem 1rem 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 0.5rem 1rem;
}
.student-top__side { min-width: 0; }
.student-top__side--right { justify-self: end; text-align: right; }
.student-course {
  display: block;
  max-width: 100%;
  padding-top: 0.2rem;
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: 1rem;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.student-greeting {
  margin: 0;
  text-align: center;
  font-size: clamp(1.5rem, 3.4vw, 2.35rem);
  line-height: 1.1;
}
.student-top .live { padding-top: 0.45rem; }

/* balance cards with the icon on the left */
.ref-bal--ico-left {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "ico label"
    "ico value";
  align-items: center;
  column-gap: 0.6rem;
  row-gap: 0.05rem;
  padding: 0.62rem 0.8rem;
}
.ref-bal--ico-left .ref-bal__ico { grid-area: ico; margin: 0; width: 32px; height: 32px; border-radius: 10px; }
.ref-bal--ico-left .ref-bal__l { grid-area: label; }
.ref-bal--ico-left .ref-bal__n { grid-area: value; }

@media (max-width: 640px) {
  .student-top {
    grid-template-columns: 1fr auto;
    row-gap: 0.5rem;
    padding-top: 0.2rem;
  }
  .student-greeting {
    grid-column: 1 / -1;
    grid-row: 1;
    font-size: 1.5rem;
  }
  .student-top__side { grid-row: 2; }
  .student-top__side--right { justify-self: end; }
}

/* ---------- group chat: standalone page ---------- */
body.chat-standalone { padding-top: 0; overflow: hidden; }
body.chat-standalone .menu-btn.floating,
body.chat-standalone .profile.floating,
body.chat-standalone .drawer,
body.chat-standalone .menu-overlay,
body.chat-standalone .notif,
body.chat-standalone .upline-chat,
body.chat-standalone .topbar,
body.chat-standalone .norefund,
body.chat-standalone .site-footer { display: none !important; }

body.chat-standalone .chat-page {
  width: min(980px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0.85rem 1rem 1rem;
  display: flex;
  flex-direction: column;
}
body.chat-standalone .chat-card { flex: 1; min-height: 0; }
body.chat-standalone .chat-list { flex: 1; height: auto; min-height: 0; }

.chat-topbar {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.55rem 0.7rem; margin-bottom: 0.75rem;
  background: rgba(255, 255, 255, 0.92); border: 1px solid var(--line);
  border-radius: 22px; box-shadow: var(--shadow);
}
.chat-back {
  flex: none; display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.5rem 0.85rem 0.5rem 0.65rem; border-radius: 999px;
  background: var(--paper-2); border: 1px solid var(--line);
  color: var(--ink-soft); font-size: 0.82rem; font-weight: 600;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.chat-back:hover { background: var(--hover); color: var(--ink); border-color: var(--line-strong); text-decoration: none; }
.chat-back svg { width: 17px; height: 17px; }
.chat-title { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.chat-title-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  object-fit: cover; border: 1px solid var(--line); background: #ffffff;
  box-shadow: 0 4px 12px -8px rgba(35, 40, 35, 0.45);
}
.chat-title-text { display: flex; flex-direction: column; gap: 0.05rem; min-width: 0; }
.chat-title-text strong { font-size: 0.95rem; color: var(--ink); }
.chat-title-text span { font-size: 0.72rem; color: var(--muted); }
.chat-topbar .chat-live { margin-left: auto; }

@media (max-width: 520px) {
  body.chat-standalone .chat-page { padding: 0.55rem 0.6rem 0.7rem; }
  .chat-topbar { padding: 0.5rem; gap: 0.5rem; border-radius: 18px; }
  .chat-back { padding: 0.48rem; }
  .chat-back span { display: none; }
  .chat-title-avatar { width: 36px; height: 36px; }
  .chat-topbar .chat-live { font-size: 0.62rem; padding: 0.2rem 0.45rem; }
}

.card, .form-card, .stat, .lesson-item, .q, .song-card, .chat-card, .ref-payout, .ref-bal {
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.94), rgba(244, 249, 255, 0.86));
  box-shadow:
    0 16px 36px -34px rgba(31, 52, 80, 0.38),
    inset 0 1px 0 #ffffff;
}
