/* The /account pages: overview, profile, plans, subscription, billing and usage. */
.account-shell { min-block-size: 100dvh; }
/* Route ownership is established by account-sections.js; never paint other panels first. */
html:not([data-account-ready]) [data-account-sections] { display: none; }

/* Phones keep every destination in one sideways-scrolling row of capsule links. */
.account-sidebar.sidebar {
  position: sticky; inset: 0 0 auto; z-index: var(--z-sticky); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) var(--space-2); align-items: center;
  inline-size: 100%; padding: var(--space-2) var(--gutter); border-radius: 0; box-shadow: none; visibility: visible; transform: none;
}
.account-sidebar .sidebar-top { grid-column: 1; margin: 0; padding: 0; min-block-size: 40px; }
.account-sidebar .key-new { display: none; }
.account-sidebar .sidebar-foot { grid-column: 2; grid-row: 1; margin: 0; padding: 0; }
.account-sidebar .profile-row { flex: none; min-inline-size: 44px; min-block-size: 44px; padding: 2px; border-radius: 50%; }
.account-sidebar .profile-text { display: none; }
.account-nav {
  grid-column: 1 / -1; display: flex; flex-wrap: nowrap; gap: var(--space-2); min-inline-size: 0; padding-block: var(--space-1);
}
.account-nav .nav-row { flex: none; inline-size: auto; min-block-size: var(--control-height); padding-block: var(--space-1); padding-inline: var(--space-2) var(--space-4); border-radius: var(--radius-full); background: transparent; }
.account-nav .nav-row[aria-current="page"] { background: color-mix(in srgb, var(--color-accent) 13%, transparent); color: var(--color-ink); --color-glow: rgb(0 0 0 / 7%); }
/* Phones and tablets: one row that scrolls sideways, never wraps. */
@media (max-width: 899px) {
  .account-nav {
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none;
    padding-inline: var(--space-3); margin-inline: calc(-1 * var(--space-3)); scroll-padding-inline: var(--space-3);
    -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--space-3), #000 calc(100% - var(--space-3)), transparent); mask-image: linear-gradient(to right, transparent, #000 var(--space-3), #000 calc(100% - var(--space-3)), transparent); /* taste-skill-ignore */
  }
  .account-nav::-webkit-scrollbar { display: none; }
  .account-nav .nav-row { white-space: nowrap; scroll-snap-align: center; }
  .account-nav .nav-row > .icon { flex: none; inline-size: 24px; block-size: 24px; padding: 4px; }
}
@media (hover: hover) and (pointer: fine) and (max-width: 899px) { .account-nav .nav-row:hover:not([aria-current="page"]) { background: var(--color-fill); } }

@media (min-width: 900px) {
  .account-sidebar.sidebar {
    position: fixed; inset-block: var(--float-gap) auto; inset-inline: var(--float-gap) auto; display: flex; align-items: stretch; inline-size: var(--sidebar-width); max-block-size: calc(100dvh - 2 * var(--float-gap)); overflow-y: auto; padding: var(--space-3) var(--space-2) var(--space-2);
    border-radius: var(--radius-xl); box-shadow: var(--hairline), var(--shadow-float);
  }
  .account-sidebar .sidebar-top { margin-block-end: var(--space-2); padding-inline: var(--space-2); }
  .account-sidebar .key-new { display: flex; margin-block-end: var(--space-2); }
  .account-sidebar .sidebar-foot { margin-block-start: var(--space-2); padding-block-start: var(--space-2); box-shadow: inset 0 1px 0 var(--color-separator); }
  .account-sidebar .profile-row { flex: 1; min-block-size: 48px; padding: var(--space-1) var(--space-2); border-radius: var(--radius-md); }
  .account-sidebar .profile-text { display: grid; }
  .account-nav { flex-direction: column; flex-wrap: nowrap; gap: 2px; overflow: visible; margin: 0; padding: 0; }
  .account-nav .nav-row { flex: none; justify-content: start; inline-size: 100%; min-block-size: 40px; padding: var(--space-2); border-radius: var(--radius-md); background: transparent; }
  .account-nav .nav-row:hover { background: var(--color-fill); }
  .account-nav .nav-row > .icon { display: block; }
  .account-nav .nav-row[aria-current="page"] { background: color-mix(in srgb, var(--color-accent) 13%, transparent); color: var(--color-ink); --color-glow: rgb(0 0 0 / 7%); }
}

