.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  align-items: stretch;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: clamp(30px, 6vw, 90px);
  background: #27323d;
}

.hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(rgba(16, 24, 33, 0.58), rgba(16, 24, 33, 0.58)),
    url("/assets/images/member-hero-sand.webp") center / cover;
  content: "";
}

.hero-copy {
  align-self: center;
}

.hero-biography {
  max-width: 720px;
  color: #ebedef;
  font-size: 14px;
  line-height: 1.8;
}

.hero-biography p {
  margin: 0 0 16px;
}

.hero-biography p:first-child {
  color: #f6b27f;
  font-size: 19px;
  font-weight: 700;
}

.professor-portrait {
  border-left: 0;
  padding: 0;
  position: relative;
  min-height: 520px;
  overflow: hidden;
  background: #d5d7d5;
}

.professor-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
}

.professor-portrait div {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 20px 25px;
  min-width: 180px;
  background: rgba(22, 31, 41, .91);
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero .professor-portrait {
    display: block;
    order: -1;
    min-height: min(74vh, 560px);
  }
}

@media (max-width: 520px) {
  .hero-biography {
    font-size: 13px;
  }

  .professor-portrait {
    min-height: 420px;
  }
}

.guest-more {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--orange);
  cursor: pointer;
  font: 700 11px "Noto Sans TC", sans-serif;
}

.guest-modal {
  width: min(650px, calc(100% - 32px));
  max-height: min(720px, calc(100% - 50px));
  padding: 38px;
  border: 0;
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .32);
}

.guest-modal::backdrop {
  background: rgba(16, 24, 33, .72);
  backdrop-filter: blur(3px);
}

.guest-modal h3 {
  margin: 0 0 18px;
  font-size: 28px;
}

.guest-modal div {
  white-space: pre-wrap;
  line-height: 1.9;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 30px;
  cursor: pointer;
}

.member-note {
  max-width: 720px;
  color: var(--muted);
  font-size: 13px;
}

.member-table code {
  display: block;
  min-width: 260px;
  color: #526170;
  font-size: 11px;
  word-break: break-all;
}

.member-actions {
  min-width: 230px;
}

.member-actions > form {
  margin-bottom: 10px;
}

.member-actions .button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.member-search {
  display: flex;
  align-items: end;
  gap: 10px;
  margin: 0 0 22px;
}

.member-search label {
  min-width: min(420px, 100%);
  font-size: 13px;
  font-weight: 700;
}

.member-search input {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  font: 14px "Noto Sans TC", sans-serif;
}

.member-search .button {
  min-height: 39px;
}

.member-search a {
  padding: 8px;
  color: var(--orange);
  font-size: 13px;
  font-weight: 700;
}

.member-filters {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(130px, 1fr));
  align-items: end;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.member-filters label {
  min-width: 0;
}

.member-filters select,
.member-filters input {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  margin-top: 5px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  background: #fff;
  font: 14px "Noto Sans TC", sans-serif;
}

.member-filters .button,
.member-filters a {
  align-self: end;
  margin: 0;
}

@media (max-width: 1100px) {
  .member-filters {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

.member-table th a {
  white-space: nowrap;
}

.program-schedule {
  overflow-x: auto;
  background: #fff;
}

.program-schedule table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  text-align: left;
}

.program-schedule th,
.program-schedule td {
  padding: 18px 16px;
  border-bottom: 1px solid #e7e3df;
  vertical-align: top;
}

.program-schedule thead th {
  background: #ddd7d7;
  color: #373b3f;
  font-size: 18px;
  font-weight: 700;
}

.program-schedule tbody th {
  width: 180px;
  color: #535b63;
  font-weight: 700;
}

.program-schedule td {
  color: #3e464d;
  font-size: 16px;
  line-height: 1.85;
}

.status-badge {
  display: inline-block;
  min-width: 48px;
  padding: 3px 9px;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.status-badge.enabled {
  background: #1d9b62;
}

.status-badge.disabled {
  background: #c64545;
}

.rich-editor {
  margin-top: 6px;
  border: 1px solid var(--line);
  background: #fff;
}

.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 7px;
  border-bottom: 1px solid var(--line);
  background: #f7f8f8;
}

.rich-toolbar button,
.image-upload {
  border: 1px solid #c8ced2;
  background: #fff;
  padding: 4px 8px;
  color: #37424e;
  cursor: pointer;
  font: 12px "Noto Sans TC", sans-serif;
}

.image-upload input {
  display: none;
}

.wysiwyg {
  min-height: 180px;
  padding: 12px;
  outline: none;
  font-weight: 400;
}

.wysiwyg:focus {
  box-shadow: inset 0 0 0 2px #ed7b2840;
}

.wysiwyg img,
.rich-content img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 14px 0;
}

