/* v2 pages: My words, review, progress, settings, sign-up and sign-in (js/v2-account.js).
   Only these pages' own rules; the shared pieces are in css/v2-base.css. Tokens only. */

/* a narrow column for one-task pages (review, settings, sign-in) */
.acct-narrow { max-width: 560px; margin: 0 auto; }
.acct-h2 { margin: 24px 0 10px; font-size: 20px; font-weight: 700; }
.acct-num { font-size: 24px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.acct-hidden-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.acct-btn-52 { min-height: 52px; }

/* the bottom bar on wide screens: its buttons keep to the page's column */
body.acct-bar .acct-bottom { padding-left: max(16px, calc((100% - 560px) / 2)); padding-right: max(16px, calc((100% - 560px) / 2)); }
/* (a fixed bar's percentages count the whole window; beside the 240 px side menu, take it off) */
@media (min-width: 1100px) {
  body.acct-bar .acct-bottom { padding-left: max(16px, calc((100% - 800px) / 2)); padding-right: max(16px, calc((100% - 800px) / 2)); }
}
.acct-bottom .btn:not(.btn-primary) { background: var(--paper-deep); }
.acct-bottom .btn:not(.btn-primary):hover { background: var(--fill-h); }
.acct-bottom .btn.btn-quiet { background: transparent; }
.acct-bottom .btn-primary { min-height: 56px; font-size: 17px; }
/* the toast stays above the bottom bar */
body.acct-bar .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }

/* ---------- My words ---------- */
.acct-nb { max-width: 760px; }
.acct-titlerow { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.acct-titlerow h1 { flex: 1; min-width: 0; margin: 0; font-size: 26px; font-weight: 800; }
.acct-review-btn { min-height: 44px; padding: 0 18px; }
.acct-search {
  display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 16px; margin-bottom: 12px;
  border-radius: var(--radius-c); background: var(--card); color: var(--ink-soft);
}
.acct-search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 16px; color: var(--ink); outline: none; }
.acct-search:focus-within { box-shadow: inset 0 0 0 2px var(--blue); }
.acct-nb-tabs { margin-bottom: 4px; }
.acct-chips { margin: 12px 0; }
.acct-nb-list { margin-top: 4px; }
.acct-none { padding: 12px 4px; }
.acct-group { min-height: 56px; cursor: pointer; }
.acct-group-title {
  flex: 1; min-width: 0; font-weight: 700; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.acct-more { justify-content: center; color: var(--ink-soft); font-size: 13px; font-weight: 600; cursor: pointer; }
.acct-row { align-items: center; }
.acct-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.acct-row-term { font-size: 17px; font-weight: 600; line-height: 1.3; }
.acct-row-line { font-size: 16px; font-weight: 600; line-height: 1.4; }
.acct-row-zh {
  color: var(--ink-soft); font-size: 14px; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.acct-row .phonetic { font-size: 13px; }
.acct-row-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.acct-rowbtn, .acct-row .icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink-soft);
}
.acct-rowbtn:hover, .acct-row .icon-btn:hover { background: var(--paper-deep); color: var(--ink); }
.acct-row .icon-btn.is-playing { background: var(--ink); color: var(--on-ink); }
.acct-tickrow { cursor: pointer; }
.acct-tickrow:hover { background: var(--rule-soft); }
.acct-tickrow:focus-visible { outline-offset: -3px; }

/* a small flat tag: kind (blue), 难词, 不再复习 */
.acct-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--paper); color: var(--ink-soft); white-space: nowrap; }
.acct-tag.acct-kind { background: var(--blue-soft); color: var(--blue); }
.acct-tag.acct-hard { background: var(--wrong-soft); color: var(--wrong); }
.acct-tag.acct-cut { background: var(--paper); color: var(--ink-soft); }

/* the state dot: empty new, half-filled learning, filled known */
.acct-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; border: 1.5px solid var(--ink-soft); }
.acct-dot-learning { border-color: var(--gold); background: linear-gradient(90deg, var(--gold) 50%, transparent 50%); }
.acct-dot-known { border-color: var(--green); background: var(--green); }