.account-main {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); max-inline-size: 1000px; margin-inline: auto; padding: var(--space-5) var(--gutter) var(--space-12);
  animation: fade var(--motion-base) var(--ease-out);
}
@media (min-width: 900px) {
  .account-main { max-inline-size: none; margin-inline: calc(var(--sidebar-width) + var(--float-gap)) 0; padding: var(--space-12) max(var(--space-8), calc((100% - var(--sidebar-width) - 860px) / 2)) var(--space-16); }
}
.account-heading { display: grid; gap: var(--space-1); }
.account-heading h1 { font-size: var(--text-title1); }
.account-intro { color: var(--color-muted); }
#account-retry { justify-self: start; }

.account-section, .account-card { display: grid; gap: var(--space-4); min-inline-size: 0; }
/* Cards and the balance stage inside them breathe with the width: 16px on a 360px phone, the desktop padding from 900px. */
.account-card { padding: calc(var(--space-4) + .5 * var(--fluid)); border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-card); }
.account-card > button.button, .account-card > a.button, .account-card form > button.button { justify-self: start; }
.account-card input:not([type="checkbox"], [type="radio"], [type="file"]), .account-card select { background-color: var(--color-window); box-shadow: none; }
.account-card input:not([type="checkbox"], [type="radio"], [type="file"]):hover, .account-card select:hover { box-shadow: none; background-color: var(--color-fill); }
.account-card input:not([type="checkbox"], [type="radio"], [type="file"]):focus-visible, .account-card select:focus-visible { box-shadow: inset 0 0 0 1.5px var(--color-accent), 0 0 0 4px var(--color-accent-soft); }
.section-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-1) var(--space-4); }
#checkout-note { flex-basis: 100%; }
.section-heading h2, .account-section > h2 { font-size: var(--text-title3); font-weight: var(--weight-strong); }
.account-card > h2 { font-size: var(--text-title3); }
/* A section reached from Settings announces itself. */
:target { scroll-margin-block-start: 112px; animation: target-pulse 1.6s var(--ease-out) 300ms; }
@keyframes target-pulse { 20% { box-shadow: 0 0 0 3px var(--color-accent); } }