.rich-content p:first-child {
  margin-top: 0;
}

/* Give the landing-page announcement a wider desktop reading column. */
.announcement {
  max-width: 1280px;
}

.announcement-list {
  display: grid;
  gap: 20px;
}

.member-news-list {
  display: grid;
  max-width: 1280px;
  gap: 18px;
}

.member-news {
  padding: 28px 32px;
  border-left: 4px solid var(--orange);
  background: #fff;
  box-shadow: 0 8px 24px rgba(41, 55, 71, .04);
}

.member-news h3 {
  margin: 0 0 14px;
  font-size: 22px;
}

.announcement h3 {
  margin: 6px 0 14px;
  font-size: 22px;
}

.announcement .rich-content a {
  color: #173b63;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
}

.announcement .rich-content a:hover {
  color: #0b2744;
}

.member-announcement-list .feature-news {
  display: block;
}

.membership .login-panel p {
  color: var(--ink);
}

.outlook h3,
.outlook-archive h3 {
  margin: 6px 0 16px;
  font-size: 24px;
}

.outlook-archive {
  margin-top: 32px;
}

.member-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  color: var(--muted);
  font-size: 13px;
}

.member-pagination > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.member-pagination a:not(.button) {
  min-width: 31px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: center;
}

.member-pagination a.current {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
}

.member-pagination .button {
  min-height: 34px;
  padding: 0 12px;
}

.guest-admin-image {
  display: block;
  width: 46px;
  height: 58px;
  object-fit: cover;
  background: #e9ecee;
}

.audio-source {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
}

.audio-source > label {
  display: inline-flex;
  width: auto;
  margin: 0 16px 10px 0;
  align-items: center;
  gap: 6px;
}

.audio-source input[type="radio"] {
  width: auto;
}

.audio-source [data-audio-url],
.audio-source [data-audio-upload] {
  margin-top: 6px;
}

.upload-note,
.audio-upload-status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.audio-upload-status {
  color: var(--ink);
}

.audio-archive,
.outlook-archive {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.audio-archive summary,
.outlook-archive summary {
  padding: 12px 0;
  color: var(--orange);
  cursor: pointer;
  font-weight: 700;
}

.audio-archive .audio-list {
  max-height: 680px;
  overflow-y: auto;
  padding-right: 8px;
}

.member-hero {
  position: relative;
  overflow: hidden;
  background: #27323d;
}

.member-hero::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  background:
    linear-gradient(rgba(16, 24, 33, 0.58), rgba(16, 24, 33, 0.58)),
    url("/assets/images/member-hero-sand.webp") center / cover;
  content: "";
  opacity: 0.78;
}

.member-hero > * {
  position: relative;
  z-index: 1;
}

.guest-image-uploader {
  margin-top: 14px;
}

.guest-upload-preview {
  display: block;
  width: 150px;
  max-height: 210px;
  margin-top: 12px;
  object-fit: contain;
  background: #eef0f1;
}

.guest-upload-preview[hidden] {
  display: none;
}

.member-zone-tag {
  display: none;
}

.logout-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 11px;
  border: 1px solid #d77a58;
  border-radius: 999px;
  color: #a8472c;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

