/* ==========================================================================
   Account surface — Configure/Inspect, deliberately NOT in the exam rail.
   The rail is an Operate surface for running an exam; identity, plan and
   billing belong to their own panel so neither competes with the other.
   ========================================================================== */

/* ---------- top bar: one control, state-carrying ---------- */

.acct-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 10px 0 4px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font: inherit; font-size: 12.5px;
  cursor: pointer;
  transition: border-color .14s, background .14s, color .14s;
}
.acct-chip:hover { border-color: var(--line-hi); color: var(--ink-1); background: var(--sheen-1); }
.acct-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.acct-avatar {
  display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 999px;
  background: var(--sheen-2);
  color: var(--ink-2);
  font-size: 11px; font-weight: 560; text-transform: uppercase;
  letter-spacing: 0;
}
.acct-chip.is-paid .acct-avatar { background: rgba(16,185,129,.16); color: #34d399; }

.acct-chip-label {
  max-width: 128px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- account panel ---------- */

/* A popover, not a modal: the scrim only needs to catch the outside click, so it
   stays nearly invisible. A dark blurred overlay would obscure the exam behind
   it for no reason and is exactly the unearned-blur decoration to avoid. */
.sheet-scrim {
  position: fixed; inset: 0; z-index: 60;
  background: transparent;
}

.sheet {
  position: fixed; z-index: 61;
  top: 52px; right: 14px; width: 332px;
  max-height: calc(100vh - 70px); overflow-y: auto;
  background: var(--surface-1);
  border: 1px solid var(--line-hi);
  border-radius: 12px;
  box-shadow: 0 18px 48px -12px rgba(0,0,0,.7);
  padding: 4px;
}

/* Identity block: the only place the email is shown. */
.sheet-id {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 12px 12px 10px;
}
.sheet-id .acct-avatar { width: 32px; height: 32px; font-size: 13px; }
.sheet-id-text { min-width: 0; }
.sheet-email {
  display: block; font-size: 13px; color: var(--ink-1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sheet-sub { display: block; margin-top: 2px; font-size: 11.5px; color: var(--ink-4); }

.sheet-rule { height: 1px; margin: 2px 0; background: var(--line); }

/* Plan status: a fact, not a card. */
.sheet-plan { padding: 10px 12px 12px; }
.sheet-plan-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.sheet-plan-name { font-size: 13px; color: var(--ink-1); font-weight: 510; }
.sheet-plan-state {
  font-size: 11px; letter-spacing: .02em;
  padding: 2px 7px; border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-3);
}
.sheet-plan-state.is-on {
  border-color: rgba(16,185,129,.30);
  background: rgba(16,185,129,.10);
  color: #34d399;
}
.sheet-plan-state.is-warn {
  border-color: rgba(245,158,11,.30);
  background: rgba(245,158,11,.10);
  color: #fbbf24;
}
/* The expiry date is the fact a paying customer actually looks for, so give it
   emphasis rather than letting it sit at the same weight as the question count. */
.sheet-plan-meta {
  margin-top: 6px; font-size: 12px; color: var(--ink-4); line-height: 1.55;
}
.sheet-plan-meta b { color: var(--ink-1); font-weight: 560; }
.sheet-plan-meta .mono {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12.5px; color: var(--ink-1); font-weight: 500;
}

/* Rows: quiet by default. Weight is expressed by ONE primary action only. */
.sheet-rows { padding: 4px; }
.sheet-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 8px; border: 0; border-radius: 7px;
  background: transparent; color: var(--ink-2);
  font: inherit; font-size: 13px; text-align: left; text-decoration: none;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.sheet-row:hover { background: var(--sheen-1); color: var(--ink-1); }
.sheet-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sheet-row-note { margin-left: auto; font-size: 11.5px; color: var(--ink-4); }
.sheet-row.is-quiet { color: var(--ink-4); }
.sheet-row.is-quiet:hover { color: var(--ink-2); }
.sheet-row[disabled] { opacity: .5; cursor: default; }
.sheet-row[disabled]:hover { background: transparent; color: var(--ink-2); }

.sheet-cta { padding: 4px 8px 10px; }

/* Inline confirmation replaces the row instead of stacking another button. */
.sheet-confirm {
  margin: 2px 8px 8px; padding: 10px;
  background: var(--sheen-1);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.sheet-confirm p { margin: 0 0 9px; font-size: 12px; color: var(--ink-3); line-height: 1.6; }
.sheet-confirm-actions { display: flex; gap: 6px; }
.sheet-confirm-actions .btn { flex: 1; height: 30px; font-size: 12.5px; }

.sheet-msg {
  margin: 0 8px 8px; padding: 9px 10px;
  font-size: 12px; line-height: 1.55;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--sheen-1);
  color: var(--ink-3);
}
.sheet-msg.is-ok {
  border-color: rgba(16,185,129,.28);
  background: rgba(16,185,129,.09);
  color: #6ee7b7;
}

@media (max-width: 560px) {
  .sheet {
    top: auto; bottom: 0; right: 0; left: 0;
    width: auto; max-height: 82vh;
    border-radius: 14px 14px 0 0;
  }
}
