/* Workspace frame, profile and account navigation. */
.member-workspace {
  display: grid;
  grid-template-columns: 220px minmax(0,1fr);
  gap: 40px;
  align-items: start;
  padding-top: 38px;
  padding-bottom: 72px;
  min-height: calc(100svh - 80px);
  color: #192b43;
}
.mw-sidebar {
  position: sticky;
  top: 112px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 12px 12px;
  background: #fff;
}
.mw-profile {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 8px 24px;
  min-width: 0;
}
.mw-profile img {
  flex: none;
  border-radius: 12px;
}
.mw-profile>div {
  min-width: 0;
}
.mw-profile strong {
  display: block;
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.mw-profile span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.mw-nav {
  display: grid;
  gap: 6px;
}
.mw-nav a {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border-radius: 9px;
  color: #596b80;
  font-size: 14px;
  font-weight: 600;
  touch-action: manipulation;
}
.mw-nav a svg {
  flex: none;
}
.mw-nav a:hover {
  background: #f6f8fb;
  color: var(--blue);
}
.mw-nav a[aria-current=page] {
  background: #edf4ff;
  color: var(--blue);
}
.mw-logout {
  display: block;
  width: 100%;
  margin-top: 26px;
  padding: 15px 12px 8px;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  text-align: left;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.mw-logout:hover {
  color: var(--blue);
}

/* Page headings and shared workspace links. */
.mw-panel {
  min-width: 0;
}
.mw-view-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 4px 0 28px;
}
.member-workspace h1 {
  font-size: 30px;
  line-height: 1.4;
  margin: 0;
  color: #18263c;
  letter-spacing: -.3px;
  text-wrap: balance;
  scroll-margin-top: 110px;
}
.mw-view-heading p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
  margin: 8px 0 0;
}
.mw-text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue);
  font-size: 13px;
  line-height: 1.6;
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}
.mw-text-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.mw-view-heading>.mw-text-link {
  flex: none;
}

/* Course cards: base rules; later compact-row overrides remain in cascade order. */
.mw-course-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 24px;
}
.mw-course {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.mw-course>img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1.6;
  object-fit: cover;
  background: #123345;
}
.mw-course-copy {
  padding: 20px;
}
.mw-course-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.mw-grant {
  padding: 4px 8px;
  background: #eaf7ef;
  color: #28744f;
  border-radius: 5px;
  font-size: 11px;
}
.mw-course h2 {
  font-size: 22px;
  line-height: 1.5;
  margin: 15px 0 20px;
  overflow-wrap: anywhere;
}
.mw-course-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.mw-course-actions .button {
  min-height: 44px;
  padding: 11px 17px;
  font-size: 14px;
  line-height: 1.5;
}
.mw-course-actions .feedback-link {
  font-size: 12px;
  padding: 8px 0;
  line-height: 1.6;
}
.mw-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 355px;
  padding: 38px 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fafcff;
  text-align: center;
}
.mw-empty>svg {
  width: 34px;
  height: 34px;
  box-sizing: content-box;
  color: var(--blue);
  padding: 18px;
  background: #edf4ff;
  border-radius: 20px;
  margin-bottom: 20px;
}
.mw-empty h2 {
  font-size: 22px;
  line-height: 1.5;
  margin: 0 0 10px;
  text-wrap: balance;
}
.mw-empty p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  margin: 0 0 24px;
}
.mw-empty .button {
  min-height: 44px;
  font-size: 14px;
  padding: 12px 22px;
}
.mw-quiet-empty {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 32px;
  background: #fafcff;
  color: var(--muted);
  font-size: 14px;
}
.mw-quiet-empty p {
  margin: 0;
}

/* Purchase records and expandable payment history. */
.mw-records {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-variant-numeric: tabular-nums;
}
.mw-records table {
  width: 100%;
  font-size: 13px;
}
.mw-records th,.mw-records td {
  padding: 17px 20px;
}
.mw-records th:first-child,.mw-records td:first-child {
  white-space: normal;
  min-width: 170px;
  overflow-wrap: anywhere;
}
.mw-record-state {
  color: #65758a;
}
.mw-record-state.is-paid {
  color: #28744f;
}
.mw-history {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafcff;
  overflow: hidden;
}
.mw-history summary {
  font-size: 13px;
  line-height: 1.7;
  padding: 16px 20px;
  cursor: pointer;
  color: #63758d;
}
.mw-history[open] summary {
  border-bottom: 1px solid var(--line);
  color: var(--blue);
}
.mw-history .mw-records {
  border: 0;
  border-radius: 0;
}

