.account-main {
  min-height: calc(100vh - 98px);
  padding-block: clamp(2rem, 5vw, 4.5rem) 5rem;
  background-color: #f9f7f3;
  background-image: linear-gradient(#eee8dc 1px, transparent 1px), linear-gradient(90deg, #eee8dc 1px, transparent 1px);
  background-size: 26px 26px;
}

.account-container { max-width: 840px; }
.account-container.is-sign-in { max-width: 460px; }
.account-container h1 { margin-bottom: 1.25rem; font-size: clamp(2.45rem, 5.8vw, 4.25rem); }
.is-sign-in h1 { font-size: clamp(2rem, 4vw, 2.7rem); }
.account-container h2 { margin-bottom: 1rem; font-size: clamp(1.75rem, 4vw, 2.65rem); }
.account-container h3 { margin-bottom: .75rem; }
.account-container h4 { margin-block: .75rem .25rem; }

.account-roles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: #f3f1ec;
}

.account-role {
  min-height: 44px;
  padding: .65rem .75rem;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.4;
}

.account-role:first-child { border-start-start-radius: 9px; }
.account-role:last-child { border-start-end-radius: 9px; }
.account-role[aria-selected="true"] { background: var(--white); color: var(--green); box-shadow: inset 0 3px 0 var(--red); }
.account-role:hover { color: var(--green); }
.account-role:focus-visible { outline-offset: -5px; }

.account-card {
  margin-bottom: 1.1rem;
  padding: clamp(1rem, 4vw, 2rem);
  border: 1px solid #d9d2c3;
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 6px 18px #2638410c;
  overflow-wrap: anywhere;
}

.account-signin-panel { border-color: var(--line); border-top: 0; border-radius: 0 0 10px 10px; }
.account-card p:last-child { margin-bottom: 0; }
.account-card :is(p, ul) { margin-bottom: .85rem; }
.account-card form { max-width: 36rem; }
.account-card form + form { margin-top: .65rem; }
.account-card .button { min-height: 44px; }
.account-switch { margin-top: .9rem; }

.account-field {
  display: grid;
  gap: .25rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.account-field :is(input, select) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: .45rem .65rem;
  border: 1px solid #8b9493;
  border-radius: 5px;
  background: var(--white);
  color: var(--ink);
  font-weight: 400;
}

.account-field input[readonly] { background: var(--paper); }
.account-field span { color: var(--muted); font-size: .875rem; font-weight: 400; }
#change-student-code { display: block; margin-bottom: 1rem; }

.account-notice:not(:empty), .account-error:not(:empty) {
  margin-block: 0 1rem;
  padding: .65rem .9rem;
  border-inline-start: 4px solid;
  border-radius: 4px;
  background: #fff4cc;
  overflow-wrap: anywhere;
}

.account-error:not(:empty) { background: #fae9e7; color: #772a23; }
.account-session { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .4rem 1rem; }
.account-session p { margin-bottom: .7rem; overflow-wrap: anywhere; }
.account-disclosure summary { color: var(--green); cursor: pointer; font-weight: 600; }
.account-disclosure form { margin-top: .65rem; }
.account-disclosure:not(:first-child) { margin-top: 1rem; }
.account-stack:empty { display: none; }
.account-stack .account-card + .account-card { margin-top: 1rem; }

.account-records { padding: 0; list-style: none; }
.account-records li { display: flex; flex-wrap: wrap; gap: .3rem .7rem; padding-block: .35rem; border-bottom: 1px solid var(--line); }
.account-records code, #mfa-secret { font-size: .95rem; font-weight: 700; overflow-wrap: anywhere; }
.account-records small { color: var(--muted); }
.account-rounds li { align-items: baseline; justify-content: space-between; }
.account-rounds li > span { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .65rem; }
.account-rounds:empty { display: none; }
.account-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.account-actions .text-link { padding-block: .6rem; }
[aria-busy="true"] button { opacity: .65; }

@media (max-width: 620px) {
  .account-header { min-height: 70px; gap: .7rem; }
  .account-header .brand img { width: min(41vw, 185px); }
  .account-header .text-link { text-align: end; }
}

.account-closed { margin: 0; line-height: 1.6; }
.account-note { margin: 0 0 16px; line-height: 1.6; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.account-summary { font-weight: 600; }
.account-buy { margin-block: 1rem 1.25rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 10px; background: #faf8f4; }
.account-buy h4 { margin-top: 0; }
.account-buy-form { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: flex-end; }
.account-buy-form .account-field { margin: 0; max-width: 12rem; }
.account-card textarea { width: 100%; font: inherit; padding: .6rem .7rem; border: 1px solid #b9c2c6; border-radius: 8px; }
.account-tabs { grid-template-columns: repeat(var(--tab-count, 3), minmax(0, 1fr)); }
.account-tab-panel { border-top: 0; border-radius: 0 0 12px 12px; }
.account-tab-panel > section + section { margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.account-tab-count { display: inline-block; min-width: 1.4em; margin-inline-start: .35em; padding: 0 .4em; border-radius: 999px; background: var(--red); color: var(--white); font-size: .75rem; line-height: 1.4; }
.account-class-tools { margin-top: .6rem; }
.account-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-start; margin-bottom: 1rem; }
.account-actions form { margin: 0 !important; }
.account-person { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding-block: .5rem; border-bottom: 1px solid var(--line); }
.account-person:last-child { border-bottom: 0; }
.account-table-wrap { overflow-x: auto; margin-top: .6rem; }
.account-results { width: 100%; border-collapse: collapse; font-size: .9rem; }
.account-results :is(th, td) { padding: .45rem .6rem; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; }
.account-results thead th { color: var(--muted); font-weight: 600; }
.account-results td.score { text-align: end; font-variant-numeric: tabular-nums; }
.account-results th.score { text-align: end; }
.account-qr { display: block; width: 200px; height: 200px; margin: 8px 0 16px; background: #fff; padding: 8px; border-radius: 8px; }

.account-matches { margin: .4rem 0 1rem; padding: 0; list-style: none; }
.account-matches li + li { border-top: 1px solid var(--line); }
.account-matches button { width: 100%; padding: .55rem .2rem; border: 0; background: none; color: var(--green); font: inherit; font-weight: 600; text-align: start; cursor: pointer; }
.account-matches button small { display: block; color: var(--muted); font-weight: 400; }
.account-matches button:hover { text-decoration: underline; }
.account-badge { display: inline-block; margin-inline-start: .4rem; padding: 0 .45em; border-radius: 999px; background: #eef2f3; color: var(--muted); font-size: .75rem; font-weight: 600; }

#founder-tabs { --tab-count: 4; }
.account-container:not(.is-sign-in) :is(.account-notice, .account-error):not(:empty) { position: sticky; top: 1rem; z-index: 5; box-shadow: 0 6px 18px #2638411f; }
.account-ok { color: #2f6b3b; }
.account-warn { color: #8a4b12; }
.account-student-tools summary { font-weight: 600; font-size: .85rem; }
.account-student-tools[open] { min-width: 16rem; }
.account-student-tools form { margin-top: .5rem; }
.account-questions { display: grid; gap: 1rem; margin-top: .8rem; }
.account-question { padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.account-question h5 { margin: 0 0 .5rem; font-size: 1rem; }
.account-figure { max-width: 22rem; margin-block: .6rem; }
.account-figure svg { max-width: 100%; height: auto; }
.account-help { margin-top: 1rem; }
.account-help summary { font-size: 1.05rem; }
.account-help h4 { margin-top: 1rem; }
.account-next { margin-top: 1rem; }