/* Overview */
.recent-list, .usage-list { display: grid; }
.recent-list:empty, .usage-list:empty { display: none; }
.recent-list > li + li, .usage-list > li + li { border-block-start: 1px solid var(--color-separator); }
.recent-link { display: grid; gap: 2px; padding-block: var(--space-3); color: var(--color-ink); text-decoration: none; overflow-wrap: anywhere; transition: opacity var(--motion-fast) ease, transform var(--motion-base) var(--spring-bouncy); }
.recent-link:hover { opacity: .72; }
.recent-link:active { transform: scale(.99); }
.recent-link strong { font-size: var(--text-subhead); font-weight: var(--weight-regular); }
.recent-link span { color: var(--color-muted); font-size: var(--text-caption); }
[dir="rtl"] .recent-link span { text-align: right; }
@media (min-width: 1200px) {
  :root[data-route="account"] .account-main { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
  :root[data-route="account"] .account-main > :not(#balance-panel, #recent-panel, #device-sessions-panel) { grid-column: 1 / -1; }
  :root[data-route="account"] #balance-panel { grid-row: span 2; }
  :root[data-route="account"] :is(#recent-panel, #device-sessions-panel) { grid-column: 2; }
}

/* The page title already names this card here. */
:root[data-route="subscription"] #balance-panel > h2 { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }

/* Wallet: the balance large, then a bar of what it is made of, like iPhone Storage. */
.wallet .account-budget { display: grid; gap: var(--space-4); }
.wallet-figure { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4); padding: calc(var(--space-4) + .25 * var(--fluid)); border-radius: var(--radius-md); background: var(--stage); color: #fff; }
.wallet-figure .balance-tile > span { color: rgb(255 255 255 / 86%); }
.wallet-figure .button.primary { background: #fff; color: #1d1d1f; --color-glow: rgb(0 0 0 / 8%); }
@media (hover: hover) and (pointer: fine) { .wallet-figure .button.primary:hover:not(:disabled) { background: #f0f0f2; } }
.wallet-figure .balance-tile > strong { font-size: 2.5rem; font-weight: var(--weight-bold); line-height: 1.15; }
.balance-tile > strong > small { font-size: max(.45em, .8125rem); font-weight: var(--weight-regular); opacity: .78; }
.balance-tile { display: grid; gap: 2px; align-content: start; }
.balance-tile > span { color: var(--color-muted); font-size: var(--text-footnote); }
.balance-tile > strong { font-size: var(--text-title3); font-weight: var(--weight-strong); line-height: var(--leading-tight); overflow-wrap: anywhere; }
/* Digits resolve to LTR under dir="auto"; keep them on the reading edge. */
[dir="rtl"] .balance-tile > strong { text-align: right; }
.balance-tile > small { color: var(--color-muted); font-size: var(--text-caption); }
.balance-tile > small:empty { display: none; }
.credit-bar { display: flex; gap: 2px; block-size: 10px; overflow: hidden; border-radius: var(--radius-full); background: var(--color-fill); }
.credit-bar i { flex: var(--share, 0) 1 0; min-inline-size: 0; }
[data-source="purchased"] { --source: var(--color-accent-fill); }
[data-source="subscription"] { --source: #34c759; }
[data-source="gift"] { --source: #ff9500; }
.credit-bar i { background: var(--source); }
/* One row of three when it fits, otherwise a plain list: never two and an orphan. */
.account-budget-grid { display: grid; gap: var(--space-3); }
.account-budget-grid .balance-tile { grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--space-3); }
.account-budget-grid .balance-tile > small { grid-column: 1 / -1; }
@media (min-width: 480px) {
  .account-budget-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
  .account-budget-grid .balance-tile { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .account-budget-grid .balance-tile > span { align-items: baseline; }
}
.account-budget-grid .balance-tile > span { display: flex; align-items: center; gap: var(--space-2); }
.account-budget-grid .balance-tile > span::before { content: ""; inline-size: 8px; block-size: 8px; flex: none; border-radius: 50%; background: var(--source); }
#subscription-remaining { color: var(--color-muted); font-size: var(--text-subhead); font-weight: var(--weight-medium); }
.account-subscription { display: grid; gap: var(--space-1); padding-block-start: var(--space-4); border-block-start: 1px solid var(--color-separator); }
.budget-review-notice { padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--color-warning-soft); color: var(--color-warning); font-size: var(--text-subhead); }
.budget-review-notice:empty { display: none; }
.consent-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); font-size: var(--text-subhead); font-weight: var(--weight-regular); }
.credit-consent-label, .purchase-consent { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--text-subhead); font-weight: var(--weight-regular); }
.credit-consent-label input, .purchase-consent input { margin-block-start: 3px; }
.wallet form, #sms-chat-form { display: grid; gap: var(--space-3); }
#sms-chat-form[data-unchanged] #sms-chat-save, #sms-chat-form[data-unchanged] ~ #sms-chat-save-reason { display: none; }
#credit-form[data-unchanged] :is(#credit-save, #credit-save-reason) { display: none; }
/* A second look at the balance is offered only when the page is unsure of it. */
#credit-panel:has(#credit-action:empty):has(#credit-values:not([hidden])) #credit-refresh { display: none; }
#sms-chat-terms { display: grid; gap: var(--space-1); font-size: var(--text-subhead); }
.subscription-details { display: grid; gap: var(--space-2); padding-block-start: var(--space-4); border-block-start: 1px solid var(--color-separator); }

/* Profile: its own page, centred on the person. Consent and subscription detail live on their own pages. */
:root[data-route="profile"] .account-heading { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
/* Without a name the heading is the email address, which can be long. */
.profile-form, .profile-fields { display: grid; gap: var(--space-3); }
.profile-fields > button.button { justify-self: start; }
.profile-form-actions { display: flex; gap: var(--space-2); }
.profile-error { color: var(--color-danger); }
#account-deletion { background: transparent; box-shadow: inset 0 0 0 1px var(--color-separator); }
#account-deletion h2 { color: var(--color-danger); }

/* Plans and packages */
.account-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
@media (min-width: 1100px) { #plans-loading { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
#plans-loading > .account-state { grid-column: 1 / -1; }
.product-card {
  position: relative; display: flex; flex-direction: column; gap: var(--space-4); min-inline-size: 0; padding: var(--space-5); border: 1px solid var(--color-separator); border-radius: var(--radius-lg);
  background: var(--color-surface); overflow-wrap: anywhere;
}
.product-card.is-recommended { border-color: transparent; background: var(--color-accent-soft); }
.plan-header { display: grid; gap: var(--space-4); padding-block-end: var(--space-4); border-block-end: 1px solid var(--color-separator); }
.plan-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; min-block-size: var(--space-8); gap: var(--space-1) var(--space-2); }
/* The same capsule as the public price list (DESIGN.md: a tint and a recommendation capsule). */
.plan-recommended { align-self: center; padding: 2px var(--space-3); border-radius: var(--radius-full); background: var(--color-accent-fill); color: var(--color-on-accent); font-size: var(--text-caption); font-weight: var(--weight-strong); }
.plan-models { display: grid; gap: var(--space-1); font-size: var(--text-subhead); line-height: 1.7; }
.plan-models > span { color: var(--color-muted); font-size: var(--text-caption); }
.plan-models p { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); text-align: match-parent; }
/* Quiet tags, so two names on one line never read as one. */
.plan-model-name { padding: 0 var(--space-2); border-radius: var(--radius-sm); background: var(--color-fill); font-size: var(--text-footnote); line-height: 1.9; }
.plan-model-name { display: inline-block; inline-size: max-content; max-inline-size: 100%; vertical-align: bottom; }
.plan-footer { display: grid; gap: var(--space-3); margin-block-start: auto; padding-block-start: var(--space-4); border-block-start: 1px solid var(--color-separator); }
.plan-footer > .button { inline-size: 100%; }
.plan-credit { color: var(--color-muted); font-size: var(--text-caption); }
.plan-credit summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px var(--space-2); min-block-size: var(--control-height); padding: var(--space-3) var(--space-4); inline-size: 100%; list-style: none; cursor: pointer; border-radius: var(--radius-full); background: var(--color-accent-soft); color: var(--color-accent); font-size: var(--text-subhead); font-weight: var(--weight-medium); }
.plan-credit summary:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.plan-credit[open] summary { box-shadow: inset 0 0 0 1px var(--color-accent); }
@media (hover: hover) and (pointer: fine) { .plan-credit summary:hover { box-shadow: inset 0 0 0 1px var(--color-accent); } }
.plan-credit summary::-webkit-details-marker { display: none; }
.plan-credit summary::after { content: ""; grid-column: 2; grid-row: 1 / 3; inline-size: 8px; block-size: 8px; margin-inline: var(--space-1); border-inline-end: 1.5px solid currentColor; border-block-end: 1.5px solid currentColor; transform: rotate(45deg); }
.plan-credit[open] summary::after { transform: rotate(225deg); }
[dir="rtl"] .plan-credit summary::after { transform: rotate(-45deg); }
[dir="rtl"] .plan-credit[open] summary::after { transform: rotate(135deg); }
.plan-credit-cost { grid-column: 1; font-size: var(--text-footnote); color: var(--color-ink); }
.plan-credit button { inline-size: 100%; }
.plan-credit p { margin-block: var(--space-2); }
.product-card h3 { font-size: var(--text-title3); font-weight: var(--weight-strong); }
.product-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-2); font-size: var(--text-title1); font-weight: var(--weight-bold); line-height: 1.5; }
.plan-header .product-price { display: grid; justify-items: start; gap: 0; }
.price-amount { display: inline-flex; align-items: baseline; gap: var(--space-1); white-space: nowrap; }
.product-price small { color: var(--color-muted); font-size: var(--text-subhead); font-weight: var(--weight-medium); }
.price-note { margin-block-start: var(--space-3); }
.product-meta { display: grid; gap: var(--space-2); padding: 0; margin: 0; list-style: none; font-size: var(--text-subhead); }
.product-meta > li { display: flex; align-items: baseline; gap: var(--space-2); font-variant-numeric: var(--numeric); }
.product-meta > li::before { content: ""; flex: none; align-self: start; inline-size: var(--space-4); block-size: var(--space-4); margin-block-start: var(--space-1); background: var(--color-accent); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; }
.package-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); padding: var(--space-4); min-block-size: 44px; border-radius: var(--radius-md); background: var(--color-surface); }
.package-copy { display: grid; gap: var(--space-1); min-inline-size: 0; overflow-wrap: anywhere; }
.package-copy h3 { font-size: var(--text-subhead); }
.package-copy > span { color: var(--color-muted); font-size: var(--text-caption); font-variant-numeric: var(--numeric); }
.package-row .product-price { font-size: var(--text-title3); text-align: end; white-space: nowrap; }
.package-row > .button.primary, .package-row > .button.primary:disabled { position: absolute; inset: 0; padding: 0; inline-size: 100%; background: transparent; color: transparent; box-shadow: none; border-radius: inherit; opacity: 1; }
.package-row:has(> .button:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .package-row:has(> .button:not(:disabled)):hover { background: var(--color-fill-strong); } }
.package-row > .product-unavailable { grid-column: 1 / -1; }
/* Buyer-chosen credit amount: one field, suggested amounts, a live total and the one primary action. */
.custom-credit { display: grid; gap: var(--space-4); padding: var(--space-5); border-radius: var(--radius-lg); background: var(--color-surface); }
.custom-credit-head { display: grid; gap: var(--space-1); }
.custom-credit-head h3 { font-size: var(--text-title3); }
.custom-credit-field { position: relative; display: block; }
.custom-credit-field input { inline-size: 100%; min-block-size: 56px; padding-inline-end: 72px; font-size: var(--text-title1); font-weight: var(--weight-semibold); font-variant-numeric: var(--numeric); }
.custom-credit-field input[aria-invalid="true"] { border-color: var(--color-danger); }
.custom-credit-unit { position: absolute; inset-block: 0; inset-inline-end: var(--space-4); display: flex; align-items: center; color: var(--color-muted); font-size: var(--text-subhead); pointer-events: none; }
.custom-credit-presets { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.custom-credit-preset { min-block-size: 44px; padding-inline: var(--space-4); border: 0; border-radius: var(--radius-full); background: var(--color-fill-strong); color: var(--color-ink); font: inherit; font-variant-numeric: var(--numeric); cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out); }
.custom-credit-preset[aria-pressed="true"] { background: var(--color-accent-soft); color: var(--color-accent); font-weight: var(--weight-semibold); box-shadow: inset 0 0 0 1.5px var(--color-accent); }
@media (hover: hover) and (pointer: fine) { .custom-credit-preset[aria-pressed="false"]:hover { background: var(--color-surface-hover); } }
.custom-credit-error { color: var(--color-danger); font-size: var(--text-caption); }
.custom-credit-error:empty { display: none; }
.custom-credit-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.custom-credit-total { display: grid; gap: 0; }
.custom-credit-foot .button { min-inline-size: 160px; }
.custom-credit-or { margin-block-start: var(--space-2); color: var(--color-muted); font-size: var(--text-subhead); }
@media (max-width: 599px) { .custom-credit-foot .button { inline-size: 100%; } }
@media (prefers-reduced-motion: reduce) { .custom-credit-preset { transition: none; } }
.product-card > .button, .product-card > a.button { margin-block-start: auto; inline-size: 100%; }
@media (max-width: 899px) {
  .plan-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .plan-heading { flex: 1 1 100px; min-inline-size: 0; justify-content: start; }
  .plan-header .product-price { flex: 0 1 auto; margin-inline-start: auto; justify-items: end; text-align: end; }
}
@media (min-width: 480px) and (max-width: 899px) {
  .plan-footer:has(.plan-credit) { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .plan-footer:has(.plan-credit) > .button { min-block-size: calc(var(--control-height) + var(--space-6)); }
  .plan-footer:has(.plan-credit) > .product-unavailable { grid-column: 1 / -1; grid-row: 2; }
}
.product-unavailable { margin-block-start: auto; color: var(--color-muted); font-size: var(--text-caption); }
/* The page already says purchase is unavailable; every card repeating it is noise. */
.account-main:has(#checkout-note:not(:empty)) .product-unavailable { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
.active-intent { padding: var(--space-6); }
.account-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* Orders */
.purchase-list { display: grid; gap: var(--space-2); }
.purchase-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-md); background: var(--color-surface); box-shadow: var(--shadow-card); font-size: var(--text-subhead); animation: rise var(--motion-base) var(--ease-out); }
.purchase-main { display: grid; gap: var(--space-1); flex: 1 1 220px; min-inline-size: 0; overflow-wrap: anywhere; }
.purchase-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.account-pagination { padding-block-start: var(--space-2); }

