/* Account block (ac-): the sign-in sheet, the account page, the header menu. Tokens only; phone breakpoint 720. */

/* buttons that wait: the spinner and the verb come in with aria-busy */
.ac .k-btn .k-spin, .ac .ac-t-busy { display: none; }
.ac .k-btn[aria-busy="true"] .k-spin { display: inline-block; }
.ac .k-btn[aria-busy="true"] .ac-t-idle { display: none; }
.ac .k-btn[aria-busy="true"] .ac-t-busy { display: inline; }
.ac .k-err:empty, .ac .k-alert:empty { display: none; }
.ac .k-err:not(:empty) { animation: k-fade var(--d) ease; }
.ac-title { font-size: var(--t-h1); line-height: 1.1; letter-spacing: -0.02em; }
.ac-lead { color: var(--muted); font-size: 17px; max-width: 46ch; }
.ac-link { min-height: 44px; display: inline-flex; align-items: center; padding: 0; border: 0; background: none; color: var(--brand); font-weight: 600; font-size: 15px;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: color-mix(in srgb, var(--brand) 40%, transparent); transition: text-decoration-color var(--d-fast) ease; }

/* ---- sign-in sheet --------------------------------------------------------------------------------------------------- */
.ac-wrap { max-width: 488px; }
.ac-sheet { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(24px, 4vw, 40px); display: grid; gap: 24px; }
.ac-head { display: grid; gap: 10px; }
.ac-steps { display: grid; gap: 16px; }
.ac-pane, .ac-done { display: none; gap: 16px; min-width: 0; }
/* one step shows at a time (data-step on the section); Google sits above the sign-in and sign-up forms and stays put between them */
.ac[data-step="signin"] [data-pane~="signin"], .ac[data-step="signup"] [data-pane~="signup"], .ac[data-step="forgot"] [data-pane~="forgot"],
.ac[data-step="check"] [data-pane~="check"], .ac[data-step="done"] .ac-done { display: grid; }
.ac[data-step] .ac-pane:not(.ac-alt), .ac[data-step] .ac-done { animation: k-in var(--d-tick) var(--ease) backwards; }
.ac-google { width: 100%; }
.ac-g { flex: none; }
.ac-or { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 14px; margin: 2px 0; }
.ac-or::before, .ac-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.ac-ask { display: grid; gap: 16px; }
.ac-signin-go, .ac-signup-go, .ac-forgot-go { width: 100%; }
.ac-sent { outline: none; max-width: 44ch; overflow-wrap: anywhere; font-size: 17px; }

/* a password field: the Show / Hide button sits inside the input's right edge (the script reveals it) */
.ac-pw { position: relative; display: flex; }
.k-field .ac-pw input { flex: 1; width: 100%; padding-right: 76px; }
.ac-show { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); min-width: 60px; min-height: 44px; padding: 0 14px; border: 0; border-radius: var(--radius-sm); background: none;
  color: var(--brand); font-weight: 600; font-size: 15px; transition: background-color var(--d-fast) ease; }
.ac-links, .ac-swap { margin: 0; font-size: 15px; color: var(--muted); }
.ac-links + .ac-swap { margin-top: -10px; }
.ac-swap { display: flex; flex-wrap: wrap; align-items: center; column-gap: .4em; }

/* the authored moment: the sheet settles on the spring and the done panel takes over, then the page hands over */
.ac[data-step="done"] .ac-sheet { opacity: 1; transform: none; animation: ac-settle var(--d-spring) var(--spring); } /* replaces k-in, so it must also hold the end state */
.ac-done { grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 20px; outline: none; }
.ac-done .k-mark { margin: 10px; }
.ac-done-t { font-size: clamp(24px, 3vw, 28px); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.ac-done-p { color: var(--muted); margin-top: 4px; }
.ac-go { margin-top: 2px; }

.ac-status { display: grid; gap: 8px; }
/* an empty live region stays in the accessibility tree (a screen reader misses the first message if it appears with the region), so it only collapses */
.ac-status:has(> :empty) { gap: 0; }
.ac .ac-status > .k-alert:empty { display: block; height: 0; margin: 0; padding: 0; border: 0; overflow: hidden; }
.ac-fine { font-size: 14px; color: var(--muted); max-width: 52ch; }
.ac-fine a { color: inherit; text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); }

