/* The password field on every page: the eye button that shows what was typed */

.pw-wrap {
  position: relative;
  display: block;
}
.pw-wrap input {
  width: 100%;
  box-sizing: border-box;
  padding-right: 46px !important;
}
.pw-eye {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--ink-2);
  cursor: pointer;
  padding: 0;
}
.pw-eye:hover {
  color: var(--ink);
}
.pw-eye:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.pw-eye[aria-pressed="true"] .pw-slash {
  display: none;
}

/* ---------- text size, chosen in Profile → Appearance: the whole page scales, as its sizes are in rem ---------- */
html[data-size="s"] {
  font-size: 93.75%;
}
html[data-size="l"] {
  font-size: 112.5%;
}
html[data-size="xl"] {
  font-size: 125%;
}

/* ---------- the profile page and the pages under it: a panel on a wide screen, the whole screen on a phone ---------- */
.acct-dlg.acct-profile,
.acct-dlg.pf-sub {
  width: min(30rem, calc(100vw - 32px));
}
@media (max-width: 560px) {
  .acct-dlg.acct-profile,
  .acct-dlg.pf-sub {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 22px 16px 32px;
  }
  .acct-dlg.pf-sub {
    padding-top: 56px;
  }
}
.pf-me {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 6px 0 14px;
  min-width: 0;
}
.pf-me > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.pf-me b {
  font: 700 1.15rem/1.25 var(--f-display);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pf-me small {
  color: var(--ink-2);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}
.pf-guest {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: none;
}
.pf-guest .acct-ic {
  width: 30px;
  height: 30px;
}
.pf-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 14px;
}
.pf-plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--paper);
}
.pf-plan > div {
  display: grid;
  gap: 2px;
}
.pf-plan b {
  font-size: 1rem;
}
.pf-plan.ok b {
  color: var(--ok, #14734a);
}
.pf-plan small {
  color: var(--ink-2);
  font-size: 0.84rem;
}
.pf-unlock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 0.88rem/1 var(--f-body);
  cursor: pointer;
}
.pf-unlock .acct-ic {
  width: 16px;
  height: 16px;
}
.pf-list {
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--paper);
  overflow: hidden;
}
.pf-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border: 0;
  border-top: 1px solid var(--rule);
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.pf-row:first-child {
  border-top: 0;
}
.pf-row:hover {
  background: var(--surface);
}
.pf-row .acct-ic {
  width: 21px;
  height: 21px;
  color: var(--ink-2);
}
.pf-row > span:not(.acct-chev) {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.pf-row b {
  font-size: 0.98rem;
}
.pf-row small {
  color: var(--ink-2);
  font-size: 0.82rem;
}
/* the owners' Admin button, on the right of the name and email */
.pf-adm {
  margin-left: auto;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: 600 0.95rem/1 var(--f-body);
  text-decoration: none;
}
.pf-adm:hover {
  border-color: var(--ink-2);
}
.pf-adm .acct-ic {
  width: 19px;
  height: 19px;
}
.pf-out {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: none;
  color: var(--ink-2);
  font: 600 0.95rem/1 var(--f-body);
  cursor: pointer;
}
.pf-out:hover {
  color: var(--ink);
  background: var(--paper);
}
.pf-row:focus-visible,
.pf-out:focus-visible,
.pf-unlock:focus-visible,
.pf-opts button:focus-visible,
.pf-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.acct-seg.pf-seg4 {
  grid-template-columns: repeat(4, 1fr);
}
.pf-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.pf-opts {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.pf-opts button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: 500 1rem/1.2 var(--f-body);
  cursor: pointer;
}
.pf-opts button[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  font-weight: 700;
}
.pf-tick {
  color: var(--accent);
  visibility: hidden;
}
.pf-opts button[aria-pressed="true"] .pf-tick {
  visibility: visible;
}
/* "Saved": shows for a moment at the bottom after a setting changes */
.acct-dlg .pf-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  margin: 0;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font: 600 0.88rem/1 var(--f-body);
  opacity: 0;
  transform: translate(-50%, 10px);
  transition:
    opacity 0.2s,
    transform 0.2s;
  pointer-events: none;
}
.acct-dlg .pf-toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}
.pf-pay {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--rule);
}
.pf-pay > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.pf-pay small {
  color: var(--ink-2);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}