/* Usage and ledger rows */
.usage-section .usage-list, #credit-history-panel .usage-list { padding-inline: var(--space-4); border-radius: var(--radius-md); background: var(--color-surface); box-shadow: var(--shadow-card); }
#credit-history-panel .usage-list { padding-inline: 0; background: transparent; box-shadow: none; }
#credit-history-panel .setting-field { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
#credit-history-panel .setting-field label { white-space: nowrap; }
#credit-history-panel .setting-field select { flex: 0 1 240px; inline-size: min(100%, 240px); min-inline-size: 0; }
/* The name leads its line; the details share the next one instead of taking a line each. */
.usage-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--space-3); padding-block: var(--space-3); font-size: var(--text-subhead); overflow-wrap: anywhere; }
.usage-item > .usage-model { flex: 1 1 60%; min-inline-size: 0; }
#credit-history-list .usage-item > :first-child, .usage-item > strong:first-child:not(.usage-model) { flex: 1 1 100%; }
.usage-item > button.button { margin-block-start: var(--space-1); }
/* Signing a device out is a small action on its row, not a capsule that takes a line. */
#device-sessions-list { max-block-size: 340px; overflow-y: auto; overscroll-behavior: contain; }
#device-sessions-list .usage-item > button.button { margin-inline-start: auto; min-block-size: 28px; padding: 0 var(--space-2); background: transparent; color: var(--color-danger); font-size: var(--text-caption); font-weight: var(--weight-medium); }
#device-sessions-panel .account-actions:not(:has(button:not([hidden]):not(:disabled))) { display: none; }
.usage-meta { color: var(--color-muted); font-size: var(--text-caption); }
.usage-model { font-weight: var(--weight-strong); }
.usage-item > .ltr-value { color: var(--color-muted); font-size: var(--text-caption); }
.device-session-current { color: var(--color-success); font-size: var(--text-caption); }
/* A usage or ledger row reads name then detail at the reading edge, the figure at the far edge. */
.usage-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: var(--space-1) var(--space-4); }
.usage-main { display: grid; gap: 2px; min-inline-size: 0; }
.usage-row .usage-model { font-weight: var(--weight-medium); overflow-wrap: anywhere; }
[dir="rtl"] .usage-row .usage-model { text-align: right; } /* A Latin model name resolves to LTR under dir=auto; it stays on the reading edge. */
[dir="ltr"] .usage-row .usage-model { text-align: left; }
#subscription-plans-link { justify-self: start; inline-size: fit-content; margin-block-start: var(--space-2); }
.usage-line { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--space-3); color: var(--color-muted); font-size: var(--text-caption); }
.usage-credit, .usage-amount { font-variant-numeric: var(--numeric); text-align: end; white-space: nowrap; }
.usage-credit { font-weight: var(--weight-medium); }
.usage-amount { font-weight: var(--weight-strong); }
.usage-amount.is-gain { color: var(--color-success); }
.usage-more { min-inline-size: 0; }
.usage-more[open] { flex: 1 1 100%; }
.usage-more summary { display: inline-block; color: var(--color-accent); cursor: pointer; }
.usage-more > div { display: grid; gap: 2px; padding-block: var(--space-1); }
@media (pointer: coarse) {
  #device-sessions-list .usage-item > button.button { min-block-size: 44px; }
  .usage-more summary { min-block-size: 44px; display: flex; align-items: center; } .usage-more summary { display: inline-flex; align-items: center; min-block-size: 44px; } }
