:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #d8ddd7;
  color: #111;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
  margin: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(120deg, rgba(255,255,255,.55), rgba(255,255,255,0)),
    #d8ddd7;
}

.desktop-mode body {
  display: block;
  background: #ededed;
}

button,
input {
  font: inherit;
}

.phone-shell {
  width: min(430px, 100vw);
  height: min(860px, 100dvh);
  min-height: 620px;
  background: #ededed;
  overflow: hidden;
  position: relative;
  box-shadow: 0 24px 80px rgba(20, 30, 24, .24);
}

.desktop-mode .phone-shell {
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  box-shadow: none;
}

.desktop-mode .welcome-panel {
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
}

.desktop-mode .chat-item {
  min-height: 62px;
}

.desktop-mode .bubble {
  max-width: min(680px, 76%);
}

@media (max-width: 520px) {
  body {
    display: block;
    background: #ededed;
  }

  .phone-shell {
    width: 100vw;
    height: 100dvh;
    min-height: 0;
    box-shadow: none;
  }
}

.screen,
.view {
  display: none;
}

.screen-active,
.view-active {
  display: flex;
}

.screen {
  position: absolute;
  inset: 0;
  flex-direction: column;
}

.status-bar {
  height: 48px;
  padding: 14px 18px 0;
  display: flex;
  justify-content: space-between;
  color: #5f6b64;
  font-size: 13px;
}

.welcome-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 36px;
  overflow-y: auto;
}

.welcome-banner {
  width: 100%;
  flex-shrink: 0;
  background: #f0f0f0;
}

.welcome-banner img {
  display: block;
  width: 100%;
  height: auto;
}

.brand-mark {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #19be6b;
  color: white;
  font-size: 34px;
  font-weight: 700;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.15;
}

.welcome-panel p {
  color: #6c746f;
  margin-top: 10px;
  margin-bottom: 18px;
}

.auto-login-loading {
  text-align: center;
  padding: 30px 0;
}

.auto-login-loading p {
  margin-top: 14px;
  color: #6c746f;
  font-size: 14px;
}

.auto-login-loading .loading-sub {
  margin-top: 4px;
  font-size: 12px;
  color: #9aa39a;
}

.spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto;
  border: 3px solid #e0e2e0;
  border-top-color: #19be6b;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* 按钮内小 spinner */
.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: -2px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ===== 全屏登录加载遮罩 ===== */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fff;
}
.login-overlay.show {
  display: flex;
}
.login-overlay .spinner {
  width: 44px;
  height: 44px;
  border-width: 4px;
}
.login-overlay p {
  margin-top: 18px;
  color: #333;
  font-size: 16px;
  font-weight: 500;
}
.login-overlay .loading-sub {
  margin-top: 6px;
  font-size: 13px;
  color: #999;
}
.loading-progress {
  width: min(260px, calc(100vw - 64px));
  height: 6px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eeeb;
}
.loading-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #19be6b;
  transition: width .16s ease-out;
}
.login-overlay.progress-indeterminate .loading-progress-fill {
  width: 34%;
  animation: loading-sweep 1.25s ease-in-out infinite alternate;
}
@keyframes loading-sweep {
  from { transform: translateX(-30%); }
  to { transform: translateX(220%); }
}
.loading-progress-text {
  min-height: 18px;
  margin-top: 7px !important;
  color: #748078 !important;
  font-size: 12px !important;
  font-weight: 400 !important;
}
.loading-retry-btn {
  margin-top: 18px;
  padding: 10px 22px;
  border: 0;
  border-radius: 8px;
  background: #19a866;
  color: white;
  font-size: 14px;
  font-weight: 600;
}
.loading-retry-btn[hidden] { display: none; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

.welcome-rules {
  margin: 0 0 24px;
  padding-left: 18px;
  color: #4d5852;
  font-size: 13px;
  line-height: 1.65;
}

.field-label {
  font-size: 13px;
  color: #606a64;
  margin-bottom: 8px;
}

.name-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input {
  width: 100%;
  height: 46px;
  border: 1px solid #d3d8d5;
  border-radius: 6px;
  padding: 0 14px;
  background: white;
  outline: none;
}

input:focus {
  border-color: #19be6b;
}

input[hidden] {
  display: none;
}

button {
  border: 0;
  cursor: pointer;
}

.primary-btn,
.ghost-btn,
.icon-text-btn,
.send-btn {
  min-height: 42px;
  border-radius: 6px;
  padding: 0 16px;
}

.primary-btn,
.send-btn {
  background: #19be6b;
  color: #fff;
}

.primary-btn {
  width: 100%;
  margin-top: 18px;
}

.primary-btn.compact,
.ghost-btn.compact {
  width: auto;
  margin-top: 0;
}

.ghost-btn,
.icon-text-btn {
  background: #fff;
  color: #1e2a24;
  border: 1px solid #d3d8d5;
}

.fine-print {
  font-size: 12px;
  line-height: 1.6;
}

.app-header {
  min-height: 78px;
  padding: 10px 14px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ededed;
  border-bottom: 1px solid #dcdedc;
}

.app-header strong {
  display: block;
  font-size: 19px;
}

small {
  color: #757d78;
  font-size: 12px;
}

.account-line {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 3px;
  padding: 0;
  background: transparent;
  color: #5f6862;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}

.destroy-tip {
  max-width: min(330px, calc(100vw - 82px));
  margin-top: 3px;
  color: #a1aaa5;
  font-size: 11px;
  line-height: 1.25;
  font-weight: 400;
}

.square-btn {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: #f8f8f8;
  color: #151a17;
  border: 1px solid #d8dcda;
}

.invite-btn {
  min-width: 54px;
  height: 38px;
  padding: 0 10px;
  border-radius: 6px;
  background: #f8f8f8;
  color: #12844a;
  border: 1px solid #c8e8d5;
  font-size: 14px;
  font-weight: 700;
}

.view {
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow-x: hidden;
}

#chatView { position: relative; }

.toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px;
}

.emoji-bar {
  display: flex;
  gap: 8px;
  padding: 7px 10px;
  overflow-x: auto;
  background: #f7f7f7;
  border-top: 1px solid #dadeda;
}

.emoji-bar button {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #d8dcda;
  font-size: 20px;
}

.chat-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border-top: 1px solid #e0e2e0;
  background: #fff;
}

.chat-item {
  width: 100%;
  min-height: 68px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  background: #fff;
  border-bottom: 1px solid #eceeed;
  text-align: left;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #19be6b;
  color: #fff;
  font-weight: 700;
}

.avatar.large {
  width: 64px;
  height: 64px;
  font-size: 26px;
}

.contact-avatar {
  background: #4a8af4;
}

.chat-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.chat-title em {
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #eef4ef;
  color: #4c6758;
  font-style: normal;
  font-size: 11px;
}

.id-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  vertical-align: middle;
}

.account-pill {
  background: #e7f0ff;
  color: #1d5fd1;
}

.number-plate {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-left: 8px;
  padding: 2px 9px;
  border: 2px solid #242b33;
  border-radius: 3px;
  background: #f8fbff;
  color: #101820;
  font-family: "Consolas", "Cascadia Mono", "Courier New", monospace;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .08);
}

.large-plate {
  margin-left: 0;
  min-height: 38px;
  padding: 5px 12px;
  font-size: 34px;
}

.id-number {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #e8f8ef;
  color: #d93025;
  font-weight: 800;
  font-size: 16px;
  line-height: 1.2;
}

.temp-id-label {
  display: inline-block;
  margin-left: 8px;
  color: #8a938e;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
}

.large-id-number {
  margin-left: 0;
  padding: 3px 7px;
  font-size: 26px;
}

.group-pill {
  background: #e2f8ec;
  color: #12844a;
}

.count-pill {
  background: #f1f3f2;
  color: #59635d;
}

.compact-pill {
  margin-left: 6px;
  min-height: 18px;
  padding: 1px 6px;
  font-size: 11px;
}

.chat-preview {
  color: #7d8580;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-meta {
  display: grid;
  gap: 5px;
  justify-items: end;
  align-items: center;
  min-width: 34px;
  max-width: 110px;
  text-align: right;
}

.chat-meta small {
  white-space: nowrap;
  font-size: 11px;
  color: #999;
}

.unread-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #f04438;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.empty-state {
  padding: 56px 28px;
  text-align: center;
  color: #7a827d;
  line-height: 1.7;
}

.section-title {
  padding: 10px 14px 6px;
  color: #7a827d;
  font-size: 13px;
}

.profile-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 22px 16px;
  background: #fff;
  border-bottom: 1px solid #eceeed;
}

.profile-name {
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 6px;
}

.profile-id {
  color: #68716b;
  font-size: 13px;
}

.id-reminder-tip {
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  background: #fef3f2;
  color: #d93025;
  font-size: 11px;
  font-weight: 600;
  display: inline-block;
}

#meView {
  overflow-y: auto;
  overflow-x: hidden;
}

.settings-list {
  margin-top: 10px;
  background: #fff;
  border-top: 1px solid #eceeed;
}

.settings-item {
  width: 100%;
  min-height: 54px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: #fff;
  border-bottom: 1px solid #eceeed;
  text-align: left;
}

.settings-item small {
  color: #7a837d;
}

.danger-item span {
  color: #c23b32;
}

.contact-actions {
  display: grid;
  gap: 4px;
  justify-items: end;
  font-size: 12px;
}

.request-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
}