/* ---- account page ---------------------------------------------------------------------------------------------------- */
.ac-page { display: grid; gap: clamp(28px, 4vw, 40px); }
.ac-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.ac-top-t { display: grid; gap: 8px; min-width: 0; }
.ac-as { color: var(--muted); overflow-wrap: anywhere; }
.ac-as strong { color: var(--ink); font-weight: 600; }
.ac-wait, .ac-gate, .ac-fail, .ac-gone, .ac-body { display: none; }
.ac[data-state="loading"] .ac-wait { display: grid; }
.ac[data-state="out"] .ac-gate, .ac[data-state="deleted"] .ac-gone { display: grid; }
.ac[data-state="error"] .ac-fail { display: block; }
.ac[data-state="ready"] .ac-body { display: grid; }
.ac[data-state="out"] .ac-out, .ac[data-state="deleted"] .ac-out, .ac[data-state="deleted"] .ac-as { display: none; }
.ac-wait { gap: 12px; color: var(--muted); min-height: 120px; }
@media (scripting: none) { .ac-wait { display: none !important; } }
.ac-gate, .ac-gone { justify-items: start; gap: 12px; max-width: 520px; padding: 8px 0 24px; animation: k-in var(--d-enter) var(--ease) backwards; }
.ac-gate-i { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 4px; }
.ac-gate-p { color: var(--muted); max-width: 46ch; }
.ac-gate-b, .ac-gone .k-btn { margin-top: 8px; }
.ac-gone .k-mark { margin: 10px 10px 14px; }
.ac-gone .ac-part-t { outline: none; }

/* the shell: the section nav (chips on a phone, a left column from 900 px) beside the open section */
.ac-body { grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.ac-stage { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.ac-panel[hidden] { display: none; }
.ac-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; align-content: start; animation: k-in var(--d-tick) var(--ease) backwards; }
.ac-panel > .ac-part-t { outline: none; scroll-margin-top: calc(var(--header-h, 0px) + 12px); }
.ac-nav { min-width: 0; margin: 0 calc(var(--pad) * -1); }
.ac-nav ul { list-style: none; margin: 0; padding: 2px var(--pad); display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; scroll-padding: 0 var(--pad); }
.ac-nav ul::-webkit-scrollbar { display: none; }
.ac-nav li { flex: none; } /* Safari shrank each item below its pill's width, so labels ran into the border and the badge was cut off */
.ac-nav li[hidden] { display: none; }
.ac-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 600; font-size: 15px;
  text-decoration: none; white-space: nowrap; box-shadow: inset 0 0 0 1px var(--line); transition: background-color var(--d-fast) ease, color var(--d-fast) ease; }
.ac-chip svg { color: var(--brand); flex: none; }
.ac-chip[aria-current] { background: var(--brand); color: var(--on-brand); box-shadow: none; }
.ac-chip[aria-current] svg { color: inherit; }
.ac-chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ac-badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 700; }
.ac-badge[hidden] { display: none; }
.ac-chip[aria-current] .ac-badge { background: var(--on-brand); color: var(--brand); }
.ac-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; min-width: 0; }
@media (min-width: 900px) {
  .ac-body { grid-template-columns: 240px minmax(0, 1fr); column-gap: clamp(32px, 4vw, 56px); }
  .ac-nav { margin: 0; position: sticky; top: calc(var(--header-h, 0px) + 24px); }
  .ac-nav ul { flex-direction: column; overflow: visible; padding: 0; }
  .ac-chip { width: 100%; border-radius: var(--radius-sm); }
  .ac-chip .ac-badge { margin-left: auto; }
}