/* Account summary: later editing-form refinements remain below. */
.mw-account-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  max-width: 660px;
  background: #fff;
}
.mw-account-card dl {
  margin: 0 0 28px;
}
.mw-account-card dl>div {
  display: grid;
  grid-template-columns: 76px minmax(0,1fr);
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.8;
}
.mw-account-card dl>div:first-child {
  padding-top: 0;
}
.mw-account-card dt {
  color: var(--muted);
}
.mw-account-card dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.mw-account-card .button {
  font-size: 14px;
  min-height: 44px;
  padding: 12px 20px;
}

/* Help, feedback and logged-out/loading states. */
.mw-help-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 20px;
}
.mw-help-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafcff;
  min-width: 0;
}
.mw-help-card>svg {
  color: var(--blue);
  margin-bottom: 14px;
}
.mw-help-card h2,.mw-feedback h2 {
  font-size: 20px;
  margin: 0 0 10px;
  line-height: 1.5;
}
.mw-help-card p,.mw-feedback p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
  margin: 0 0 22px;
}
.mw-feedback {
  margin-top: 28px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.mw-feedback-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mw-feedback select {
  width: 100%;
  max-width: 400px;
  min-width: 0;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #192b43;
  font: inherit;
  font-size: 14px;
}
.mw-feedback .button {
  flex: none;
  min-height: 46px;
  font-size: 14px;
  padding: 11px 18px;
}
.mw-entry,.mw-loading {
  grid-column: 1/-1;
  max-width: 620px;
  width: 100%;
  margin: 38px auto;
  padding: 38px 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: center;
}
.mw-entry p,.mw-loading p {
  margin: 12px 0 26px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.mw-entry-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.mw-inline-notice {
  padding: 15px 18px;
  margin: 0 0 24px;
  background: #f6f8fc;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.8;
  color: #63758d;
}
.member-workspace :is(a,button,select,summary):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}
.member-workspace h1:focus {
  outline: none;
}
.member-workspace button:disabled {
  cursor: wait;
  opacity: .6;
}
@media (max-width:1050px) {
  .member-workspace {
    grid-template-columns: 200px minmax(0,1fr);
    gap: 28px;
  }
  .mw-course-meta {
    justify-content: flex-start;
  }
  .mw-course h2 {
    font-size: 20px;
  }
  .mw-course-copy {
    padding: 18px;
  }
  .mw-help-card {
    padding: 22px;
  }
}
@media (max-width:900px) {
  .mw-course-grid {
    grid-template-columns: minmax(0,1fr);
    max-width: 510px;
  }
  .mw-help-grid {
    grid-template-columns: minmax(0,1fr);
  }
}
@media (max-width:760px) {
  .member-workspace {
    grid-template-columns: minmax(0,1fr);
    gap: 24px;
    padding-top: 20px;
    padding-bottom: 40px;
    min-height: calc(100svh - 70px);
  }
  .mw-sidebar {
    position: static;
    padding: 0;
    border: 0;
    border-radius: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
  }
  .mw-profile {
    padding: 0;
    flex: 1;
    min-width: 0;
  }
  .mw-profile img {
    width: 36px;
    height: 36px;
    border-radius: 9px;
  }
  .mw-profile strong {
    font-size: 14px;
  }
  .mw-profile span {
    font-size: 11px;
    margin-top: 2px;
  }
  .mw-logout {
    width: auto;
    margin: 0;
    padding: 8px 0;
    border: 0;
    flex: none;
    font-size: 12px;
    order: 1;
  }
  .mw-nav {
    display: flex;
    overflow-x: auto;
    gap: 4px;
    order: 2;
    flex-basis: 100%;
    padding: 5px;
    background: #f6f8fc;
    border: 1px solid var(--line);
    border-radius: 10px;
  }
  .mw-nav a {
    flex: 1 0 auto;
    min-width: 66px;
    padding: 11px 4px;
    justify-content: center;
    gap: 0;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 7px;
  }
  .mw-nav a svg {
    display: none;
  }
  .mw-nav a[aria-current=page] {
    background: #fff;
    box-shadow: 0 1px 4px #183e6910;
  }
  .mw-view-heading {
    margin: 0 0 22px;
    gap: 12px;
    align-items: flex-start;
  }
  .member-workspace h1 {
    font-size: 26px;
  }
  .mw-view-heading p {
    font-size: 13px;
  }
  .mw-view-heading>.mw-text-link {
    font-size: 12px;
    padding-top: 9px;
  }
  .mw-course-grid {
    max-width: none;
    gap: 20px;
  }
  .mw-course-copy {
    padding: 20px;
  }
  .mw-course h2 {
    font-size: 22px;
  }
  .mw-course-meta {
    justify-content: space-between;
  }
  .mw-empty {
    min-height: 310px;
    padding: 30px 20px;
  }
  .mw-empty h2 {
    font-size: 20px;
  }
  .mw-empty p {
    font-size: 13px;
  }
  .mw-quiet-empty {
    padding: 24px;
  }
  .mw-account-card {
    padding: 22px;
  }
  .mw-account-card dl>div {
    grid-template-columns: 44px minmax(0,1fr);
    gap: 12px;
    font-size: 13px;
  }
  .mw-help-grid {
    gap: 16px;
  }
  .mw-help-card,.mw-feedback {
    padding: 22px;
  }
  .mw-feedback {
    margin-top: 20px;
  }
  .mw-feedback-controls {
    flex-wrap: wrap;
  }
  .mw-feedback select {
    max-width: none;
    flex-basis: 100%;
    font-size: 16px;
  }
  .mw-entry,.mw-loading {
    margin: 20px auto;
    padding: 30px 20px;
  }
  .mw-records th,.mw-records td {
    padding: 14px 16px;
  }
  .mw-history summary {
    padding: 16px;
  }
}

/* Account-bound activation and the existing customer operations view. */
.mw-activation {
  max-width: 640px;
  padding: 30px;
  border: 1px solid var(--line,#dce5f2);
  border-radius: 16px;
  background: #fff;
}
.mw-activation-account {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.mw-activation label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
}
.mw-activation input,#activation-admin textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid #dce5f2;
  border-radius: 8px;
  background: #fff;
  color: #192b43;
  font: inherit;
}
.mw-activation input {
  font-family: monospace;
  font-size: 16px;
  letter-spacing: .04em;
}
.mw-activation form p {
  margin: 14px 0 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.mw-activation #redeem-status {
  margin-top: 20px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.mw-activation :is(input,button):focus-visible,#activation-admin :is(input,select,textarea,button):focus-visible {
  outline: 2px solid #1761d3;
  outline-offset: 3px;
}
#activation-admin {
  margin-top: 30px;
}
#activation-admin .code-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0;
  align-items: center;
}
#activation-admin .code-status {
  min-height: 1.5em;
  color: #476484;
}
#activation-admin textarea {
  min-height: 140px;
  font-family: monospace;
  white-space: pre;
  resize: vertical;
}
#activation-admin td {
  overflow-wrap: anywhere;
}
#activation-admin td small {
  display: block;
  color: #74859d;
}
#activation-admin td button {
  margin: 3px;
}
@media (max-width:600px) {
  .mw-activation {
    padding: 22px 18px;
  }
  .mw-activation .button {
    width: 100%;
  }
  #activation-admin .admin-fields {
    grid-template-columns: 1fr;
  }
}