.request-btn {
  min-width: 54px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

.accept-btn {
  background: #19be6b;
  color: #fff;
}

.reject-btn {
  background: #fff1f0;
  color: #b42318;
  border: 1px solid #ffd0cc;
}

.mini-action {
  color: #19be6b;
}

.mini-delete {
  color: #a04a4a;
  padding: 4px 0;
}

.chat-top {
  height: 56px;
  display: grid;
  grid-template-columns: 34px 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: #ededed;
  border-bottom: 1px solid #dcdedc;
}

.chat-peer-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  background: var(--message-avatar-color, #4f86e8);
  box-shadow: 0 1px 3px rgba(34, 49, 41, .15);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.chat-peer-info { min-width: 0; display: flex; flex-direction: column; }
.chat-peer-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.chat-peer-info small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#app.chat-open > .app-header,
#app.chat-open > .header-banner { display: none !important; }

.jump-latest-btn {
  position: absolute;
  left: 16px;
  right: auto;
  bottom: 70px;
  z-index: 5;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid #d9e4df;
  border-radius: 22px;
  background: #fff;
  color: #16864f;
  box-shadow: 0 3px 12px #0002;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.jump-latest-btn[hidden] { display: none; }

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 12px;
  background: #f2f2f2;
}

.chat-history-loading {
  padding: 8px;
  color: #8a938e;
  font-size: 12px;
  text-align: center;
}

.message {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  align-items: flex-start;
}

.message.me {
  justify-content: flex-end;
}

.message-avatar {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  background: var(--message-avatar-color, #4f86e8);
  box-shadow: 0 1px 3px rgba(34, 49, 41, .15);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  user-select: none;
}

.bubble {
  max-width: min(76%, calc(100% - 42px));
  padding: 9px 11px;
  border-radius: 7px;
  background: #fff;
  line-height: 1.45;
  word-break: break-word;
}

.media-bubble {
  min-width: 128px;
}

.media-chip {
  width: 52px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  margin-right: 8px;
  border-radius: 5px;
  background: #dff5e8;
  color: #13894e;
  font-size: 13px;
  font-weight: 700;
}

.media-chip.video {
  background: #e7efff;
  color: #2d65cc;
}

.media-chip.file {
  background: #f2edf9;
  color: #7a3eb1;
}

.voice-line {
  width: 52px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
  vertical-align: middle;
}

.voice-line span {
  width: 4px;
  border-radius: 4px;
  background: #23864f;
}

.voice-line span:nth-child(1) {
  height: 12px;
}

.voice-line span:nth-child(2) {
  height: 22px;
}

.voice-line span:nth-child(3) {
  height: 16px;
}

.chat-image,
.chat-video {
  display: block;
  max-width: min(230px, 68vw);
  max-height: 260px;
  border-radius: 6px;
  object-fit: contain;
}

.chat-image-wrap {
  display: grid;
  min-width: 80px;
  min-height: 56px;
  place-items: center;
  border-radius: 6px;
  background: #e9eeeb;
}

.chat-image-wrap .chat-image,
.chat-image-loading {
  grid-area: 1 / 1;
}

.chat-image-loading {
  padding: 8px;
  color: #748078;
  font-size: 12px;
}

.chat-audio {
  width: min(230px, 68vw);
}

.file-card {
  min-width: 190px;
  max-width: min(260px, 68vw);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.file-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #f2edf9;
  color: #7a3eb1;
  font-weight: 700;
}

.file-card strong,
.file-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-card small {
  margin-top: 3px;
  color: #7a827d;
  font-size: 11px;
}

.emoji-message {
  font-size: 30px;
  line-height: 1.2;
}

.message-time {
  margin-top: 5px;
  color: #7a827d;
  font-size: 10px;
  text-align: right;
}

.read-status {
  margin-left: 4px;
  font-size: 10px;
  font-weight: 600;
}

.read-status.read {
  color: #19be6b;
}

.read-status.unread {
  color: #9ca3af;
}

/* 支付卡片 */
.pay-card {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  min-width: 180px;
}
.pay-card p {
  margin: 0 0 10px;
  font-size: 13px;
  color: #9a3412;
  line-height: 1.4;
}
.pay-btn {
  display: inline-block;
  background: linear-gradient(135deg, #1677ff, #4096ff);
  color: #fff;
  border: none;
  cursor: pointer;
  padding: 8px 28px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(22, 119, 255, 0.3);
}
.pay-btn:active {
  transform: scale(0.97);
}
.message.me .pay-card {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.message.me .pay-card p {
  color: #166534;
}

/* 消息中的链接 */
.msg-link {
  color: #1677ff;
  text-decoration: underline;
  word-break: break-all;
}

/* Tab 标签栏 */
.tab-bar {
  display: flex;
  background: #f5f5f5;
  padding: 4px;
  gap: 4px;
  position: sticky;
  top: 0;
  z-index: 2;
}
.tab-item {
  flex: 1;
  padding: 8px 4px;
  border: none;
  background: transparent;
  color: #595959;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.tab-item.tab-active {
  background: linear-gradient(135deg, #1677ff, #4096ff);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(22,119,255,0.3);
}
.tab-item:active {
  transform: scale(0.97);
}
.tab-count {
  display: inline-block;
  background: #e8e8e8;
  color: #595959;
  font-size: 11px;
  padding: 0 6px;
  border-radius: 10px;
  margin-left: 2px;
  min-width: 16px;
  text-align: center;
}
.tab-active .tab-count {
  background: #1677ff;
  color: #fff;
}

/* 访客卡片式列表 */
.visitor-cards {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.visitor-card {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.visitor-card:active {
  transform: scale(0.98);
  background: #f5f5f5;
}
.visitor-card.visitor-paid {
  border-left: 3px solid #52c41a;
  background: #f6ffed;
}
.visitor-card.visitor-unpaid {
  border-left: 3px solid #faad14;
  background: #fffbe6;
}
.visitor-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.visitor-card-info {
  flex: 1;
  min-width: 0;
}
.visitor-card-info .chat-title {
  display: block;
  margin-bottom: 2px;
}
.visitor-card-info .chat-preview {
  font-size: 12px;
  color: #8c8c8c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.visitor-card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}
.visitor-chat-btn {
  flex: 1;
  background: linear-gradient(135deg, #19be6b, #18a058);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(25,190,107,0.3);
  transition: all 0.15s;
}
.visitor-chat-btn:active {
  transform: scale(0.97);
}
.toggle-paid-btn {
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  transition: all 0.15s;
}
/* 付费状态按钮区分 */
.toggle-paid-btn.paid-btn {
  background: linear-gradient(135deg, #52c41a, #389e0d);
  color: #fff;
  border-color: #52c41a;
  box-shadow: 0 2px 8px rgba(82,196,26,0.35);
}
.toggle-paid-btn.unpaid-btn {
  background: linear-gradient(135deg, #faad14, #d48806);
  color: #fff;
  border-color: #faad14;
  box-shadow: 0 2px 8px rgba(250,173,20,0.35);
}
.toggle-paid-btn:active {
  transform: scale(0.96);
}
.toggle-paid-btn.loading {
  opacity: 0.7;
  pointer-events: none;
}
/* 付款状态标签 */
.id-pill.paid-pill {
  background: #52c41a;
  color: #fff;
}
.id-pill.unpaid-pill {
  background: #faad14;
  color: #fff;
}
/* 对话页付款标记按钮 */
.mini-action.paid-btn {
  background: #52c41a;
  color: #fff;
  border-color: #52c41a;
}
.mini-action.unpaid-btn {
  background: #faad14;
  color: #fff;
  border-color: #faad14;
}
/* 群发弹窗 */
.broadcast-scope {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  width: 100%;
  box-sizing: border-box;
}
.broadcast-scope label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f7f8f7;
  flex-shrink: 0;
}
.broadcast-scope label:active {
  background: #eef0ee;
}
.broadcast-scope label input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}
.broadcast-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  min-height: 80px;
  flex-shrink: 0;
}

/* 自动消息管理弹窗 */
.auto-msg-tip {
  font-size: 13px;
  color: #8c8c8c;
  margin-bottom: 12px;
}

/* 快捷回复 */
.quick-replies {
  display: flex;
  gap: 6px;
  padding: 6px 12px;
  overflow-x: auto;
  background: #f5f5f5;
  border-top: 1px solid #e8e8e8;
  scrollbar-width: thin;
}
.quick-replies::-webkit-scrollbar {
  height: 4px;
}
.quick-replies::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-radius: 2px;
}
.quick-reply-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 16px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.quick-reply-chip:hover {
  background: #e6f7ff;
  border-color: #1890ff;
  color: #1890ff;
}
.quick-reply-chip:active {
  background: #bae7ff;
}

/* 快捷回复编辑器 */
.qr-editor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
  max-height: 40vh;
  overflow-y: auto;
}
.qr-item {
  display: flex;
  gap: 6px;
  align-items: center;
}
.qr-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.qr-input:focus {
  outline: none;
  border-color: #19be6b;
}
.qr-del-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 1px solid #ff4d4f;
  background: #fff;
  color: #ff4d4f;
  border-radius: 6px;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.qr-del-btn:hover {
  background: #ff4d4f;
  color: #fff;
}
.auto-msg-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  max-height: 50vh;
  overflow-y: auto;
}
.auto-msg-item {
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 10px;
  background: #fafafa;
}
.auto-msg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.auto-msg-order {
  font-size: 12px;
  font-weight: 600;
  color: #1677ff;
  white-space: nowrap;
}
.auto-msg-type {
  padding: 4px 8px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
}
.auto-msg-ctrls {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.auto-msg-ctrls .mini-action {
  padding: 2px 8px;
  font-size: 12px;
}
.auto-msg-ctrls .mini-action.danger {
  color: #ff4d4f;
}
.auto-msg-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auto-msg-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  padding: 8px;
  font-size: 14px;
  font-family: inherit;
}
textarea.auto-msg-input {
  resize: vertical;
}
.auto-msg-img-preview {
  width: 100%;
  min-height: 80px;
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  overflow: hidden;
}
.auto-msg-img-preview img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
}
.auto-msg-img-placeholder {
  color: #bfbfbf;
  font-size: 13px;
}
.primary-btn.block {
  width: 100%;
  display: block;
}

/* 顶部横幅 Logo（作为 header 背景图） */
.header-banner {
  width: 100%;
  background: #f5f5f5;
  overflow: hidden;
}
.header-banner-img {
  width: 100%;
  height: 56px;
  object-fit: cover;
  display: block;
}
.app-header.has-banner {
  background-color: rgba(0, 0, 0, 0.45);
  background-blend-mode: darken;
}
.app-header.has-banner #headerTitle {
  color: #fff;
  font-size: 17px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8), 0 0 1px rgba(0, 0, 0, 0.9);
}
.app-header.has-banner .account-line {
  color: #fff;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.app-header.has-banner .account-line .temp-id-label {
  background: rgba(255, 255, 255, 0.85);
  color: #333;
}
.app-header.has-banner .account-line .id-number {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.app-header.has-banner .square-btn {
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.app-header.student-header {
  background: #07c160 !important;
  background-image: none !important;
  color: #fff;
  border-bottom-color: #06ad56;
}
.app-header.student-header #headerTitle,
.app-header.student-header .account-line,
.app-header.student-header .account-line .id-number {
  color: #fff;
  text-shadow: none;
}
.app-header.student-header .account-line .temp-id-label {
  background: rgba(255, 255, 255, .2);
  color: #fff;
}
.app-header.student-header .account-line .id-number {
  display: inline-block;
  margin-left: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #ffeb3b;
  color: #8a2100;
  font-weight: 800;
  text-shadow: none;
  box-shadow: 0 1px 4px rgba(60, 30, 0, .25);
}
.app-header.student-header .square-btn {
  color: #fff;
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .4);
}

.message.me .bubble {
  background: #95ec69;
}

.message-name {
  color: #7b837e;
  font-size: 12px;
  margin-bottom: 4px;
}

.composer {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  background: #f7f7f7;
  border-top: 1px solid #dadeda;
}

.composer input {
  height: 40px;
  min-width: 0;
}

.muted {
  color: #68716b;
}

.recording {
  background: #19be6b;
  color: #fff;
}

.bottom-nav {
  height: 58px;
  display: flex;
  border-top: 1px solid #dcdedc;
  background: #f8f8f8;
}

/* 键盘弹起时隐藏底部导航，输入框紧贴键盘上方（仿微信/QQ） */
body.kb-open .bottom-nav {
  display: none;
}

/* 键盘弹起时：整个应用容器固定到可视视口区域，输入框自然贴底 */
body.kb-open .phone-shell {
  position: fixed !important;
  top: var(--vvt, 0px) !important;
  left: 0 !important;
  right: 0 !important;
  height: var(--vvh, 100dvh) !important;
  min-height: 0 !important;
  max-height: var(--vvh, 100dvh) !important;
  overflow: hidden !important;
}


.bottom-nav button {
  position: relative;
  flex: 1;
  background: transparent;
  color: #717a74;
}

.bottom-nav button[data-unread]:not([data-unread=""])::after {
  content: attr(data-unread);
  position: absolute;
  top: 6px;
  right: calc(50% - 34px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #f04438;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.bottom-nav .nav-active {
  color: #19be6b;
  font-weight: 600;
}

@media (max-width: 380px) {
  .composer {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    gap: 6px;
  }

  .send-btn {
    padding: 0 10px;
  }
}

dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  box-sizing: border-box;
  margin: auto;
  /* iOS Safari 兼容 */
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

dialog::backdrop {
  background: rgba(0, 0, 0, .36);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 20;
  max-width: min(320px, calc(100vw - 32px));
  padding: 10px 14px;
  border-radius: 6px;
  background: rgba(30, 38, 33, .9);
  color: #fff;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity .18s ease, transform .18s ease;
}

.toast-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.modal-card {
  width: min(340px, calc(100vw - 32px));
  max-width: 100%;
  max-height: 80vh;
  background: #fff;
  border-radius: 12px;
  padding: 20px 16px;
  box-sizing: border-box;
  box-shadow: 0 18px 50px rgba(0,0,0,.25);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

/* 付款二维码弹窗：按视口留出完整操作区，二维码随手机屏幕高度缩放。 */
.payment-modal .modal-card {
  width: min(400px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 16px;
  overflow: hidden;
}

.payment-modal .modal-card h2 {
  margin: 0 0 8px;
  text-align: center;
}

.payment-modal .modal-card #modalText {
  min-height: 0;
  margin: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.payment-qr-content {
  text-align: center;
}

.payment-qr-image {
  display: block;
  width: min(100%, 320px);
  max-height: min(42dvh, 320px);
  aspect-ratio: 1;
  margin: 0 auto;
  border: 1px solid #eee;
  border-radius: 8px;
  object-fit: contain;
}

.payment-qr-instructions {
  margin: 8px 0 !important;
  color: #666 !important;
  font-size: 14px;
}

.payment-amount {
  margin: 8px 0;
  color: #5b5141;
  font-size: 16px;
}

.payment-amount strong {
  color: #d4380d;
  font-size: 24px;
  font-weight: 750;
  white-space: nowrap;
}

.payment-qr-note {
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: #fffbe6;
  font-size: 13px;
}

.payment-qr-note .ghost-btn {
  margin-left: 8px;
}

.payment-qr-footnote {
  margin: 8px 0 2px !important;
  color: #999 !important;
  font-size: 12px;
}

.payment-modal .modal-actions {
  margin-top: 10px;
}

.modal-card h2 {
  font-size: 18px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.modal-card p, .modal-card #modalText {
  color: #657069;
  line-height: 1.55;
  margin-bottom: 14px;
  word-break: break-word;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  flex-shrink: 0;
}

/* 课程列表 */
.course-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border-top: 1px solid #e0e2e0;
  background: #fff;
}

.course-section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px 9px;
  border-bottom: 1px solid currentColor;
  font-weight: 700;
  font-size: 14px;
}
.course-section-heading span { white-space: nowrap; }
.course-section-heading small { font-size: 11px; font-weight: 500; opacity: .82; }
.course-section-heading.general { color: #16864f; background: #f2faf4; }
.course-section-heading.premium { color: #a35b00; background: #fff8eb; }

.course-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-bottom: 1px solid #eceeed;
}
.course-card:has(.course-type-badge.general) { border-left: 3px solid #31a96d; }
.course-card:has(.course-type-badge.premium) { border-left: 3px solid #e2a23b; }
.course-actions button:disabled { opacity: .4; cursor: default; }

.course-thumb-img {
  width: 96px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
  background: #000;
}

.course-file-icon {
  width: 54px;
  height: 54px;
  margin: 21px auto 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}

.course-file-icon.file-pdf { background: #e74c3c; }
.course-file-icon.file-word { background: #2d65cc; }
.course-file-icon.file-ppt { background: #e67e22; }
.course-file-icon.file-xls { background: #19be6b; }
.course-file-icon.file-audio { background: #9b59b6; }
.course-file-icon.file-video { background: #34495e; }
.course-file-icon.file-other { background: #95a5a6; }

.course-info {
  min-width: 0;
}

.course-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}

.course-desc {
  color: #6c746f;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.course-contact {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 8px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f0faf4;
  color: #315d43;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.course-contact-label { font-weight: 700; color: #16864f; }
.course-contact a { color: #087d42; text-decoration: none; }
.course-contact-copy {
  border: 0;
  padding: 2px 7px;
  border-radius: 5px;
  background: #d9f3e3;
  color: #087d42;
  font-size: 11px;
}

.course-type-badge {
  display: inline-block;
  vertical-align: 1px;
  padding: 2px 6px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 600;
}
.course-type-badge.general { background: #e8f5eb; color: #16864f; }
.course-type-badge.premium { background: #fff1da; color: #a35b00; }
.course-lock-hint { color: #77827b; font-size: 11px; text-align: center; }
.admin-course-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px;
}
.admin-course-tab {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #dfe8e1;
  border-radius: 12px;
  background: #fff;
  color: #546158;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}
.admin-course-tab strong { font-size: 14px; font-weight: 700; }
.admin-course-tab small { color: #89948c; font-size: 11px; }
.admin-course-tab.active {
  border-color: #64aa7b;
  background: #f0f8f2;
  color: #21633a;
  box-shadow: 0 0 0 1px #64aa7b inset;
}
.admin-course-tab.orders.active { border-color: #d4a34a; background: #fff8e9; color: #805313; box-shadow: 0 0 0 1px #d4a34a inset; }
.admin-course-tab.orders.active small { color: #9b783e; }
.admin-course-tab:focus-visible { outline: 2px solid #57966c; outline-offset: 2px; }
.course-purchase-requests {
  margin: 0 12px 12px;
  padding: 12px;
  border: 1px solid #f0d9aa;
  border-radius: 10px;
  background: #fffaf1;
}
.course-orders-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.course-purchase-requests h3 { margin: 0; font-size: 14px; color: #805313; }
.course-purchase-requests h3 span {
  display: inline-block;
  place-items: center;
  margin-left: 5px;
  color: #97702f;
  font-size: 10px;
  font-weight: 500;
}
.course-orders-heading label { display: inline-flex; align-items: center; gap: 6px; color: #806849; font-size: 11px; }
.course-orders-heading select { min-height: 32px; padding: 4px 22px 4px 8px; border: 1px solid #ead8b5; border-radius: 7px; background: #fff; color: #5f5647; font: inherit; }
.course-purchase-request {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid #f1e6d0;
}
.course-purchase-request > div:first-child { min-width: 0; }
.course-order-info strong { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.course-purchase-request small { display: block; margin-top: 3px; overflow-wrap: anywhere; }
.course-purchase-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.course-order-status { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px; background: #f0eee9; color: #706b61; font-size: 10px; font-weight: 600; white-space: nowrap; }
.course-order-status.pending { background: #fff0c9; color: #966008; }
.course-order-status.approved { background: #e2f5e8; color: #16804a; }
.course-order-status.rejected, .course-order-status.cancelled { background: #fce8e7; color: #b33b36; }
.course-orders-empty { padding: 12px 0 2px; border-top: 1px solid #f1e6d0; color: #918777; font-size: 12px; text-align: center; }
.course-order-alert-dialog { width: min(390px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 18px 60px #16231735; }
.course-order-alert-dialog::backdrop { background: #14201766; backdrop-filter: blur(2px); }
.course-order-alert-card { padding: 24px 22px 18px; text-align: center; }
.course-order-alert-icon { width: 40px; height: 40px; display: grid; place-items: center; margin: 0 auto 10px; border-radius: 50%; background: #fff0c9; color: #a56506; font-size: 22px; font-weight: 800; }
.course-order-alert-card h2 { margin: 0 0 8px; color: #2a342d; font-size: 18px; }
.course-order-alert-card p { margin: 0 0 18px; color: #657067; font-size: 13px; line-height: 1.6; }
.course-order-alert-card .modal-actions { justify-content: center; }
@media (max-width: 520px) {
  .admin-course-tabs { gap: 8px; margin: 10px; }
  .admin-course-tab { padding: 11px 12px; }
  .course-purchase-request { align-items: flex-start; flex-direction: column; }
  .course-purchase-actions { width: 100%; justify-content: flex-start; }
}
.membership-price-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px;
  padding: 12px;
  border: 1px solid #d9e9df;
  border-radius: 10px;
  background: #f6fbf7;
}
.membership-price-panel label strong,
.membership-price-panel label small { display: block; }
.membership-price-panel label strong { color: #22653e; font-size: 13px; }
.membership-price-panel label small { margin-top: 3px; }
.membership-price-panel > div { display: flex; align-items: center; gap: 5px; }
.membership-price-panel input { width: 86px; height: 36px; padding: 0 6px; }
.membership-price-panel button { white-space: nowrap; }

.course-price-label {
  margin: 4px 0;
  color: #d4380d;
  font-size: 13px;
  font-weight: 650;
}

.course-meta {
  color: #8a938e;
}

.course-assigned {
  margin-top: 4px;
  color: #12844a;
}

.transcoding-tag {
  display: inline-block;
  font-size: 11px;
  color: #fff;
  background: #f39c12;
  padding: 2px 8px;
  border-radius: 10px;
  vertical-align: middle;
  font-weight: 500;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.course-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.course-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: end;
}

.course-actions button {
  min-height: 40px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 12px;
}

/* Mobile first course navigation and touch targets. */
.course-chapter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #edf0ed;
  background: #f8faf8;
  color: #425348;
}
.course-chapter-heading strong { font-size: 13px; }
.course-chapter-heading small { color: #8b978f; font-size: 10px; }
.course-lesson-number {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #edf3ee;
  color: #5d7163;
  font-size: 10px;
  font-weight: 700;
  vertical-align: 1px;
  white-space: nowrap;
}
.course-section-heading { scroll-margin-top: 8px; }
.course-section-jump {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid #e7ece8;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
}
.course-section-jump button {
  position: relative;
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.course-section-jump .course-jump-main { flex: 1 1 auto; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; padding-left: 13px; border-color: #dcebe0; background: #f2f8f3; color: #256c43; }
.course-section-jump .course-jump-main strong { font-size: 13px; }
.course-section-jump .course-jump-main small { color: #75877a; font-size: 10px; font-weight: 500; }
.course-section-jump .course-jump-secondary { flex: none; min-height: 38px; gap: 7px; padding: 6px 10px; border-color: #f0e4d0; background: #fffaf2; color: #8e671f; font-size: 11px; }
.course-section-jump .course-jump-secondary small { color: #a18c69; font-size: 9px; font-weight: 500; }
.course-section-jump .course-jump-secondary b { font-size: 13px; }
.course-section-heading.premium { display: inline-flex; width: max-content; max-width: calc(100% - 24px); margin: 10px 12px 4px; padding: 7px 12px; border: 1px solid #f0e2c9; border-radius: 999px; background: #fffaf1; }
.course-section-heading.premium small { font-size: 10px; }
.admin-course-card { grid-template-columns: 72px minmax(0, 1fr) 82px; gap: 11px; }
.admin-course-card .course-thumb-img { width: 72px; height: 56px; }
.admin-course-card .course-actions { display: flex; width: 82px; min-width: 0; flex-direction: column; gap: 6px; align-items: stretch; }
.admin-course-card .course-actions button { width: 100%; min-height: 38px; padding: 0 5px; border: 1px solid #e1e8e2; border-radius: 9px; background: #fff; color: #43584a; font-size: 11px; font-weight: 650; white-space: nowrap; }
.admin-course-card .course-actions .course-action-preview,
.admin-course-card .course-actions .course-action-edit { border-color: #d7e8dc; background: #f1f8f3; color: #247248; }
.admin-course-card .course-actions .course-action-more { background: #f7f8f7; color: #68746c; }
.admin-course-card .course-actions .course-action-more span { margin-left: 3px; letter-spacing: 1px; }
.admin-course-card .course-actions button:disabled { opacity: .4; }
.client-course-card .course-actions { align-items: flex-end; min-width: 76px; }
.client-course-card .course-actions button { min-width: 72px; min-height: 40px; border-radius: 10px; }

/* Keep modal titles/actions reachable on small phone screens. */
.modal-card {
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100dvh - 28px);
  max-height: min(86dvh, calc(100dvh - 28px));
}
.modal-card #modalText {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-card .modal-actions { position: sticky; bottom: -20px; padding: 10px 0 2px; background: #fff; }

.teacher-status { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.teacher-status i { width: 6px; height: 6px; border-radius: 50%; background: #8c9690; }
.teacher-status.is-online { background: #eaf7ee; color: #257448; }
.teacher-status.is-online i { background: #30a961; box-shadow: 0 0 0 3px rgba(48, 169, 97, .12); animation: teacherPulse 1.5s ease-in-out infinite; }
.teacher-status.is-away { background: #f1f3f1; color: #68746c; }
.teacher-reply-note { color: #8b958e; font-size: 9px; white-space: nowrap; }
.presence-label { white-space: nowrap; }
.presence-label i, .chat-peer-status.peer-online i, .chat-peer-status.peer-away i { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: currentColor; vertical-align: 1px; }
.presence-label.online, .chat-peer-status.peer-online { color: #25814a; }
.presence-label.away, .chat-peer-status.peer-away { color: #89938c; }
@keyframes teacherPulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 2px rgba(48, 169, 97, .12); } 50% { opacity: .42; box-shadow: 0 0 0 5px rgba(48, 169, 97, .06); } }
.course-action-sheet { display: grid; gap: 10px; }
.course-action-sheet-title { margin: 0 0 2px !important; padding: 10px 12px; border-radius: 10px; background: #f5f8f5; color: #34463a !important; font-weight: 700; }
.course-action-order { padding: 11px 12px; border: 1px solid #e8ece8; border-radius: 11px; background: #fff; }
.course-action-order > span { display: block; margin-bottom: 8px; color: #718077; font-size: 11px; font-weight: 650; }
.course-action-order > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.course-sheet-btn { display: flex; width: 100%; min-height: 46px; align-items: center; justify-content: center; padding: 8px 12px; border: 1px solid #e1e8e2; border-radius: 10px; background: #f8faf8; color: #405448; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.course-sheet-btn:disabled { opacity: .42; cursor: default; }
.course-sheet-visibility { border-color: #d6e8dc; background: #f0f8f2; color: #247248; }
.course-sheet-delete { margin-top: 4px; border-color: #f0d8d6; background: #fff8f7; color: #b64942; }

@media (max-width: 520px) {
  .admin-course-card { grid-template-columns: 54px minmax(0, 1fr) 76px; gap: 8px; padding: 11px 9px; }
  .admin-course-card .course-thumb-img { width: 54px; height: 52px; }
  .admin-course-card .course-actions { width: 76px; gap: 5px; }
  .admin-course-card .course-actions button { min-height: 36px; padding: 0 3px; font-size: 10px; }
  .client-course-card { grid-template-columns: 62px minmax(0, 1fr) auto; gap: 9px; padding: 11px; }
  .client-course-card .course-thumb-img { width: 62px; height: 52px; }
  .client-course-card .course-actions { min-width: 0; }
  .client-course-card .course-actions button { min-width: 66px; min-height: 38px; padding: 0 8px; font-size: 11px; }
  .course-section-heading { scroll-margin-top: 72px; }
  .course-section-jump { top: 0; gap: 7px; padding: 8px 10px; }
  .course-section-jump .course-jump-main { min-height: 44px; }
  .course-section-jump .course-jump-secondary { min-height: 36px; }
  .modal-card { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); padding: 16px 14px; }
}

.purchase-banner {
  padding: 16px;
  background: #fff8e6;
  border-bottom: 1px solid #f0e6c8;
  color: #8a6d1a;
  font-size: 14px;
  line-height: 1.5;
}

.purchase-banner a {
  color: #d97706;
  font-weight: 700;
  text-decoration: underline;
}

.qr-preview-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #f0f9ff;
  border-bottom: 1px solid #d6eaf8;
}

.qr-preview-info {
  flex: 1;
}

.qr-preview-info strong {
  display: block;
  color: #0369a1;
  font-size: 14px;
}

.qr-preview-info small {
  color: #64748b;
  font-size: 12px;
}

.qr-preview-img {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  border: 1px solid #d6eaf8;
  object-fit: cover;
}

.assign-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f1f0;
  cursor: pointer;
  font-size: 14px;
}

.assign-row:last-child {
  border-bottom: 0;
}

.assign-row input {
  width: auto;
  height: auto;
  margin: 0;
}

.assign-row small {
  margin-left: auto;
  color: #8a938e;
}

/* 课件可见性设置 */
.visibility-options {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eef0ee;
}

.form-group {
  margin-bottom: 14px;
}

.form-group .field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #5f6b64;
  font-weight: 600;
}

.form-group .text-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d8dcda;
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
  box-sizing: border-box;
}

.form-group .text-input:focus {
  outline: none;
  border-color: #19be6b;
  box-shadow: 0 0 0 2px rgba(25, 190, 107, 0.15);
}

.form-group textarea.text-input {
  resize: vertical;
  min-height: 70px;
  font-family: inherit;
}

.visibility-options .assign-row {
  font-weight: 500;
}

.visibility-users {
  max-height: 240px;
  overflow-y: auto;
  padding-right: 2px;
}

.visibility-empty {
  margin: 10px 0 0;
  padding: 12px;
  background: #f6f8f6;
  border-radius: 8px;
  color: #8a938e;
  font-size: 13px;
  text-align: center;
}

.course-viewer {
  margin-top: 12px;
}

.course-video-details {
  margin: 14px 0 4px;
  padding: 13px 14px;
  border: 1px solid #dcebe0;
  border-radius: 12px;
  background: #f5faf6;
  color: #3b5142;
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.course-video-details h3 { margin: 0 0 6px; color: #247b49; font-size: 14px; }
.course-video-details a { color: #167347; text-decoration: underline; }

/* The PDF reader title stays reachable while the document scrolls. */
.pdf-reader-modal .modal-card h2 {
  position: sticky;
  top: -20px;
  z-index: 5;
  margin: -20px -16px 12px;
  padding: 18px 56px 12px 16px;
  border-radius: 12px 12px 0 0;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 1px 0 rgba(30, 50, 38, .1);
}
.pdf-reader-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #eef3ef;
  color: #33483a;
  font: inherit;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}
.pdf-reader-close:active { background: #dce9df; }

/* 上传进度条 */
.upload-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.upload-dialog {
  background: #fff;
  border-radius: 12px;
  padding: 24px 28px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.upload-dialog h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: #19be6b;
}
.upload-filename {
  margin: 0 0 16px;
  font-size: 14px;
  color: #666;
  word-break: break-all;
}
.upload-progress-bar {
  width: 100%;
  height: 10px;
  background: #e8e8e8;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 8px;
}
.upload-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #19be6b, #2d8cf0);
  border-radius: 5px;
  transition: width 0.2s;
}
.upload-percent {
  font-size: 20px;
  font-weight: 600;
  color: #19be6b;
  margin: 4px 0;
}
.upload-status {
  font-size: 13px;
  color: #999;
  margin: 4px 0 0;
}

.course-media {
  display: block;
  max-width: 100%;
  max-height: 50vh;
  border-radius: 8px;
}

.course-download-box {
  text-align: center;
  padding: 20px;
  background: #f5f5f5;
  border-radius: 8px;
}
.course-download-box p {
  margin: 0 0 12px;
  color: #666;
  font-size: 14px;
}

.course-docx-loading {
  text-align: center;
  color: #999;
  padding: 20px;
  font-size: 14px;
}

.course-docx-content {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 16px 20px;
  max-height: 60vh;
  overflow-y: auto;
  font-size: 15px;
  line-height: 1.7;
  color: #333;
}

.course-docx-content img {
  max-width: 100%;
  height: auto;
}

.course-docx-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 8px 0;
}

.course-docx-content td,
.course-docx-content th {
  border: 1px solid #ccc;
  padding: 6px 10px;
}

.course-docx-content p {
  margin: 8px 0;
}

.course-pdf-loading {
  text-align: center;
  color: #999;
  padding: 20px;
  font-size: 14px;
}

.course-pdf-container {
  max-height: 60vh;
  overflow-y: auto;
  background: #666;
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}

.pdf-page-shell {
  min-height: 420px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ddd;
  background: #f5f5f5;
}

.pdf-page-canvas {
  display: block;
  max-width: 100%;
  margin: 0 auto 8px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Mobile course viewers stay inside the visible viewport; form controls avoid iOS focus zoom. */
#modal.course-view-modal { width: calc(100vw - 16px); max-width: 560px; max-height: calc(100dvh - 16px); overflow: hidden; }
#modal.course-view-modal .modal-card { width: 100%; max-width: 100%; height: min(90dvh, 900px); max-height: calc(100dvh - 16px); min-height: 0; padding: 14px; overflow: hidden; }
#modal.course-view-modal .modal-card h2 { position: relative; flex: 0 0 auto; max-width: 100%; padding-right: 42px; overflow-wrap: anywhere; }
#modal.course-view-modal .modal-card #modalText { flex: 1 1 auto; min-width: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
#modal.course-view-modal .course-viewer, #modal.course-view-modal .course-media, #modal.course-view-modal .course-pdf-container, #modal.course-view-modal .course-docx-content { box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; }
#modal.course-view-modal .course-media { max-height: 58dvh; object-fit: contain; }
#modal.course-view-modal .course-pdf-container, #modal.course-view-modal .course-docx-content { max-height: 54dvh; overflow: auto; overscroll-behavior: contain; }
#modal.course-view-modal .course-pdf-container { padding: 6px; }
#modal.course-view-modal .pdf-page-shell { min-height: 0; width: 100%; }
#modal.course-view-modal .pdf-page-canvas { height: auto; }
#modal.course-view-modal .course-docx-content table { display: block; max-width: 100%; overflow-x: auto; }
#modal.course-view-modal .modal-actions { position: static; flex: 0 0 auto; margin-top: 8px; }
.modal-card input:not([type="checkbox"]):not([type="radio"]), .modal-card textarea, .modal-card select { box-sizing: border-box; max-width: 100%; }
@media (max-width: 520px) {
  .modal-card input:not([type="checkbox"]):not([type="radio"]), .modal-card textarea, .modal-card select { font-size: 16px !important; }
  #modal.course-view-modal .modal-card { height: calc(100dvh - 16px); padding: 12px; }
  #modal.course-view-modal .course-media { max-height: 48dvh; }
  #modal.course-view-modal .course-pdf-container, #modal.course-view-modal .course-docx-content { max-height: 48dvh; }
}

.visitor-row {
  cursor: pointer;
}

/* 手机优先的简洁访客首页 */
#welcomeVisitor { background: #fff; }
.visitor-welcome-header {
  flex: none;
  height: 56px;
  padding: env(safe-area-inset-top) 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f0f2f5;
  color: #263445;
  font-size: 13px;
  font-weight: 650;
}
.visitor-welcome-helper { color: #68788a; font-size: 10px; font-weight: 450; }
.visitor-welcome-helper::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 6px 1px 0;
  border-radius: 50%;
  background: #33b57b;
}
.visitor-welcome-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  flex: none;
  padding: 54px 23px 36px;
}
.visitor-market-art {
  position: absolute;
  z-index: -1;
  top: 7px;
  right: -2px;
  width: 178px;
  height: 132px;
  opacity: .12;
  pointer-events: none;
}
.visitor-welcome-slogan {
  max-width: 340px;
  color: #263445;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -.035em;
}
.visitor-welcome-slogan span { color: #347ff0; }
.visitor-welcome-subline { margin-top: 8px; color: #788696; font-size: 12px; }
#welcomeVisitor .welcome-panel {
  flex: 1;
  justify-content: flex-start;
  padding: 14px 23px calc(22px + env(safe-area-inset-bottom));
}
#registerMode h1,
#loginMode h1 { margin: 0 0 17px; font-size: 18px; font-weight: 650; }
#welcomeVisitor #loginMode input { margin-bottom: 12px; }
.visitor-start-btn { width: 100%; height: 48px; border-radius: 9px; font-size: 13px; font-weight: 700; }
.visitor-login-switch { margin-top: 11px; }
.visitor-login-switch .ghost-btn {
  width: 100%;
  min-height: 46px;
  border: 1px solid #b8d1f4;
  border-radius: 9px;
  background: #f5f9ff;
  color: #286fca;
  font-size: 12px;
  font-weight: 650;
}
@media (min-width: 521px) {
  #welcomeVisitor { align-items: center; }
  .visitor-welcome-header,
  .visitor-welcome-hero,
  #welcomeVisitor .welcome-panel { width: min(100%, 430px); }
  #welcomeVisitor .welcome-panel { max-width: 430px; }
}
@media (max-width: 520px) {
  .visitor-welcome-header {
    height: calc(54px + env(safe-area-inset-top));
    padding-left: 20px;
    padding-right: 20px;
  }
  .visitor-welcome-hero { padding: 52px 22px 30px; }
  .visitor-welcome-slogan { font-size: 22px; }
  #welcomeVisitor .welcome-panel { padding: 12px 22px calc(20px + env(safe-area-inset-bottom)); }
}
@media (max-height: 650px) and (max-width: 520px) {
  .visitor-welcome-hero { padding-top: 34px; padding-bottom: 24px; }
  #welcomeVisitor .welcome-panel { padding-top: 8px; }
}

#forgotPasswordMode h1 { margin: 0 0 10px; font-size: 19px; }
#forgotPasswordMode .forgot-password-help,
#forgotPasswordMode .forgot-password-footnote { margin: 0 0 12px; color: #788696; font-size: 11px; line-height: 1.6; }
#forgotPasswordMode input,
#forgotPasswordMode textarea { margin-bottom: 11px; }
#forgotPasswordMode textarea { width: 100%; min-height: 74px; resize: vertical; padding: 10px 12px; border: 1px solid #d3d8d5; border-radius: 8px; color: #263445; font: inherit; font-size: 12px; }
#forgotPasswordMode .forgot-password-footnote { margin: 9px 0 0; font-size: 10px; }
#forgotPasswordMode .forgot-password-link { margin-top: 10px; }
.reset-proof-picker { display: block; margin: 0 0 10px; padding: 12px; border: 1px dashed #9eb7a9; border-radius: 8px; background: #f5faf7; color: #18794e; text-align: center; font-size: 12px; font-weight: 600; cursor: pointer; }
.reset-proof-preview-wrap { display: flex; align-items: center; gap: 9px; margin: 0 0 11px; color: #66756c; font-size: 11px; overflow-wrap: anywhere; }
.reset-proof-preview-wrap[hidden] { display: none; }
.reset-proof-preview-wrap img { width: 54px; height: 54px; border-radius: 6px; object-fit: cover; }
.forgot-password-link {
  display: block;
  margin: 10px auto 0;
  padding: 5px 8px;
  border: 0;
  background: transparent;
  color: #347ff0;
  font-size: 12px;
  cursor: pointer;
}
.password-reset-requests { padding: 12px; background: #fff9ed; border-bottom: 1px solid #f0dfbe; }
.password-reset-heading { margin-bottom: 8px; color: #805313; font-size: 13px; font-weight: 700; }
.password-reset-heading span { display: inline-grid; min-width: 19px; height: 19px; margin-left: 4px; place-items: center; border-radius: 10px; background: #f4dfb8; font-size: 11px; }
.password-reset-request { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid #f0e4cc; }
.password-reset-request-info { min-width: 0; }
.password-reset-request-info strong { font-size: 12px; }
.password-reset-request-info small { display: block; margin-top: 3px; color: #857b68; font-size: 10px; }
.password-reset-request-info p { margin: 5px 0 0; color: #655c4d; font-size: 11px; overflow-wrap: anywhere; }
.password-reset-actions { display: flex; flex: none; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.password-reset-proof-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 7px; color: #2675c9; font-size: 11px; }
.password-reset-proof { display: block; width: 76px; height: 76px; border: 1px solid #eadfc8; border-radius: 6px; background: #fff; object-fit: cover; }
.password-reset-proof-missing { display: block; margin-top: 7px; color: #9a6c25 !important; }
@media (max-width: 520px) {
  .password-reset-request { align-items: flex-start; flex-direction: column; }
  .password-reset-actions { width: 100%; justify-content: flex-start; }
}

/* Refreshed account center: compact profile card and clearly grouped settings. */
#meView {
  background: #f5f7f5;
  scrollbar-width: thin;
  scrollbar-color: #d4ddd6 transparent;
}
.me-content {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 14px calc(28px + env(safe-area-inset-bottom));
}
.profile-card {
  position: relative;
  display: flex;
  gap: 15px;
  min-height: 124px;
  align-items: center;
  overflow: hidden;
  padding: 20px 18px;
  border: 1px solid #e4ece6;
  border-radius: 18px;
  background: linear-gradient(120deg, #fff 8%, #f1f8f3 100%);
  box-shadow: 0 5px 16px rgba(31, 70, 46, .055);
}
.profile-card::after {
  position: absolute;
  right: -31px;
  bottom: -62px;
  width: 160px;
  height: 160px;
  border: 1px solid rgba(34, 132, 78, .09);
  border-radius: 50%;
  box-shadow: 0 0 0 16px rgba(34, 132, 78, .035), 0 0 0 33px rgba(34, 132, 78, .025);
  content: "";
  pointer-events: none;
}
.profile-card.profile-card-admin {
  background: linear-gradient(120deg, #fff 8%, #f0f5f4 100%);
}
.profile-card.profile-card-student {
  border-color: #d9efe0;
  background: linear-gradient(120deg, #fff 8%, #effaf2 100%);
}
.profile-card .avatar.large {
  z-index: 1;
  flex: 0 0 62px;
  width: 62px;
  height: 62px;
  border: 3px solid rgba(255, 255, 255, .88);
  border-radius: 50%;
  background: linear-gradient(145deg, #38c77d, #15975b);
  box-shadow: 0 4px 12px rgba(26, 151, 91, .19);
  font-size: 25px;
}
.profile-card-admin .avatar.large {
  background: linear-gradient(145deg, #66877b, #3f6658);
  box-shadow: 0 4px 12px rgba(48, 87, 70, .18);
}
.profile-summary { z-index: 1; min-width: 0; }
.profile-kicker {
  margin-bottom: 3px;
  color: #789083;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
}
.profile-name {
  overflow: hidden;
  margin: 0 0 5px;
  color: #1f3027;
  font-size: 19px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-id { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.profile-id .temp-id-label {
  margin: 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e9f4ed;
  color: #34714e;
  font-size: 10px;
}
.profile-id .large-id-number {
  margin: 0;
  padding: 3px 8px;
  border: 1px solid #e4e9e5;
  border-radius: 7px;
  background: rgba(255, 255, 255, .88);
  color: #b94c32;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 16px;
  letter-spacing: .03em;
}
.profile-card-student .profile-id .large-id-number {
  border-color: #f4df74;
  background: #fff4bd;
  color: #825616;
}
.id-reminder-tip {
  margin-top: 6px;
  padding: 0;
  background: transparent;
  color: #7b8c81;
  font-size: 10px;
  font-weight: 500;
}
.id-reminder-tip span { color: #31a76c; }
.me-section { margin-top: 20px; }
.me-section-title {
  margin: 0 0 9px 3px;
  color: #7b8880;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
}
.settings-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.settings-item {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto 12px;
  min-height: 66px;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border: 1px solid #edf0ed;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(25, 42, 30, .025);
  transition: background .15s ease, transform .15s ease, border-color .15s ease;
}
.settings-item:active {
  transform: scale(.99);
  border-color: #d8e8dc;
  background: #f9fcfa;
}
.setting-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: #edf7f0;
  color: #238a51;
  font-size: 17px;
  font-weight: 700;
}
.settings-item:nth-child(2) .setting-icon { background: #f0f3fb; color: #6579b3; }
.settings-item:nth-child(3) .setting-icon { background: #fbf3e8; color: #bc8240; }
.setting-copy { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.setting-copy strong {
  overflow: hidden;
  color: #26342b;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.setting-copy small {
  overflow: hidden;
  color: #99a29c;
  font-size: 10px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.setting-meta {
  max-width: 100px;
  overflow: hidden;
  padding: 4px 7px;
  border-radius: 999px;
  background: #f2f6f3;
  color: #668071 !important;
  font-size: 10px !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.setting-chevron { color: #b3bdb6; font-size: 23px; font-weight: 300; line-height: 1; }
.danger-item .setting-icon { background: #fff0ed; color: #cb5d4e; }
.danger-item .setting-copy strong { color: #bd5145; }
.logout-list { margin-top: 20px; }
.me-footer {
  padding: 18px 0 3px;
  color: #a7b0aa;
  font-size: 10px;
  text-align: center;
  letter-spacing: .04em;
}
.desktop-mode .me-content { max-width: 560px; }
@media (max-width: 360px) {
  .me-content { padding-right: 10px; padding-left: 10px; }
  .profile-card { gap: 11px; padding: 17px 14px; }
  .settings-item { grid-template-columns: 34px minmax(0, 1fr) auto 10px; gap: 8px; padding-right: 9px; padding-left: 9px; }
  .setting-icon { width: 33px; height: 33px; }
}

/* Conversation and visitor views share the same calm green visual language. */
#chatListView,
#visitorsView { background: #f5f7f5; }
#chatList,
#visitorList {
  border: 0;
  background: transparent;
  scrollbar-width: thin;
  scrollbar-color: #d4ddd6 transparent;
}
#chatList .tab-bar,
#visitorList .tab-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 7px;
  margin: 0;
  padding: 11px 13px;
  border: 0;
  background: rgba(245, 247, 245, .96);
  backdrop-filter: blur(10px);
}
#chatList .tab-item,
#visitorList .tab-item {
  flex: 0 1 auto;
  min-width: 84px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #e5ebe6;
  border-radius: 999px;
  background: #fff;
  color: #66736a;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(22, 49, 31, .035);
}
#chatList .tab-item.tab-active,
#visitorList .tab-item.tab-active {
  border-color: #218850;
  background: #218850;
  color: #fff;
  box-shadow: 0 3px 9px rgba(33, 136, 80, .18);
}
#chatList .tab-count,
#visitorList .tab-count {
  min-width: 19px;
  margin-left: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eff3ef;
  color: #758078;
  font-size: 10px;
}
#chatList .tab-active .tab-count,
#visitorList .tab-active .tab-count { background: rgba(255,255,255,.2); color: #fff; }
#chatList .chat-item {
  min-height: 76px;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 11px;
  margin: 0 12px 8px;
  padding: 11px 12px;
  width: calc(100% - 24px);
  border: 1px solid #edf0ed;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(22, 49, 31, .035);
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
#chatList .chat-item:active { transform: scale(.99); border-color: #d7e7dc; background: #fbfdfb; }
#chatList .chat-item > .avatar {
  width: 46px;
  height: 46px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--message-avatar-color, linear-gradient(145deg, #50c47e, #23895a));
  box-shadow: 0 2px 7px rgba(31, 119, 69, .17);
}
#chatList .chat-title { display: block; overflow: hidden; margin-bottom: 6px; color: #25342b; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
#chatList .chat-title em { border-radius: 999px; background: #f0f4f1; color: #7b8980; }
#chatList .chat-title .id-pill { margin-left: 4px; border-radius: 999px; }
#chatList .chat-preview { display: block; max-width: 100%; overflow: hidden; color: #8a958e; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
#chatList .chat-meta { min-width: 39px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
#chatList .chat-meta small { color: #a0aaa3; font-size: 10px; }
#chatList .unread-badge { min-width: 18px; height: 18px; background: #ec755e; font-size: 10px; }
.visitors-section-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 14px 15px 8px;
  border: 0;
  background: transparent;
  color: #34483a;
  font-size: 15px;
  font-weight: 700;
}
.visitors-section-title small { color: #97a199; font-size: 10px; font-weight: 400; }
#visitorList .tab-bar { padding-top: 7px; }
.visitor-cards { display: grid; gap: 9px; padding: 2px 12px 14px; }
.visitor-card {
  position: relative;
  overflow: hidden;
  padding: 12px 13px 11px;
  border: 1px solid #e9eeea;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(22, 49, 31, .04);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.visitor-card::before { position: absolute; inset: 0 auto 0 0; width: 3px; background: #aeb8b1; content: ""; }
.visitor-card.visitor-paid::before { background: #32ad68; }
.visitor-card.visitor-unpaid { border-color: #e3e7e4; background: #fbfcfb; }
.visitor-card:active { transform: scale(.99); border-color: #d2e5d8; box-shadow: 0 2px 7px rgba(22, 49, 31, .05); }
.visitor-card-header { gap: 10px; margin: 0; }
.visitor-avatar {
  flex: 0 0 43px;
  width: 43px;
  height: 43px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--message-avatar-color, #89948d);
  box-shadow: 0 2px 6px rgba(75, 89, 79, .14);
}
.visitor-paid .visitor-avatar { outline: 2px solid #42b66b; outline-offset: 1px; }
.visitor-card-info { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.visitor-card-name { display: flex; min-width: 0; align-items: center; gap: 6px; overflow: hidden; color: #26352c; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.visitor-role-chip { flex: none; padding: 2px 7px; border-radius: 999px; background: #edf0ee; color: #69756d; font-size: 9px; font-weight: 700; }
.visitor-paid .visitor-role-chip { background: #e8f7ed; color: #21854c; }
.visitor-id { color: #97a199; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; }
.visitor-last-time { align-self: flex-start; margin-left: auto; color: #a0aaa3; font-size: 10px; white-space: nowrap; }
.visitor-latest { display: flex; align-items: center; gap: 7px; min-height: 30px; margin: 9px 0 9px 53px; padding: 6px 9px; border-radius: 8px; background: #f6f8f6; color: #77837a; font-size: 10px; }
.visitor-latest > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visitor-latest-dot { flex: none; width: 5px; height: 5px; border-radius: 50%; background: #86a18f; }
.visitor-card-actions { gap: 8px; margin: 0 0 0 53px; }
.visitor-chat-btn { min-height: 34px; padding: 0 12px; border-radius: 9px; background: #238c52; box-shadow: none; font-size: 11px; font-weight: 650; }
.visitor-chat-btn span { margin-right: 3px; font-size: 14px; }
.toggle-paid-btn { min-height: 34px; padding: 0 11px; border: 1px solid #e5eae6; border-radius: 9px; background: #f8faf8; color: #758078; font-size: 10px; box-shadow: none; }
.toggle-paid-btn.paid-btn { border-color: #d7ebdd; background: #eff8f1; color: #25874f; box-shadow: none; }
.toggle-paid-btn.unpaid-btn { border-color: #e2e7e3; background: #f5f7f5; color: #647168; box-shadow: none; }
#chatView { background: #f2f6f3; }
.chat-top {
  flex: none;
  min-height: 60px;
  height: auto;
  grid-template-columns: 36px 38px minmax(0, 1fr) auto auto;
  gap: 9px;
  padding: 8px 11px;
  border-bottom: 1px solid #e7ece8;
  background: rgba(255, 255, 255, .97);
}
.chat-top > .square-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 11px;
  background: #f1f5f2;
  color: #3b5e49;
  font-size: 23px;
  line-height: 1;
}
.chat-peer-avatar { width: 38px; height: 38px; border: 2px solid #fff; box-shadow: 0 2px 7px rgba(31, 49, 38, .16); }
.chat-peer-info { gap: 4px; }
.chat-peer-info strong { color: #26352c; font-size: 13px; }
.chat-peer-info small { color: #8c9890; font-size: 10px; }
.chat-top .id-pill { min-height: 20px; padding: 2px 8px; border-radius: 999px; font-size: 9px; }
.chat-top #chatPayBtn { min-height: 30px; padding: 0 9px; border: 0; border-radius: 9px; box-shadow: none; font-size: 10px; }
.chat-top .invite-btn { min-width: 46px; height: 32px; border-radius: 10px; background: #eff7f1; font-size: 11px; }
.messages {
  padding: 15px 12px 17px;
  background-color: #f2f6f3;
  background-image: radial-gradient(rgba(67, 111, 82, .055) .7px, transparent .7px);
  background-size: 18px 18px;
}
.message { gap: 7px; margin-bottom: 14px; }
.message-avatar { flex-basis: 31px; width: 31px; height: 31px; border-width: 1px; box-shadow: 0 2px 5px rgba(34, 49, 41, .12); font-size: 12px; }
.bubble {
  max-width: min(78%, calc(100% - 39px));
  padding: 9px 11px 7px;
  border: 1px solid rgba(31, 53, 39, .045);
  border-radius: 5px 14px 14px 14px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(31, 49, 38, .045);
  line-height: 1.5;
}
.message.me .bubble { border-color: #d5ecd9; border-radius: 14px 5px 14px 14px; background: #def3e2; }
.message-name { margin-bottom: 5px; color: #7f8e84; font-size: 10px; }
.message-time { margin-top: 5px; color: #9aa49d; font-size: 9px; }
.composer {
  min-height: 62px;
  gap: 7px;
  padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
  border-top: 1px solid #e6ebe7;
  background: rgba(255, 255, 255, .98);
}
.composer input {
  height: 42px;
  padding: 0 14px;
  border: 1px solid #e5eae6;
  border-radius: 22px;
  background: #f5f7f5;
  /* iOS Safari zooms the whole page when a focused input uses text below 16px. */
  font-size: 16px;
}
.composer input:focus { border-color: #82c49a; box-shadow: 0 0 0 3px rgba(54, 157, 88, .09); }
.composer .square-btn.muted { width: 37px; height: 37px; border: 0; border-radius: 50%; background: #edf5ef; color: #42805a; font-size: 12px; }
.composer .send-btn { min-width: 54px; height: 38px; border: 0; border-radius: 20px; background: #238c52; box-shadow: 0 2px 7px rgba(35, 140, 82, .18); font-size: 12px; }
.quick-replies { padding: 7px 10px; border-top: 1px solid #edf0ed; background: #fff; }
.quick-reply-chip { border-color: #e2ebe4; border-radius: 999px; background: #f7faf7; color: #587260; }
.jump-latest-btn { bottom: 74px; border-color: #d8e9dd; background: rgba(255,255,255,.97); }
.visitorsView .empty-state,
#chatList .empty-state { margin: 14px 12px; border-radius: 14px; background: #fff; }
@media (max-width: 380px) {
  #chatList .chat-item { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 8px; margin-right: 9px; margin-left: 9px; width: calc(100% - 18px); }
  #chatList .chat-item > .avatar { width: 42px; height: 42px; }
  .visitor-cards { padding-right: 9px; padding-left: 9px; }
  .visitor-latest, .visitor-card-actions { margin-left: 50px; }
  .chat-top { grid-template-columns: 34px 34px minmax(0, 1fr) auto auto; gap: 6px; padding-right: 8px; padding-left: 8px; }
  .chat-peer-avatar { width: 34px; height: 34px; }
  .chat-top #chatPayBtn { margin-left: 0 !important; padding: 0 6px; font-size: 9px; }
}
#chatList .tab-unread-count {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  background: #e95f51;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}
#chatList .tab-active .tab-unread-count { background: #fff; color: #d84b40; }
#chatList .chat-item-unread { border-color: #e9d9d4; background: #fffdfc; }
#chatList .chat-item-unread .chat-title { color: #1f2f25; font-weight: 750; }
.chat-peer-info small { min-width: 0; }
.chat-peer-record { display: flex; min-width: 0; align-items: center; gap: 7px; overflow: hidden; }
.chat-peer-info #groupMeta { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 5px; }
.chat-peer-record { flex: 1 1 auto; }
.chat-peer-record span:first-child {
  flex: none;
  padding: 2px 6px;
  border-radius: 5px;
  background: #f0f5f1;
  color: #587162;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9px;
}
.chat-peer-record span:last-child { overflow: hidden; color: #8a968e; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.chat-peer-status { flex: none; padding: 3px 7px; border-radius: 999px; font-size: 9px; font-weight: 700; }
.chat-peer-status.student { background: #e8f7ed; color: #21854c; }
.chat-peer-status.visitor { background: #fff4e5; color: #a06f2b; }

/* Course viewer dialogs keep a visible margin and a reachable, unclipped title bar. */
#modal.course-view-modal {
  width: min(560px, calc(100vw - 36px));
  max-width: none;
  max-height: 82dvh;
  margin: auto;
  overflow: hidden;
}
#modal.course-view-modal .modal-card {
  width: 100%;
  height: auto;
  max-height: 82dvh;
  min-height: 0;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(34, 63, 43, .08);
  border-radius: 18px;
  box-shadow: 0 20px 64px rgba(18, 37, 25, .28);
}
#modal.course-view-modal .modal-card h2 {
  position: relative;
  top: auto;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 38px;
  margin: 0 0 8px;
  padding: 2px 48px 8px 0;
  overflow-wrap: anywhere;
  border-radius: 0;
  background: transparent;
  box-shadow: 0 1px 0 rgba(30, 50, 38, .1);
  line-height: 1.35;
}
#modal.course-view-modal.pdf-reader-modal .modal-card h2 { padding-right: 48px; }
#modal.course-view-modal .pdf-reader-close { top: 0; right: 0; z-index: 2; }
#modal.course-view-modal .modal-card #modalText {
  flex: 1 1 auto;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
#modal.course-view-modal .course-viewer,
#modal.course-view-modal .course-media,
#modal.course-view-modal .course-pdf-container,
#modal.course-view-modal .course-docx-content {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
#modal.course-view-modal .course-media { max-height: 42dvh; object-fit: contain; }
#modal.course-view-modal .course-pdf-container,
#modal.course-view-modal .course-docx-content {
  max-height: 48dvh;
  overflow: auto;
  overscroll-behavior: contain;
}
#modal.course-view-modal .course-pdf-container { padding: 6px; }
#modal.course-view-modal .pdf-page-shell { width: 100%; min-height: 0; }
#modal.course-view-modal .pdf-page-canvas { height: auto; }
#modal.course-view-modal .course-docx-content table { display: block; max-width: 100%; overflow-x: auto; }
#modal.course-view-modal .modal-actions { position: static; flex: 0 0 auto; margin-top: 8px; }
@media (max-width: 520px) {
  #modal.course-view-modal { width: calc(100vw - 32px); max-height: 80dvh; }
  #modal.course-view-modal .modal-card { max-height: 80dvh; padding: 14px; border-radius: 16px; }
  #modal.course-view-modal .course-media { max-height: 38dvh; }
  #modal.course-view-modal .course-pdf-container,
  #modal.course-view-modal .course-docx-content { max-height: 44dvh; }
}

/* Selected course category should remain obvious after tapping the jump control. */
.course-section-jump button { transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.course-section-jump .course-jump-active { box-shadow: 0 0 0 2px rgba(43, 151, 82, .18), 0 4px 12px rgba(33, 105, 58, .12); transform: translateY(-1px); }
.course-section-jump .course-jump-main.course-jump-active { border-color: #279653; background: linear-gradient(135deg, #278d4e, #39ae65); color: #fff; }
.course-section-jump .course-jump-main.course-jump-active small { color: rgba(255,255,255,.86); }
.course-section-jump .course-jump-secondary.course-jump-active { border-color: #c88928; background: linear-gradient(135deg, #fff0d4, #ffe2ac); color: #80530d; }

/* Visible position indicator for long modal forms. */
.modal-card { position: relative; }
.modal-scroll-indicator { position: absolute; z-index: 8; top: 66px; right: 5px; bottom: 62px; width: 5px; border-radius: 99px; background: #e8eee9; opacity: 0; pointer-events: none; transition: opacity .15s ease; }
.modal-scroll-indicator.is-visible { opacity: 1; }
.modal-scroll-indicator > span { position: absolute; top: 0; left: 0; width: 100%; min-height: 22px; border-radius: inherit; background: linear-gradient(180deg, #58bd78, #278d4e); box-shadow: 0 1px 4px rgba(32, 106, 57, .25); }

/* PDF gets a larger, readable surface; video preview sizing remains unchanged. */
#modal.course-view-modal.pdf-reader-modal { width: min(840px, calc(100vw - 28px)); max-height: 94dvh; }
#modal.course-view-modal.pdf-reader-modal .modal-card { height: 90dvh; max-height: 94dvh; padding: 18px; }
#modal.course-view-modal.pdf-reader-modal .course-pdf-container { max-height: 76dvh; scrollbar-width: thin; scrollbar-color: #8ab99a #edf2ee; }
#modal.course-view-modal.pdf-reader-modal .course-pdf-container::-webkit-scrollbar { width: 8px; }
#modal.course-view-modal.pdf-reader-modal .course-pdf-container::-webkit-scrollbar-track { border-radius: 8px; background: #edf2ee; }
#modal.course-view-modal.pdf-reader-modal .course-pdf-container::-webkit-scrollbar-thumb { border: 2px solid #edf2ee; border-radius: 8px; background: #8ab99a; }
@media (max-width: 520px) {
  #modal.course-view-modal.pdf-reader-modal { width: calc(100vw - 20px); max-height: 94dvh; }
  #modal.course-view-modal.pdf-reader-modal .modal-card { height: 90dvh; max-height: 94dvh; padding: 14px; }
  #modal.course-view-modal.pdf-reader-modal .course-pdf-container { max-height: 74dvh; }
  .modal-scroll-indicator { right: 3px; }
}

/* Carry the paid header color into the iPhone safe area without changing browser mode. */
#app > .app-header { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
#modal.course-view-modal .course-view-actions {
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #edf1ed;
}
#modal.course-view-modal .course-download-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  margin: 0;
  white-space: nowrap;
}
#modal.course-view-modal .course-view-actions #modalOkBtn {
  min-width: 82px;
  min-height: 40px;
  flex: none;
}

/* Visitor course catalog: warm, clear cards and an always-visible membership action. */
#coursesView.courses-nonmember { background: #f6faf7; }
#coursesView.courses-nonmember .course-list { border-top: 0; background: #f6faf7; }
#coursesView.courses-nonmember .course-section-jump { border-bottom-color: #e3ede5; }
#coursesView.courses-nonmember .course-section-heading.general { color: #397d52; background: #eef7f0; }
#coursesView.courses-nonmember .client-course-card {
  margin: 10px 12px;
  padding: 12px;
  border: 1px solid #e5ece6;
  border-left: 3px solid #a9cfb2;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(35, 75, 47, .055);
}
#coursesView.courses-nonmember .client-course-card:has(.course-type-badge.premium) { border-left-color: #e5bb72; }
#coursesView.courses-nonmember .course-title { color: #2d4033; }
#coursesView.courses-nonmember .course-locked-view-btn {
  min-width: 68px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #cfe4d4;
  border-radius: 10px;
  background: #f0f8f2;
  color: #32764a;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(47, 126, 71, .07);
}
#coursesView.courses-nonmember .course-locked-view-btn:active { background: #e3f2e7; transform: scale(.97); }
.membership-sticky-cta {
  z-index: 4;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 70px;
  padding: 9px 14px;
  border-top: 1px solid #dfede2;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 -5px 18px rgba(38, 91, 52, .08);
  backdrop-filter: blur(10px);
}
.membership-sticky-cta[hidden] { display: none; }
.membership-sticky-copy { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.membership-sticky-copy strong { color: #2e563a; font-size: 13px; }
.membership-sticky-copy small { color: #7f9083; font-size: 11px; }
.membership-sticky-button {
  flex: none;
  min-width: 102px;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #36a45c, #248247);
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  box-shadow: 0 4px 10px rgba(36, 130, 71, .2);
}
.membership-sticky-button.pending { border: 1px solid #e8d8ae; background: #fff8e9; color: #97712a; box-shadow: none; }
.course-member-welcome {
  display: flex;
  flex: none;
  align-items: center;
  gap: 9px;
  margin: 10px 12px 2px;
  padding: 9px 12px;
  border: 1px solid #d5ebdc;
  border-radius: 12px;
  background: linear-gradient(110deg, #f0faf3, #fff);
  color: #28824a;
}
.course-member-welcome > span { display: grid; width: 27px; height: 27px; flex: none; place-items: center; border-radius: 50%; background: #dff3e5; font-weight: 800; }
.course-member-welcome div { display: flex; flex-direction: column; gap: 2px; }
.course-member-welcome strong { color: #286a40; font-size: 11px; }
.course-member-welcome small { color: #799080; font-size: 10px; }
#coursesView.courses-member .course-list { background: #fbfdfb; }
#coursesView.courses-member .client-course-card {
  margin: 9px 12px;
  padding: 12px;
  border: 1px solid #e5ede7;
  border-left: 3px solid #83bd91;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 3px 11px rgba(35, 75, 47, .045);
}
#coursesView.courses-member .client-course-card:has(.course-type-badge.premium) { border-left-color: #e5bb72; }
.membership-upsell-card { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 4px 11px; padding: 5px 0; }
.membership-upsell-icon { display: grid; width: 40px; height: 40px; grid-row: span 2; place-items: center; border-radius: 13px; background: #e9f6ec; color: #32824c; font-size: 20px; }
.membership-upsell-card > div:nth-child(2) { display: flex; flex-direction: column; gap: 4px; }
.membership-upsell-card > div:nth-child(2) strong { color: #2d4234; font-size: 14px; }
.membership-upsell-card > div:nth-child(2) small { color: #75877a; font-size: 11px; }
.membership-upsell-card p, .membership-upsell-price { grid-column: 1 / -1; }
.membership-upsell-card p { margin-top: 12px; color: #627368; font-size: 12px; line-height: 1.65; }
.membership-upsell-price { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding: 11px 12px; border-radius: 11px; background: #f2f8f3; color: #597160; font-size: 12px; }
.membership-upsell-price strong { color: #258249; font-size: 20px; }
.course-section-jump .course-jump-main.course-jump-active { border-color: #a9cfb2; background: linear-gradient(135deg, #eff8f1, #e4f3e8); color: #34754a; box-shadow: 0 0 0 1px rgba(93, 160, 111, .12), 0 3px 9px rgba(41, 107, 59, .08); }
.course-section-jump .course-jump-main.course-jump-active small { color: #758d7b; }
.course-section-jump .course-jump-secondary.course-jump-active { border-color: #e8ce9e; background: linear-gradient(135deg, #fff8ea, #fff0d5); color: #8a651e; box-shadow: 0 0 0 1px rgba(187, 140, 52, .1), 0 3px 9px rgba(125, 91, 25, .06); }
#app.app-visitor > .app-header { background: #fff; border-bottom-color: #edf1ed; }
#app.app-visitor .bottom-nav { background: #fff; border-top-color: #e9efea; }
#app.app-visitor .bottom-nav .nav-active { color: #348653; }

/* Compact course conversion strip keeps the action visible without sacrificing reading space. */
.membership-sticky-cta { min-height: 46px; gap: 8px; padding: 4px 12px; box-shadow: 0 -2px 8px rgba(38, 91, 52, .05); }
.membership-sticky-copy { flex-direction: row; align-items: baseline; gap: 7px; white-space: nowrap; }
.membership-sticky-copy strong { color: #496a52; font-size: 11px; font-weight: 650; }
.membership-sticky-copy span { color: #27844b; font-size: 13px; font-weight: 750; }
.membership-sticky-button { min-width: 78px; min-height: 36px; padding: 0 12px; border-radius: 10px; font-size: 12px; box-shadow: none; }
.membership-sticky-button.pending { border-color: #eee2c4; }

/* Prominent membership offer: clear price, benefit and action in a compact bar. */
.membership-sticky-cta {
  min-height: 62px;
  gap: 10px;
  padding: 7px 12px;
  border-top: 1px solid #f0d59d;
  background: linear-gradient(100deg, #fff9e9 0%, #fff4d8 52%, #f3faef 100%);
  box-shadow: 0 -4px 14px rgba(117, 84, 25, .12);
}
.membership-sticky-copy { align-items: center; gap: 10px; white-space: normal; }
.membership-sticky-copy .membership-sticky-price { color: #d87916; font-size: 20px; font-weight: 850; line-height: 1; white-space: nowrap; }
.membership-sticky-copy span { display: flex; min-width: 0; flex-direction: column; gap: 2px; color: #315c3b; font-size: 12px; line-height: 1.2; }
.membership-sticky-copy span b { color: #275b35; font-size: 13px; font-weight: 800; }
.membership-sticky-copy span small { color: #74816e; font-size: 10px; font-weight: 550; }
.membership-sticky-button { min-width: 98px; min-height: 42px; border: 1px solid #168a48; border-radius: 12px; background: linear-gradient(180deg, #26b864, #14954e); color: #fff; font-size: 13px; font-weight: 800; box-shadow: 0 3px 9px rgba(20, 137, 70, .23); }
.membership-sticky-button.pending { border-color: #e5c98c; background: #f4edda; color: #8a6c2f; box-shadow: none; }
@media (max-width: 360px) {
  .membership-sticky-cta { gap: 7px; padding-inline: 9px; }
  .membership-sticky-copy { gap: 7px; }
  .membership-sticky-copy .membership-sticky-price { font-size: 18px; }
  .membership-sticky-button { min-width: 88px; }
}