@media (max-width: 900px) {
  .site-header nav {
    min-width: 0;
    gap: 8px;
  }

  .user-link {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
  }

  .member-name {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .member-zone-tag {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 3px;
    padding: 2px 5px;
    border: 1px solid #e0a06e;
    border-radius: 999px;
    color: #bc5c20;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.35;
  }

  .member-zone-tag svg {
    width: 11px;
    height: 11px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
  }

  .site-header nav .logout-link {
    display: inline-flex !important;
  }

}

@media (max-width: 520px) {
  .site-header {
    padding: 0 12px;
  }

  .member-name {
    max-width: 70px;
  }

  .member-zone-tag {
    gap: 2px;
    padding: 2px 4px;
    font-size: 9px;
  }

  .logout-link {
    padding: 5px 7px;
    font-size: 11px;
  }

  .member-search {
    display: block;
  }

  .member-filters {
    display: grid;
    grid-template-columns: 1fr;
  }

  .member-search .button,
  .member-search a {
    margin-top: 10px;
  }
}

@media (display-mode: standalone) and (max-width: 900px) {
  .site-header {
    height: 64px;
    padding: 0 14px;
  }

  main {
    min-height: calc(100vh - 64px);
  }
}

/* Optimized brand asset replaces the previous text-only W mark. */
.brand {
  grid-template-columns: 38px auto;
}

.brand img {
  grid-row: 1 / 3;
  display: block;
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.session-limit-card {
  text-align: center;
}

.session-limit-card h1 {
  font-size: clamp(30px, 8vw, 42px);
}

.session-limit-copy {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.8;
}

.session-limit-card form .button,
.session-limit-card > .button {
  width: 100%;
  margin: 0;
}

.session-limit-back {
  display: inline-block;
  margin-top: 22px;
  font-size: 13px;
}

.session-request-actions {
  min-width: 210px;
}

.session-request-actions form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.session-request-actions select {
  width: auto;
  margin: 0;
}

.session-request-actions .button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.whatsapp-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 15px;
  border-radius: 999px;
  background: #25d366;
  box-shadow: 0 10px 24px rgba(18, 105, 52, .32);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  transition: transform .2s ease, background .2s ease;
}

.whatsapp-float:hover {
  background: #1eaf54;
  color: #fff;
  transform: translateY(-2px);
}

.whatsapp-float svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

/* The provider widget replaces the placeholder in this dedicated live area. */
.live-player.live-podcast {
  grid-template-columns: minmax(0, 1fr);
}

.live-podcast .cc_player,
.live-podcast .centovaplayer {
  width: 100%;
}

.visitor-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
  margin: 0 0 24px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
}

.visitor-filters label {
  min-width: 180px;
  margin: 0;
}

.visitor-filters select {
  margin-top: 5px;
}

.visitor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 26px;
}

.visitor-grid section,
.visitor-section {
  padding: 20px;
  background: #fff;
}

.visitor-grid h2,
.visitor-section h2 {
  margin: 0 0 15px;
  font-size: 19px;
}

.visitor-section {
  margin-top: 20px;
}

.visitor-table {
  max-height: 430px;
}

.visitor-referrer {
  display: inline-block;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.member-password-reset {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.password-hash {
  margin: 0 0 12px;
  font-size: 12px;
  word-break: break-all;
}

.password-hash code {
  display: inline;
  min-width: 0;
}

.password-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

.password-tools button,
.password-hash button {
  border: 1px solid var(--line);
  background: #fff;
  padding: 6px 9px;
  color: var(--ink);
  cursor: pointer;
  font: 600 12px "Noto Sans TC", sans-serif;
}

.push-opt-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 28px 0;
  padding: 24px 28px;
  border: 1px solid rgba(207, 105, 40, 0.28);
  background: #fff8f2;
  box-shadow: 0 12px 36px rgba(49, 42, 37, 0.08);
}

.push-opt-in[hidden] {
  display: none;
}

.push-opt-in h2,
.push-opt-in p {
  margin: 0;
}

.push-opt-in .eyebrow {
  margin-bottom: 5px;
}

.push-opt-in-actions,
.push-delivery {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.push-opt-in-actions {
  flex: 0 0 auto;
}

.push-admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(360px, 1.4fr);
  gap: 24px;
  align-items: start;
  margin-top: 24px;
}

.push-composer,
.push-conversation {
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
}

.push-composer {
  position: sticky;
  top: 20px;
}

.push-composer h2,
.push-conversation h2 {
  margin: 0 0 18px;
  font-size: 20px;
}

.push-composer textarea {
  min-height: 150px;
}

.push-conversation {
  max-height: 720px;
  overflow-y: auto;
}

.push-message {
  margin: 0 0 14px;
  padding: 18px;
  border-radius: 14px 14px 3px 14px;
  background: #f4f0eb;
}

.push-message h3 {
  margin: 10px 0 5px;
  font-size: 17px;
}

.push-message p {
  margin: 0 0 12px;
  white-space: pre-wrap;
}

.push-message-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 520px) {
  .whatsapp-float {
    right: 16px;
    bottom: 16px;
    width: 50px;
    height: 50px;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
  }

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

  .whatsapp-float svg {
    width: 25px;
    height: 25px;
  }

  .visitor-grid {
    grid-template-columns: 1fr;
  }

  .push-opt-in {
    display: block;
    padding: 20px;
  }

  .push-opt-in-actions {
    margin-top: 16px;
  }
}

@media (max-width: 900px) {
  .push-admin-layout {
    grid-template-columns: 1fr;
  }

  .push-composer {
    position: static;
  }
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