/* Payment detail disclosures and checkout-message placement. */
.mw-order-detail {
  min-width: 110px;
}
.mw-order-detail summary {
  color: #1761d3;
  cursor: pointer;
  min-height: 36px;
  display: flex;
  align-items: center;
}
.mw-order-detail dl {
  margin: 12px 0;
  max-width: 260px;
}
.mw-order-detail dt {
  color: #667891;
  font-size: 12px;
}
.mw-order-detail dd {
  margin: 4px 0 12px;
  overflow-wrap: anywhere;
  white-space: normal;
}
.mw-order-detail button {
  display: block;
  margin: 8px 0;
}
.mw-order-detail summary:focus-visible {
  outline: 2px solid #1761d3;
  outline-offset: 3px;
}
#checkout-message:empty {
  display: none;
}
.member-workspace~#checkout-message {
  max-width: 1200px;
  margin: 16px auto;
  padding: 0 24px;
}

/* Keep member navigation in flow; base mobile nav rules target the site menu. */
.member-workspace {
  align-content: start;
}
.mw-nav {
  position: static;
  box-shadow: none;
}
@media (max-width:760px) {
  .mw-nav {
    width: 100%;
    height: auto;
    inset: auto;
    box-shadow: none;
    flex-direction: row;
  }
  .mw-payment-table,.mw-payment-table tbody {
    display: block;
    width: 100%;
  }
  .mw-payment-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .mw-payment-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 18px;
    border-bottom: 1px solid var(--line);
  }
  .mw-payment-table tr:last-child {
    border-bottom: 0;
  }
  .mw-records .mw-payment-table td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    white-space: normal;
  }
  .mw-payment-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 5px;
  }
  .mw-payment-table td:first-child,.mw-payment-table td:last-child {
    grid-column: 1/-1;
  }
  .mw-payment-table td:last-child::before {
    display: none;
  }
  .mw-order-detail {
    min-width: 0;
  }
  .mw-order-detail dd {
    max-width: none;
  }
}