/* Home */
.ac-top .ac-av-lg { width: 56px; height: 56px; font-size: 24px; flex: none; }
.ac-out .k-btn { white-space: nowrap; }
.ac-rows .ac-row:first-child { border-top: 0; padding-top: 0; }
.ac-top { align-items: center; }
.ac-top-t { flex: 1 1 auto; }
.ac-hello { overflow-wrap: anywhere; font-size: clamp(22px, 3vw, 28px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.ac-view { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.ac-sub { font-size: 16px; font-weight: 700; }
.ac-needs { display: grid; gap: 8px; }
.ac-needs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ac-need { display: flex; align-items: center; min-height: 44px; padding: 10px 16px; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--ink); font-weight: 600; text-decoration: none; }
.ac-need:focus-visible, .ac-tile:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ac-tiles { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.ac-tile { display: grid; gap: 4px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; min-width: 0; }
.ac-tile-k { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: none; }
.ac-tile-t { font-size: 18px; overflow-wrap: anywhere; }
.ac-tile-s { font-size: 14px; color: var(--muted); }
.ac-tile-top { background: var(--brand); color: var(--on-brand); }
.ac-tile-top .ac-tile-k, .ac-tile-top .ac-tile-s { color: inherit; opacity: .85; }
@media (min-width: 900px) { .ac-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ac-tile-top { grid-column: 1 / -1; } }
.ac-part-t { font-size: var(--t-h3); line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
.ac-part-lead { color: var(--muted); font-size: 15px; max-width: 60ch; }
.ac-part-err { color: var(--danger); }

/* profile: a ruled ledger on the one card, each row edits in place */
.ac-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(20px, 3vw, 28px); display: grid; gap: 10px; min-width: 0; }
.ac-rows { display: grid; }
.ac-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line); }
.ac-row:last-child { padding-bottom: 0; }
.ac-row-main { display: grid; gap: 2px; min-width: 0; }
.ac-key { font-size: 14px; font-weight: 500; color: var(--muted); }
.ac-val { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; white-space: pre-line; }
.ac-val[data-empty] { color: var(--muted); font-weight: 400; }
.ac-hint { font-size: 13px; color: var(--muted); margin-top: 2px; }
.ac-row[data-open] .ac-val { display: none; }
.ac-edit { min-height: 44px; padding: 0 12px; margin: -6px -12px 0 0; border: 0; border-radius: var(--radius-sm); background: none; color: var(--brand); font-weight: 600; font-size: 15px;
  display: inline-flex; align-items: center; gap: 6px; transition: background-color var(--d-fast) ease, color var(--d-fast) ease; }
.ac-row[data-open] .ac-edit { color: var(--muted); }
.ac-edit-form { grid-column: 1 / -1; display: grid; gap: 10px; animation: k-in var(--d-tick) var(--ease) backwards; }
.ac-edit-form .k-field textarea { min-height: 96px; }
.ac-edit-act { display: flex; flex-wrap: wrap; gap: 8px; }

/* delete: quiet until asked, then a confirm block that says plainly what goes */
.ac-danger { display: grid; gap: 12px; justify-items: start; }
.ac-del { color: var(--danger); }
.ac-confirm { display: none; gap: 12px; width: 100%; padding: 20px; border-radius: var(--radius-sm); background: var(--danger-soft); }
.ac-danger:not([data-del="idle"]) .ac-confirm { display: grid; animation: k-in var(--d-tick) var(--ease) backwards; }
.ac-danger:not([data-del="idle"]) .ac-del { display: none; }
.ac-confirm-t { font-size: 18px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; color: var(--danger); outline: none; }
.ac-confirm p { font-size: 15px; }
.ac-confirm .k-alert { background: var(--surface); }
.ac-confirm-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ac-confirm-act .k-btn { flex: 1 1 auto; }
.ac-del-yes { background: var(--danger); color: var(--surface); }

/* ---- header menu ----------------------------------------------------------------------------------------------------- */
.ac[data-variant="menu"] { padding: 4px 0; }
.ac-bar { display: flex; justify-content: flex-end; align-items: center; min-height: 52px; }
.ac[data-slotted] { padding: 0; }
.ac[data-slotted] .ac-bar { min-height: 0; padding: 0; margin: 0; } /* inside the shell header, beside the theme switch */
/* in the header it is one 44px icon at every width, like the theme switch: a person outline signed out, the initial signed
   in; the words stay for screen readers, and the name and the arrow are in the menu it opens, not the bar */
.ac[data-slotted] .ac-in span, .ac[data-slotted] .ac-me-n { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ac[data-slotted] .ac-chev { display: none; }
.ac[data-slotted] :is(.ac-in, .ac-me) { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 50%; }
.ac[data-slotted] .ac-in svg { color: var(--ink); }
.ac[data-slotted] .ac-av { width: 30px; height: 30px; font-size: 14px; }
/* with JS and a header, the menu waits for its place in the header instead of showing a row under it first */
html[data-sh-js]:has(.sh-acts) .ac[data-variant="menu"]:not([data-slotted]) { display: none; }
/* its choices in the phone menu (signin.js mountMenu): styled like the shell's links there; the header icon covers wider screens */
.sh-links .ac-li form { display: contents; }
.sh-links .ac-li button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; }
@media (min-width: 721px) { .sh-links .ac-li { display: none; } }
.ac-in { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 6px; color: var(--ink); font-weight: 600; font-size: 15px; text-decoration: none; border-radius: var(--radius-sm); transition: color var(--d-fast) ease; }
.ac-in svg { color: var(--brand); }
.ac-who { position: relative; }
.ac-me { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 12px 4px 4px; border: 0; border-radius: 999px; background: transparent; font-weight: 600; font-size: 15px; transition: background-color var(--d-fast) ease; }
.ac-av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 15px; }
.ac-me-n { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-chev { color: var(--muted); transform: rotate(90deg); transition: transform var(--d) var(--ease); }
.ac-me[aria-expanded="true"] .ac-chev { transform: rotate(-90deg); }
.ac-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 212px; padding: 6px; display: grid; background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow); transform-origin: top right; animation: ac-pop var(--d) var(--ease); }
.ac-pop form { display: contents; }
.ac-pop-i { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--ink); font-size: 15px; font-weight: 500; text-align: left; text-decoration: none; transition: background-color var(--d-fast) ease; }
.ac-pop-i svg { color: var(--muted); }
.ac-pop-i:focus-visible { outline-offset: -2px; }