.pf-amt {
  text-align: right;
  flex: none;
}
.pf-st.paid {
  color: var(--ok, #14734a);
  font-weight: 600;
}
.pf-st.refunded {
  color: #b2402f;
}
.pf-pays {
  margin-bottom: 12px;
}
.pf-nb {
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--paper);
}
.pf-nbh {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.pf-nbh b {
  font: 700 1.02rem/1.2 var(--f-display);
}
.pf-nbh small {
  color: var(--ink-2);
  font-size: 0.82rem;
}
.pf-nums {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 8px;
  margin: 10px 0;
}
.pf-nums div {
  min-width: 0;
}
.pf-nums dt {
  color: var(--ink-2);
  font-size: 0.74rem;
}
.pf-nums dd {
  margin: 0;
  font: 700 1.15rem/1.2 var(--f-display);
}
.pf-nbact {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.pf-ask p {
  margin: 0 0 8px;
  font-size: 0.9rem;
}
.pf-ask .pf-two {
  margin: 0;
}
.acct-dlg .btn.danger {
  background: #c0392b;
  border-color: transparent;
  color: #fff;
}
.pf-danger {
  padding: 12px 14px;
  border: 1px solid rgba(192, 57, 43, 0.35);
  border-radius: 12px;
}
.pf-danger p {
  font-size: 0.92rem;
}
.pf-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 6px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.acct-dlg a.btn {
  gap: 8px;
  text-decoration: none;
  box-sizing: border-box;
}
.acct-dlg a.btn .acct-ic {
  width: 18px;
  height: 18px;
}
.acct-dlg a.btn + .acct-hint {
  margin-top: 10px;
}
/* a label that wraps to two lines keeps its number level with the others */
.pf-nums div {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
/* light or dark (account.js modeSwitch): the whole screen turns at once, in one even fade. The old look stays still
   underneath and the new one fades in over it, so nothing dips or flashes on the way. */
html.nb-dusk::view-transition-old(root),
html.nb-dawn::view-transition-old(root) {
  animation: none;
  mix-blend-mode: normal;
}
html.nb-dusk::view-transition-new(root),
html.nb-dawn::view-transition-new(root) {
  animation: 0.6s cubic-bezier(0.4, 0, 0.2, 1) both nb-sky-in;
  mix-blend-mode: normal;
}
@keyframes nb-sky-in {
  from {
    opacity: 0;
  }
}

/* a link in a hint under the plans (Terms and refunds): the hint colour, underlined */
.acct-hint a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.acct-hint a:hover {
  color: var(--ink, inherit);
}

/* ---------- the unlock window: what opens up (free now / full course), then one slim card a plan ---------- */
.acct-dlg.acct-unlock {
  width: min(54rem, calc(100vw - 32px));
  padding: 30px 30px 24px;
}
.acct-unlock h2 {
  font-size: 1.6rem;
  margin-bottom: 4px;
}
.acct-unlock .up-sub {
  margin: 0 0 16px;
  color: var(--ink-2);
}
.up-cmp-w {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 12px;
  margin: 0 0 22px;
}
.up-cmp {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.up-cmp th,
.up-cmp td {
  padding: 7px 14px;
  text-align: left;
  border-top: 1px solid var(--rule);
}
.up-cmp thead th {
  border-top: 0;
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-2);
}
.up-cmp tbody th {
  font-weight: 600;
}
.up-cmp td {
  color: var(--ink-2);
}
.up-cmp td:last-child,
.up-cmp thead th:last-child {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  color: var(--ink);
  font-weight: 700;
}
.up-plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 8px 0 18px;
}
.up-pl {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 16px 16px 14px;
  border: 1.5px solid var(--rule);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
/* the round mark of a choice, filled on the plan that is picked */
.up-pl::after {
  content: "";
  position: absolute;
  top: 16px;
  right: 16px;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--ink-2);
  border-radius: 50%;
  box-sizing: border-box;
}
.up-pl[aria-checked="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.up-pl[aria-checked="true"]::after {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--paper);
}
.up-pl:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.up-best {
  position: absolute;
  top: -11px;
  left: 14px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent, #fff);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.up-name {
  font-weight: 600;
  padding-right: 24px;
}
.up-price {
  font: 700 1.55rem/1.2 var(--f-display);
  white-space: nowrap;
}
.up-mo {
  color: var(--ink-2);
  font-size: 0.86rem;
}
.up-save {
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--ok, #14734a) 14%, transparent);
  color: var(--ok, #14734a);
  font-size: 0.78rem;
  font-weight: 700;
}
/* who the plan suits and its end date sit at the bottom of every card, so they line up across the row */
.up-good {
  margin-top: auto;
  padding-top: 12px;
  width: 100%;
  display: grid;
  gap: 2px;
  font-size: 0.9rem;
}
.up-good::before {
  content: "";
  display: block;
  border-top: 1px dashed var(--rule);
  margin: 4px 0 8px;
}
.up-until {
  color: var(--ink-2);
  font-size: 0.82rem;
}
.up-pay {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 4px 0 10px;
}
.up-pay .btn {
  min-width: 13rem;
}
.up-pay .acct-hint {
  margin: 0;
  flex: 1 1 14rem;
}
/* on a phone: the cards stack, and only the picked one shows who it suits and when it ends */
@media (max-width: 640px) {
  .acct-dlg.acct-unlock {
    padding: 24px 16px 20px;
  }
  .acct-unlock h2 {
    font-size: 1.3rem;
  }
  .up-cmp {
    font-size: 0.84rem;
  }
  .up-cmp th,
  .up-cmp td {
    padding: 6px 8px;
    line-height: 1.3;
  }
  .up-cmp thead th {
    font-size: 0.8rem;
  }
  .up-plans {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .up-pl:not([aria-checked="true"]) .up-good {
    display: none;
  }
  .up-pay .btn {
    width: 100%;
  }
}
/* the same plan cards on the home page, one a row: name and price on top, the price a month and the saving under
   them; pressing one opens the unlock window with that plan picked */
.up-rows {
  display: grid;
  gap: 14px;
  margin: 8px 0 18px;
}
.up-pl.up-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 2px 12px;
  padding: 14px 16px;
}
.up-pl.up-row::after {
  display: none;
}
.up-row .up-name {
  padding-right: 0;
}
.up-row .up-price {
  font-size: 1.3rem;
  text-align: right;
}
.up-row .up-save {
  justify-self: end;
  margin-top: 2px;
}
.up-pl.up-row:hover {
  border-color: var(--accent);
}
/* Profile → Use offline */
.pf-offact {
  justify-content: flex-start;
  align-items: center;
  margin-top: 10px;
}
.pf-offact .btn {
  min-width: 7rem;
}
.pf-offerr {
  color: #b2402f;
}
/* the note at the bottom of the page while there is no internet */
.nb-offnote {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--ink, #22304a);
  color: var(--surface, #fff);
  font: 600 0.84rem/1.3 var(--f-body, sans-serif);
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}