/* No subscription: the details section says so once, so the quota block and renewal line go. */
#balance-panel.no-subscription .account-subscription, #balance-panel.no-subscription .account-manual-renewal { display: none; }
.device-session-current { display: inline-flex; align-items: center; gap: var(--space-1); }
.device-session-current::before { content: ""; inline-size: 14px; block-size: 14px; flex: none; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; }

/* Bars of credit per day, in the manner of Screen Time */
.usage-chart { display: grid; gap: var(--space-4); padding: var(--space-6); border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-card); }
/* An empty section keeps its frame and says so in it. */
.usage-section:has(#usage-list:empty) #usage-status:not(:empty) { padding: var(--space-8) var(--space-6); border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-card); font-size: var(--text-subhead); text-align: center; }
.usage-chart figcaption { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-1) var(--space-3); font-size: var(--text-subhead); font-weight: var(--weight-strong); }
.chart-total { display: grid; justify-items: end; text-align: end; }
.chart-total strong { font-size: var(--text-title2); font-weight: var(--weight-bold); font-variant-numeric: var(--numeric); }
.usage-chart small { color: var(--color-muted); font-size: var(--text-caption); font-weight: var(--weight-regular); }
.chart-bars { display: flex; align-items: flex-end; gap: var(--space-1); block-size: 120px; }
.chart-column { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: var(--space-1); flex: 1 1 0; min-inline-size: 0; block-size: 100%; font-variant-numeric: var(--numeric); }
.chart-value { color: var(--color-muted); font-size: var(--text-caption); white-space: nowrap; }
.chart-bar { inline-size: 100%; max-inline-size: 20px; block-size: max(3px, calc(var(--share) * 72px)); border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--color-accent-fill); }
.chart-bar.is-empty { border-radius: 0; background: var(--color-fill-strong); }
.chart-label { color: var(--color-muted); font-size: var(--text-caption); white-space: nowrap; min-block-size: 1.25em; }
.chart-label.is-today { color: var(--color-ink); }

/* Legal consent sits with the plans it applies to. */
.account-section > p > a { font-size: var(--text-subhead); }