@media (hover: hover) and (pointer: fine) {
  .ac-link:hover { text-decoration-color: currentColor; }
  .ac-edit:hover { background: var(--brand-soft); }
  .ac-in:hover { color: var(--brand); }
  .ac-me:hover { background: var(--line); }
  .ac-pop-i:hover { background: var(--ground); }
  .ac-show:hover { background: var(--brand-soft); }
}

@media (max-width: 720px) {
  .ac-sheet { padding: 24px 20px; gap: 20px; }
  .ac-top { align-items: flex-start; }
  .ac-bar { min-height: 48px; }
  html[data-sh-js] .sh-links .ac-li button { width: 100%; min-height: 60px; padding: 0 4px; border-radius: 0; border-bottom: 1px solid var(--line); font: 600 24px/1.2 var(--font-display); letter-spacing: -0.02em; text-align: left; }
}

@keyframes ac-settle { from { transform: translateY(8px) scale(.985); } }
@keyframes ac-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

@media (prefers-reduced-motion: reduce) {
  .ac[data-step] .ac-pane:not(.ac-alt), .ac[data-step] .ac-done, .ac-edit-form, .ac-gate, .ac-gone, .ac-pop,
  .ac-danger:not([data-del="idle"]) .ac-confirm { animation: k-fade .3s ease both; }
  .ac[data-step="done"] .ac-sheet { animation: none; }
  .ac-chev { transition: none; }
}

/* a receipt opened in place over the page (receipt-sheet.js): the page in a frame, a floating X on top */
.ac-rs { position: fixed; inset: 0; z-index: 1000; background: var(--ground); animation: k-fade .2s ease both; }
.ac-rs-f { display: block; width: 100%; height: 100%; border: 0; background: var(--ground); }
.ac-rs-x { position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--surface); color: var(--ink); box-shadow: var(--shadow), 0 0 0 1px var(--line); cursor: pointer; }
.ac-rs-save { position: absolute; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom)); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.ac-rs-x:focus-visible, .ac-rs-save:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .ac-rs { animation: none; } }