/* Compact teaching workspace: one stable row per course, regardless of count. */
.member-workspace {
  max-width: 1280px;
  gap: 32px;
}
.mw-course-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: 18px;
  max-width: none;
}
.mw-course {
  display: grid;
  grid-template-columns: minmax(180px,30%) minmax(0,1fr);
  align-items: center;
  padding: 20px;
  gap: 24px;
}
.mw-course-cover {
  display: block;
  overflow: hidden;
  border-radius: 9px;
  background: #edf5fa;
}
.mw-course-cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1.6;
  object-fit: cover;
}
.mw-course-copy {
  min-width: 0;
  padding: 0;
}
.mw-course-meta {
  justify-content: flex-start;
  gap: 10px;
}
.mw-course h2 {
  font-size: 21px;
  line-height: 1.4;
  margin: 12px 0 7px;
}
.mw-course h2 a {
  color: inherit;
}
.mw-course-expiry {
  margin: 0 0 18px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.mw-course-actions {
  justify-content: flex-start;
  gap: 18px;
}
.mw-course-actions .button {
  padding: 10px 18px;
}
.mw-course-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0 0 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
}
.mw-course-tip {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  margin: 18px 0;
}
@media (min-width:360px) and (max-width:760px) {
  .mw-nav {
    gap: 1px;
  }
  .mw-nav a {
    min-width: 0;
    flex: 1 1 0;
    padding: 11px 2px;
    font-size: 12px;
  }
}

/* Editable account fields, password disclosure and final responsive refinements. */
.mw-account-card {
  max-width: 760px;
  margin-bottom: 20px;
  padding: 28px;
}
.mw-account-card h2 {
  font-size: 18px;
  margin: 0 0 24px;
}
.mw-account-card form {
  max-width: 440px;
}
.mw-account-card label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 20px 0 8px;
}
.mw-account-card input {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  color: #192b43;
  background: #fff;
  font: inherit;
  font-size: 14px;
}
.mw-account-card input[readonly] {
  background: #f7f9fc;
  color: #6e7d90;
}
.mw-field-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  margin: 8px 0 20px;
}
.mw-account-card .button {
  font-size: 14px;
  min-height: 44px;
  padding: 10px 20px;
}
.mw-account-card [role=status] {
  font-size: 13px;
  line-height: 1.8;
}
.mw-password {
  margin-top: 20px;
}
.mw-password summary {
  color: var(--blue);
  cursor: pointer;
  font-size: 14px;
}
.mw-account-card :is(input,button,summary):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
@media (max-width:1000px) {
  .mw-course {
    grid-template-columns: minmax(150px,32%) minmax(0,1fr);
    gap: 18px;
  }
  .mw-course-actions {
    gap: 12px;
  }
  .mw-course h2 {
    font-size: 19px;
  }
}
@media (max-width:700px) {
  .member-workspace {
    gap: 24px;
  }
  .mw-course {
    grid-template-columns: minmax(0,1fr);
    padding: 16px;
    gap: 16px;
  }
  .mw-course-cover {
    max-height: none;
  }
  .mw-course h2 {
    font-size: 20px;
  }
  .mw-course-actions {
    gap: 14px;
  }
  .mw-account-card {
    padding: 22px;
  }
  .mw-account-card input {
    font-size: 16px;
  }
  .mw-course-toolbar {
    margin-top: 0;
  }
  .mw-course-actions .button {
    flex: 1;
    justify-content: center;
  }
  .mw-course-actions .feedback-link {
    flex: none;
  }
}
