/* Accounts, organisations, plans, API keys (#6-#10): sign in, account tabs, pricing, invitations.
   Tokens and components of app.css + features/properties.css (web/DESIGN.md): a cool-grey panel (radius 48) holding
   white cards (radius 28), Instrument Serif titles and big numbers, Inter for the rest, navy as the one accent. */

.ac-root { --ac-gap: 20px; }
.ac-lead { color: var(--label-2); font-size: 17px; margin-top: 10px; max-width: 60ch; }
.ac-err { color: var(--danger); font-size: var(--fs-s); }
.ac-wide { width: 100%; justify-content: center; }
.ac-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 18px; }
.ac-note { margin-top: 14px; padding: 12px 14px; border-radius: 16px; background: var(--fill); font-size: var(--fs-s); color: var(--label-2); }
.ac-pad { padding: 0 26px 22px; }
.ac-meta { font-size: 13.5px; color: var(--label-2); margin-top: 2px; }
.ac-k { font-size: 13px; font-weight: 600; color: var(--label-3); text-transform: uppercase; letter-spacing: .06em; }
.ac-root .btn { transition: transform .32s var(--spring), box-shadow .12s var(--ease-std), background-color .2s; }
.ac-root .btn:active { transform: translateY(3px) scale(.97); transition-duration: .08s; }
.btn.is-busy { opacity: .7; cursor: progress; }
.linkish.danger { color: var(--danger); }
.ac-select { min-height: 44px; padding: 0 34px 0 12px; border: 1px solid var(--sep); border-radius: 12px; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000c1f' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 10px center / 16px; font: inherit; font-size: 15px; color: var(--label); appearance: none; -webkit-appearance: none; cursor: pointer; max-width: 100%; }
.ac-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.ac-select.sm { min-height: 36px; font-size: 14px; padding-left: 10px; }
.ac-skel { padding: 40px; border-radius: 48px; background: var(--cool); margin-top: 8px; }
.ac-skel .sk { background: rgb(17 22 20 / .06); border-radius: 12px; }

/* ------------------------------------------------------------------ sign in, invitation */
.ac-auth { display: grid; place-items: start center; padding: 6vh 0 10vh; background: linear-gradient(180deg, var(--cool), #f4f7f5 70%, var(--canvas)); border-radius: 48px; margin: 8px 0 24px; }
.ac-auth-card { width: min(100%, 480px); padding: 40px 40px 32px; animation: mp-rise .55s var(--ease-out) both; }
.ac-auth-card h1 { font: 700 clamp(2.4rem, 2rem + 1.6vw, 3.2rem)/1 var(--display); letter-spacing: -.03em; }
.ac-form { display: grid; gap: 14px; margin-top: 26px; }
.ac-form .btn { min-height: 50px; }
.ac-or { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--label-3); font-size: 13px; }
.ac-or::before, .ac-or::after { content: ""; flex: 1; height: 1px; background: var(--sep-2); }
.ac-gsi { width: 100%; justify-content: center; min-height: 50px; }
.ac-auth-card .mp-small { margin-top: 20px; }
.ac-sent-i { width: 56px; height: 56px; border-radius: 18px; background: var(--soon-tint); color: var(--accent); display: grid; place-items: center; margin-bottom: 18px; animation: mp-pop .5s var(--spring) both; }
.ac-sent-i .ico { width: 26px; height: 26px; }

/* ------------------------------------------------------------------ account */
.ac-dash { background: linear-gradient(180deg, var(--cool) 0%, #f4f7f5 60%, var(--cool) 100%); border-radius: 48px; padding: 40px 40px 44px; margin: 8px 0 24px; }
.ac-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.ac-title { min-width: 0; }
.ac-title h1 { font: 700 var(--fs-l)/.98 var(--display); letter-spacing: -.03em; }
.ac-title .ac-lead { font-size: 15px; margin-top: 12px; overflow-wrap: anywhere; }
.ac-orgs > summary { max-width: min(320px, 80vw); }
.ac-org-n { overflow: hidden; text-overflow: ellipsis; min-width: 0; font-weight: 600; }
.ac-orgs .mp-pop { min-width: 260px; max-width: min(340px, 90vw); }
.ac-orgs .mp-pop button { display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; gap: 10px; align-items: center; width: 100%; }
.ac-orgs .mp-pop button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-orgs .mp-pop button i { font-style: normal; font-size: 12.5px; color: var(--label-3); }
.ac-orgs .mp-pop button .ico { width: 16px; height: 16px; color: var(--accent); }
.ac-orgs .mp-pop [data-org-new] { grid-template-columns: 18px minmax(0, 1fr); color: var(--accent); font-weight: 600; }
.ac-orgs .mp-pop hr { border: 0; height: 1px; background: var(--sep-2); margin: 4px 6px; }
.ac-tabs { display: inline-flex; gap: 2px; margin-top: 28px; padding: 4px; border-radius: 999px; background: var(--cool-2); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.ac-tabs::-webkit-scrollbar { display: none; }
.ac-tabs a { flex: none; padding: 9px 18px; border-radius: 999px; color: var(--label); font-size: 15px; font-weight: 500; text-decoration: none; transition: background-color .2s, transform .3s var(--spring); }
.ac-tabs a:hover { text-decoration: none; background: rgb(255 255 255 / .55); }
.ac-tabs a:active { transform: scale(.96); }
.ac-tabs a.on { background: var(--bg); box-shadow: 0 1px 3px rgb(17 22 20 / .12); font-weight: 600; }
.ac-body { margin-top: var(--ac-gap); animation: mp-rise .45s var(--ease-out) both; }
.ac-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ac-gap); align-items: start; }
.ac-card { padding: 0 0 4px; min-width: 0; }
.ac-grid .ac-card, .ac-apioff { padding: 24px 26px 26px; }
.ac-card-h { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 22px 26px 16px; }
.ac-grid .ac-card .ac-card-h { padding: 0 0 12px; }
.ac-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--cool); display: grid; place-items: center; color: var(--accent); }
.ac-ico .ico { width: 20px; height: 20px; }
.ac-card-h > div, .ac-apioff > div { min-width: 0; }
.ac-card-h h2, .ac-apioff h2 { font-size: 17px; font-weight: 650; letter-spacing: -.015em; }

/* people + keys */
.ac-people { list-style: none; margin: 0; padding: 0 12px 8px; }
.ac-person, .ac-key { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto 72px; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; transition: background-color .2s; }
.ac-person + .ac-person, .ac-key + .ac-key { box-shadow: inset 0 1px 0 var(--sep-2); }
.ac-person:hover, .ac-key:hover { background: var(--fill); box-shadow: none; }
.ac-person:hover + .ac-person, .ac-key:hover + .ac-key { box-shadow: none; }
.ac-av, .ac-key-i { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--ink-btn); color: #fff; font-size: 14px; font-weight: 650; }
.ac-person.is-inv .ac-av { background: var(--cool-2); color: var(--label-2); }
.ac-key-i { border-radius: 12px; background: var(--cool); color: var(--accent); }
.ac-av .ico, .ac-key-i .ico { width: 17px; height: 17px; }
.ac-pn { display: grid; min-width: 0; }
.ac-pn b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-pn > span { font-size: 13px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-pn code { font: 500 12.5px/1 var(--mono); color: var(--label); }
.ac-you { font-style: normal; font-size: 12px; font-weight: 600; color: var(--accent); background: var(--soon-tint); padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 1px; }
.ac-role { font-size: 14px; color: var(--label-2); }
.ac-rm { justify-self: end; font-size: 14px; min-height: 36px; }
.ac-key { grid-template-columns: 36px minmax(0, 1fr) auto; }
.ac-invite { margin: 6px 26px 24px; padding: 20px; border-radius: 20px; background: var(--fill); }
.ac-invite h3 { font-size: 15px; font-weight: 650; margin-bottom: 10px; }
.ac-inv-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; }
.ac-inv-row .mp-field input { background: var(--bg); }
.ac-inv-row .btn { margin-bottom: 3px; }
.ac-hint { font-size: 12.5px; color: var(--label-3); margin-top: 10px; }
.ac-hint b { color: var(--label-2); font-weight: 600; }
.ac-invite .ac-err:not([hidden]) { margin-top: 8px; }
.ac-up { margin-top: 10px; font-size: var(--fs-s); color: var(--unknown); }
.ac-danger-row { margin-top: 18px; padding: 0 8px; font-size: 14px; color: var(--label-3); }

/* activity (#88) */
.ac-act .ac-card-h > .btn { text-decoration: none; }
.ac-filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 26px 14px; }
.ac-filters .ac-select { border-radius: 999px; padding-left: 14px; max-width: 260px; }
.ac-log { list-style: none; margin: 0; padding: 0 12px 8px; transition: opacity .2s; }
[aria-busy="true"] > .ac-log { opacity: .5; }
.ac-ev { display: grid; grid-template-columns: 148px minmax(0, 180px) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 13px 14px; border-radius: 16px; font-size: 15px; }
.ac-ev + .ac-ev { box-shadow: inset 0 1px 0 var(--sep-2); }
.ac-ev time { color: var(--label-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ac-ev-who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-ev-who.is-former { font-weight: 500; color: var(--label-2); }
.ac-ev-what { min-width: 0; overflow-wrap: anywhere; }
.ac-ev-g { font-size: 12.5px; font-weight: 600; color: var(--label-2); background: var(--fill); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.ac-act-none { padding-top: 10px; }

/* plan + usage */
.ac-big { font: 700 clamp(44px, 4vw, 60px)/1 var(--display); letter-spacing: -.02em; margin-top: 10px; }
.ac-price { font-size: 17px; font-weight: 600; margin-top: 6px; }
.ac-price small { font-size: 12.5px; font-weight: 500; color: var(--label-2); }
.ac-pp small { font-size: 17px; font-weight: 500; color: var(--label-2); margin-left: 2px; }
.ac-status { margin-top: 12px; font-size: 15px; color: var(--label-2); }
.ac-plan.is-due { box-shadow: var(--shadow-card), inset 0 0 0 2px var(--unk-ln); }
.ac-plan.is-due .ac-status { color: var(--unknown); font-weight: 600; }
.ac-usage { display: grid; gap: 18px; margin: 16px 0 0; }
.ac-usage > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: baseline; }
.ac-usage dt { font-size: 15px; font-weight: 500; }
.ac-usage dd { margin: 0; font-size: 15px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.ac-bar { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.ac-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transform-origin: left; animation: ac-grow .8s var(--ease-out) both .15s; }
.ac-bar.full i { background: var(--unknown); }
@keyframes ac-grow { from { transform: scaleX(0); } }
.ac-kv { display: grid; gap: 12px; margin: 4px 0 0; }
.ac-kv > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
.ac-kv dt { font-size: 14px; color: var(--label-3); }
.ac-kv dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; }

/* api */
.ac-apioff { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; }
.ac-apioff .ac-lead { font-size: 15.5px; margin-top: 6px; }
.ac-docs { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; }
.ac-docs .ico { width: 15px; height: 15px; }
.ac-keyshow p { color: var(--label-2); }
.ac-keybox { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; margin: 16px 0 22px; padding: 12px 12px 12px 16px; border-radius: 16px; background: var(--fill); box-shadow: inset 0 0 0 1px var(--sep-2); }
.ac-keybox code { font: 500 13.5px/1.45 var(--mono); overflow-wrap: anywhere; user-select: all; }
.ac-keybox .btn { margin-bottom: 3px; }
.ac-upsheet .ac-lead { margin: 0 0 20px; font-size: 16px; }
.ac-sheet .mp-form .mp-field select { width: 100%; }

/* ------------------------------------------------------------------ pricing */
.ac-pricing { background: linear-gradient(180deg, var(--cool) 0%, #f4f7f5 55%, var(--canvas) 100%); border-radius: 48px; padding: 56px 40px 40px; margin: 8px 0 24px; }
.ac-ph { text-align: center; }
.ac-ph h1 { font: 700 var(--fs-l)/.98 var(--display); letter-spacing: -.03em; }
.ac-ph .ac-lead { margin: 14px auto 0; }
.ac-pgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ac-gap); margin-top: 40px; align-items: stretch; }
.ac-pcard { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 28px 26px 26px; background: var(--bg); border-radius: var(--r-card); box-shadow: var(--shadow-card); animation: mp-rise .6s var(--ease-out) both; animation-delay: calc(80ms + var(--i) * 70ms); }
.ac-pcard.is-hl { box-shadow: var(--shadow-lift), inset 0 0 0 2px var(--accent), 0 0 0 6px var(--ring); }
.ac-pcard h2 { font-size: 19px; font-weight: 650; letter-spacing: -.015em; }
.ac-for { font-size: 14px; color: var(--label-2); margin-top: 2px; }
.ac-pp { font: 700 clamp(46px, 4vw, 58px)/1 var(--display); letter-spacing: -.02em; margin-top: 20px; font-variant-numeric: tabular-nums; }
.ac-pp small { font-family: var(--font); letter-spacing: 0; }
.ac-trial { font-size: 13.5px; color: var(--applies); font-weight: 600; margin-top: 8px; min-height: 1.4em; }
.ac-feats { list-style: none; margin: 20px 0 0; padding: 18px 0 0; border-top: 1px solid var(--sep-2); display: grid; gap: 10px; flex: 1; align-content: start; }
.ac-feats li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; font-size: 15px; line-height: 1.4; }
.ac-feats .ico { width: 18px; height: 18px; color: var(--applies); stroke-width: 2.4; margin-top: 1px; }
.ac-pcta { margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; min-height: 50px; }
.ac-pcta .btn { min-height: 48px; }
.ac-current { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 999px; background: var(--ok-tint); color: var(--applies); font-weight: 600; font-size: 15px; }
.ac-current .ico { width: 18px; height: 18px; stroke-width: 2.6; }
.ac-papi { margin-top: var(--ac-gap); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 18px 32px; align-items: center; animation-delay: 300ms; }
.ac-papi .ac-pp { font-size: clamp(38px, 3vw, 46px); }
.ac-papi .ac-feats { margin: 0; padding: 0 0 0 28px; border-top: 0; border-left: 1px solid var(--sep-2); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ac-papi .ac-pcta { margin: 0; flex-direction: column; align-items: stretch; }
.ac-bill { display: inline-flex; margin-top: 26px; padding: 4px; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--sep-2); }
.ac-bill button { min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: none; font: inherit; font-size: 15px; font-weight: 600; color: var(--label-2); cursor: pointer; transition: background-color .2s, color .2s, box-shadow .2s; }
.ac-bill button:hover { color: var(--label); }
.ac-bill button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.ac-bill button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ac-save { font-size: 12.5px; font-weight: 600; color: var(--applies); margin-left: 4px; }
.ac-bill [aria-pressed="true"] .ac-save { color: inherit; opacity: .8; }
.ac-founding { margin: 16px auto 0; max-width: 72ch; font-size: 14.5px; color: var(--label-2); }
.ac-from { font: 500 15px/1 var(--font); color: var(--label-2); letter-spacing: 0; margin-right: 2px; }
.ac-swap .ac-pcard { animation: none; }
.ac-fine { margin: 28px auto 0; max-width: 72ch; text-align: center; font-size: 13px; color: var(--label-3); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .ac-pgrid { grid-template-columns: minmax(0, 1fr); max-width: 520px; margin-inline: auto; }
  .ac-papi { grid-template-columns: minmax(0, 1fr); max-width: 520px; margin-inline: auto; }
  .ac-papi .ac-feats { padding: 18px 0 0; border-left: 0; border-top: 1px solid var(--sep-2); grid-template-columns: minmax(0, 1fr); }
  .ac-papi .ac-pcta { flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 860px) { .ac-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px), (pointer: coarse) and (max-height: 500px) {
  /* the phone header has no room for the account initial (its tabs are the bottom bar, so fitHeader does not run);
     Account is in the My properties menu */
  .acct-b { display: none; }
  .ac-root { --ac-gap: 14px; }
  .ac-dash, .ac-pricing, .ac-auth { margin: 0 calc(-1 * max(var(--inset), env(safe-area-inset-left)) + 8px); padding: 24px 12px 28px; border-radius: 32px; }
  .ac-pricing { padding-top: 36px; }
  .ac-top { padding: 0 6px; }
  .ac-tabs { margin-top: 22px; display: flex; }
  .ac-tabs a { flex: 1 0 auto; text-align: center; padding: 9px 14px; }
  .ac-auth { padding: 20px 12px 40px; }
  .ac-auth-card { padding: 28px 22px 24px; }
  .ac-card-h { padding: 18px 16px 12px; grid-template-columns: 36px minmax(0, 1fr); }
  .ac-ico { width: 36px; height: 36px; }
  .ac-card-h > .btn, .ac-card-h > .linkish { grid-column: 1 / -1; justify-self: start; }
  .ac-grid .ac-card, .ac-apioff { padding: 20px 18px 22px; }
  .ac-apioff { grid-template-columns: minmax(0, 1fr); }
  .ac-people { padding: 0 4px 6px; }
  .ac-person { grid-template-columns: 36px minmax(0, 1fr) auto; padding: 12px 12px; }
  .ac-person .ac-rm { grid-column: 2 / -1; justify-self: start; min-height: 32px; }
  .ac-person .ac-rm:empty { display: none; }
  .ac-key { grid-template-columns: 36px minmax(0, 1fr); }
  .ac-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 16px 10px; }
  .ac-filters .ac-select { max-width: none; width: 100%; min-height: 44px; }
  .ac-filters [data-f="action"] { grid-column: 1 / -1; grid-row: 2; }
  .ac-log { padding: 0 4px 6px; }
  .ac-ev { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 12px; }
  .ac-ev-what { grid-row: 1; grid-column: 1 / -1; font-weight: 500; }
  .ac-ev-who { grid-row: 2; grid-column: 1; font-size: 13.5px; font-weight: 500; color: var(--label-2); }
  .ac-ev time { grid-row: 2; grid-column: 2; font-size: 13.5px; }
  .ac-ev-g { display: none; }
  .ac-key .ac-rm { grid-column: 2; justify-self: start; }
  .ac-pn > span { white-space: normal; }
  .ac-invite { margin: 4px 12px 16px; padding: 16px; }
  .ac-inv-row { grid-template-columns: minmax(0, 1fr); }
  .ac-inv-row .btn, .ac-inv-row .ac-select { width: 100%; justify-content: center; min-height: 48px; }
  .ac-pad { padding: 0 16px 18px; }
  .ac-row > .btn { flex: 1 1 auto; justify-content: center; min-height: 48px; }
  .ac-kv > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .ac-pcard { padding: 24px 20px 22px; }
  .ac-pcta .btn { width: 100%; justify-content: center; }
  .ac-keybox { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .ac-auth-card, .ac-body, .ac-pcard, .ac-sent-i, .ac-bar i { animation: none !important; }
  .ac-root .btn, .ac-tabs a { transition: none !important; }
}