/* select mode's tools */
.acct-tool { width: 64px; }
.acct-tool-red { color: var(--red-text); }

/* ---------- review ---------- */
.acct-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px 24px; text-align: center; }
.acct-big { font-size: 72px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.acct-hero-line { margin: 0; color: var(--ink-soft); font-size: 15px; }
.acct-hero .v2-meta { margin: 0; max-width: 420px; }
.acct-tiles3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.acct-stack { display: flex; flex-direction: column; gap: 8px; padding-top: 20px; }
.acct-stack .btn-primary { min-height: 56px; font-size: 17px; }
.acct-pick .chip { background: var(--paper); }
.acct-pick .chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.acct-pick .select { background: var(--paper); }
.acct-pick #pickPanel { padding: 0; border-top: 0; }
.acct-pick .pick-row > *, .acct-pick .pick-selects { min-width: 0; }
.acct-pick .pick-selects .select { width: 100%; }
.acct-pick .chips-scroll { margin-right: -16px; padding-right: 16px; }

/* a card: the top row, the card filling the screen, the bar below */
.acct-cardtop { display: flex; align-items: center; gap: 12px; margin: -8px -4px 8px -12px; min-height: 52px; }
.acct-cardtop .bar { flex: 1; margin: 0; }
.acct-count { color: var(--ink-soft); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acct-zhan {
  display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 12px; flex: none;
  border: 0; border-radius: 999px; background: var(--card); color: var(--ink-soft); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.acct-zhan svg { width: 16px; height: 16px; }
.acct-zhan:hover { color: var(--ink); background: var(--paper-deep); }
.review-card.acct-card {
  max-width: none; margin: 0; padding: 24px 16px; gap: 16px; justify-content: center;
  min-height: calc(100vh - 260px); min-height: calc(100dvh - 260px); border-radius: var(--radius);
}
.acct-card.acct-card-back { justify-content: flex-start; gap: 12px; }
.acct-term { margin: 0; font-size: 32px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.acct-term-back { font-size: 30px; }
.acct-meaning { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.4; }
.acct-meaning-small { font-size: 16px; color: var(--ink-soft); }
.acct-tagrow { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.acct-sound, .acct-card .word-sound-big {
  display: grid; place-items: center; width: 60px; height: 60px; padding: 0; border: 0; border-radius: 50%;
  background: var(--paper-deep); color: var(--ink);
}
.acct-sound svg, .acct-card .word-sound-big svg { width: 24px; height: 24px; }
.acct-sound:hover, .acct-card .word-sound-big:hover { background: var(--fill-h); }
.acct-card .word-sound-big.is-playing { background: var(--ink); color: var(--on-ink); }
.acct-example { align-self: stretch; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border-radius: var(--radius-m); background: var(--paper); text-align: left; border: 0; }
.acct-ex-en { margin: 0; font-weight: 600; line-height: 1.5; }
.acct-ex-zh { margin: 0; color: var(--ink-soft); font-size: 14px; }
.acct-play {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; margin-top: 2px;
  border: 0; border-radius: 999px; background: var(--card); color: var(--ink); font-size: 14px; font-weight: 600;
}
.acct-play svg { width: 14px; height: 14px; fill: currentColor; }
.acct-play:hover { background: var(--fill-h); }
.acct-answer { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.acct-card textarea { width: 100%; min-height: 92px; padding: 12px 14px; border: 0; border-radius: var(--radius-m); background: var(--paper); font: inherit; font-size: 17px; color: var(--ink); resize: vertical; }
.acct-card textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; }
.acct-card .spell-field { background: var(--paper); }
.acct-card > .v2-meta { margin: 0; }

/* the three grades */
.v2-actions.acct-grades { display: flex; margin: 0; width: auto; }
.acct-grade {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 68px; padding: 6px 4px;
  border: 0; border-radius: 18px; font-size: 17px; font-weight: 700; line-height: 1.2;
}
.acct-grade small { margin: 0; font-size: 12px; font-weight: 500; color: inherit; }
.acct-grade[data-grade="1"] { background: var(--wrong-soft); color: var(--wrong); }
.acct-grade[data-grade="2"] { background: var(--gold-soft); color: var(--gold); }
.acct-grade[data-grade="3"] { background: var(--green-soft); color: var(--green); }
.acct-grade:hover { filter: brightness(.97); }

/* the end of a round */
.acct-narrow .popfox { height: 262px; margin-top: 8px; }
.acct-narrow .popfox img { height: 286px; }
.acct-end { margin-top: -34px; padding: 20px 12px 12px; border-radius: var(--radius); background: var(--card); }
.acct-end h1 { margin: 0 0 14px; text-align: center; font-size: 26px; font-weight: 800; }
.acct-end .v2-tile { background: var(--paper); }
.acct-end .v2-tile span { font-size: 13px; font-weight: 600; }
.acct-ok span, .acct-ok b { color: var(--green); }
.acct-close span, .acct-close b { color: var(--gold); }
.acct-wrong span, .acct-wrong b { color: var(--wrong); }
.acct-end + .acct-h2, .acct-narrow > .acct-h2 { margin-top: 24px; }
.acct-narrow > .v2-list .acct-row-term { font-weight: 600; }

/* ---------- progress ---------- */
.acct-progress { max-width: 760px; display: flex; flex-direction: column; gap: 12px; }
.acct-progress .acct-h2 { margin: 12px 0 -2px; }
.acct-pcard { display: flex; flex-direction: column; gap: 16px; padding: 18px; border-radius: var(--radius); background: var(--card); }
.acct-pcard h3 { margin: 0; font-size: 16px; font-weight: 600; }
.acct-streak-row { display: flex; align-items: center; gap: 8px; }
.acct-streak-row .flame { width: 28px; height: 28px; color: var(--flame); }
.acct-streak-days { flex: 1; font-size: 30px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.acct-week { list-style: none; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 0; padding: 0; }
.acct-week-day { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.acct-week-name { font-size: 13px; color: var(--ink-soft); }
.acct-week-day.acct-today .acct-week-name { color: var(--ink); font-weight: 700; }
.acct-week-dot { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--paper); color: #fff; }
.acct-week-day.acct-done .acct-week-dot { background: var(--green); color: var(--card); }
.acct-week-dot svg { width: 16px; height: 16px; stroke-width: 3; }
.acct-tiles4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 760px) { .acct-tiles4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.acct-forecast { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: end; height: 120px; }
.acct-fc-day { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.acct-fc-bar { width: 100%; max-width: 32px; border-radius: 6px; background: var(--caramel); }
.acct-fc-day.acct-today .acct-fc-bar { background: var(--band); }
html.night .acct-fc-day.acct-today .acct-fc-bar { background: var(--ink); }   /* the dark band would vanish on a night card */
.acct-fc-name { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.acct-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; max-width: 420px; }
.acct-day { aspect-ratio: 1; border-radius: 8px; background: var(--paper); }
.acct-day-1 { background: var(--heat-1); }
.acct-day-2 { background: var(--heat-2); }
.acct-day-3 { background: var(--heat-3); }
.acct-film-row .bar { margin: 6px 0 2px; }
.acct-film-title { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.acct-settings-link { margin-top: 12px; }
.acct-settings-link .v2-chev:first-child { color: var(--ink-soft); }

/* ---------- settings ---------- */
.acct-settings { padding-bottom: 24px; }
.acct-avatar { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--ink); color: var(--on-ink); font-weight: 700; font-size: 17px; }
.acct-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-set-row { cursor: pointer; font-size: 16px; }
.acct-seg-row { flex-wrap: wrap; row-gap: 8px; }
.acct-seg-row .v2-seg { flex: none; }
.acct-last { margin-top: 20px; }
.acct-last button.v2-li { cursor: pointer; font-size: 16px; }
.acct-danger { color: var(--red-text); }
.acct-radios { background: var(--paper); }
.acct-radio-row { cursor: pointer; font-size: 16px; }
.acct-radio-row[aria-checked="false"] .v2-radio { border-color: var(--line-strong); }
.v2-sheet-body > .v2-meta { margin: 0; }

/* ---------- the top bar's account area ---------- */
.acct-head { display: flex; align-items: center; gap: 8px; }
.acct-signup, .acct-login {
  display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 16px;
  border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.acct-signup { background: var(--ink); color: var(--on-ink); }
.acct-login { color: var(--ink); }
.acct-login:hover { background: var(--paper-deep); }
.acct-gear { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--card); color: var(--ink); }
.acct-gear svg { width: 18px; height: 18px; }
.acct-login, .acct-gear { display: none; }
@media (min-width: 760px) { .acct-login { display: inline-flex; } .acct-gear { display: grid; } }
@media (min-width: 1100px) {
  .acct-head { flex-wrap: wrap; }
  .acct-signup, .acct-login { flex: 1; min-height: 44px; }
  .acct-login { background: var(--card); }
  .acct-gear { order: 3; width: 100%; height: 40px; border-radius: 999px; }
}

/* ---------- sign-up and sign-in ---------- */
.acct-signin { max-width: 440px; }
.acct-signin-tabs { margin-bottom: 20px; }
.acct-form { display: flex; flex-direction: column; gap: 16px; }
.acct-form-head { display: flex; flex-direction: column; gap: 4px; }
.acct-form-head h1 { margin: 0; font-size: 26px; font-weight: 800; }
.acct-sub { margin: 0; color: var(--ink-soft); font-size: 15px; overflow-wrap: anywhere; }
.acct-sub b { color: var(--ink); font-weight: 600; }
.acct-link { color: var(--blue); font-weight: 600; }
.acct-field { display: flex; flex-direction: column; gap: 8px; }
.acct-label { font-weight: 600; }
.acct-input { width: 100%; min-height: 54px; padding: 0 16px; border: 0; border-radius: var(--radius-c); background: var(--card); font: inherit; font-size: 17px; color: var(--ink); }
.acct-input:focus { outline: 2px solid var(--blue); outline-offset: 0; }
.acct-input::placeholder { color: var(--ink-faint); }
.acct-fix { align-self: flex-start; min-height: 44px; padding: 0 14px; margin-top: -8px; border: 0; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 14px; font-weight: 600; }
.acct-consent { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.acct-consent input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; }
.acct-consent input:checked + .v2-check { background: var(--ink); border-color: var(--ink); }
.acct-consent input:checked + .v2-check svg { visibility: visible; }
.acct-consent input:focus-visible + .v2-check { outline: 3px solid var(--focus); outline-offset: 2px; }
.acct-consent-text { color: var(--ink-soft); font-size: 14px; }
.acct-consent-text a { color: var(--blue); }
.acct-crossborder { margin: -10px 0 0 34px; font-size: 12px; line-height: 1.5; color: var(--ink-faint); }
.acct-error { margin: -8px 0 0; min-height: 20px; color: var(--red-text); font-size: 14px; }
.acct-error:empty { min-height: 0; margin: 0; }
.acct-send { min-height: 56px; font-size: 17px; }
.acct-boxes { position: relative; display: block; cursor: text; }
.acct-boxes input {
  position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; padding: 0; border: 0; background: transparent;
  color: transparent; caret-color: transparent; font-size: 16px; outline: none;
}
.acct-boxes input::selection { background: transparent; }
.acct-boxes .v2-box6 span { color: var(--ink); }
.acct-paste { align-self: flex-start; }
.acct-help { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; border-radius: var(--radius-m); background: var(--card); }
.acct-help .v2-meta { font-size: 14px; }
.acct-help .btn { background: var(--paper-deep); }
.acct-help .btn:disabled { opacity: .6; }

/* the toast over a bar: one line where it fits, Undo never broken */
body.acct-bar .toast { width: max-content; }
body.acct-bar .toast .toast-undo { flex: none; white-space: nowrap; }

/* signed in: the avatar is a dark round button with the initial, as the design draws it */
.account-avatar { background: var(--ink); color: var(--on-ink); }

/* the page footer stays out from under the bar */
body.acct-bar .foot { display: none; }
