/* account.authorwerks.com: authorwerks.com's look (its colors, type and components), with forms
   and account panels of its own. */
:root {
  color-scheme: light dark;
  --ground: #110d22;
  --surface: #1a1533;
  --surface-2: #211b3f;
  --rule: #2f2754;
  --violet: #785ed9;
  --violet-mid: #6c51d7;
  --violet-deep: #6042d3;
  --handle: #4a30b4;
  --violet-light: #a996ef;
  --lavender: #ddd7f6;
  --text: #f1eefb;
  --muted: #b4abd3;
  --good: #7fd1a7;
  --warn: #f2c66d;
  --bad: #ff9d9d;

  --display: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* The page width, the same on every Authorwerks site (docs.authorwerks.com set it). */
  --wrap: 76rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);

  /* The glow behind the top of the page, and the menus' shadow, which change with the theme. */
  --glow-1: rgba(96, 66, 211, 0.30);
  --glow-2: rgba(64, 38, 162, 0.32);
  --shadow: rgb(0 0 0 / 0.35);
}

/* Light theme, for browsers set to light mode (as on authorwerks.com). */
@media (prefers-color-scheme: light) {
  :root {
    --ground: #f6f4fc;
    --surface: #ffffff;
    --surface-2: #efebfa;
    --rule: #ddd6f2;
    --violet-light: #5b3fd0;
    --lavender: #3a2891;
    --text: #1d1838;
    --muted: #5a5478;
    --good: #1d7a4c;
    --warn: #8a5800;
    --bad: #b42318;
    --glow-1: rgba(120, 94, 217, 0.14);
    --glow-2: rgba(96, 66, 211, 0.10);
    --shadow: rgb(29 24 56 / 0.16);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(60rem 26rem at 15% -10%, var(--glow-1), transparent 70%),
    radial-gradient(40rem 22rem at 100% 0%, var(--glow-2), transparent 70%),
    var(--ground);
  background-repeat: no-repeat;
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--body);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--violet-light); }
a:focus-visible, .btn:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--lavender);
  outline-offset: 3px;
  border-radius: 4px;
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); width: 100%; }
.label { font: 500 0.8125rem/1.3 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--violet-light); }
.muted { color: var(--muted); }

/* The Spanish offer. (The footer is authorwerks.com's, see _inc/layout.php.) */
/* The header (menu bar) is authorwerks.com's assets/site-header.css, loaded from there (see _inc/layout.php). */
.inline-form { display: inline; margin: 0; }

/* Buttons, as on authorwerks.com. */
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.3rem;
  border-radius: 0.6rem;
  font: 600 1rem/1.2 var(--body);
  text-decoration: none;
  background: linear-gradient(180deg, var(--violet), var(--violet-mid));
  color: #fff;
  border: 1px solid var(--violet-deep);
  box-shadow: 0 2px 0 var(--handle);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover, button:hover { transform: translateY(-1px); box-shadow: 0 3px 0 var(--handle); }
.btn:active, button:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--handle); }
.btn.small, button.small { padding: 0.45rem 0.9rem; font-size: 0.95rem; }
.btn.ghost, button.ghost { background: none; color: var(--lavender); border-color: var(--rule); box-shadow: none; }
.btn.ghost:hover, button.ghost:hover { border-color: var(--violet-light); }
button.danger { background: none; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); box-shadow: none; }
button.danger:hover { border-color: var(--bad); }
.btn.wide, button.wide { width: 100%; }

/* Pages. */
.page { padding-block: clamp(2rem, 6vw, 3.5rem); display: grid; gap: 1.5rem; align-content: start; }
.page-narrow { max-width: 30rem; }
/* The account page (and its admin views): as wide as the menu bar and authorwerks.com's pages. */
.page-wide { max-width: var(--wrap); }
.page-head { display: grid; gap: 0.5rem; }
.page-head h1 { font-size: clamp(1.9rem, 5vw, 2.5rem); }
.page-head p { color: var(--muted); }

.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0.9rem;
  padding: clamp(1.25rem, 4vw, 1.75rem);
  display: grid;
  gap: 1.1rem;
  min-width: 0;
}
.panel > h2 { font-size: 1.35rem; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem 1rem; flex-wrap: wrap; }
.panel-head h2 { font-size: 1.35rem; }

/* Forms. */
form.stack { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.4rem; }
.field label { font-weight: 500; }
.field .hint { color: var(--muted); font-size: 0.9rem; }
/* Google reCAPTCHA on the sign-up form: the checkbox (v2) is a fixed 304px wide; narrower screens scale it. */
.recaptcha { min-height: 78px; }
@media (max-width: 23rem) { .g-recaptcha { transform: scale(0.88); transform-origin: 0 0; } }
.recaptcha-note { color: var(--muted); font-size: 0.85rem; }
.recaptcha-note a { color: var(--violet-light); }
/* reCAPTCHA v3's floating badge: hidden, since the form carries Google's required notice and links
   instead (allowed by Google; see _inc/recaptcha.php). visibility, not display, so it still works. */
.grecaptcha-badge { visibility: hidden; }
input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="date"] {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 0.55rem;
  border: 1px solid var(--rule);
  background: var(--ground);
  color: var(--text);
  font: 400 1rem/1.3 var(--body);
}
input:focus { border-color: var(--violet-light); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet-light) 25%, transparent); }
.check { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--violet); }
.form-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem; font-size: 0.95rem; }
.alt { text-align: center; color: var(--muted); }

/* Messages. */
.notice { padding: 0.8rem 1rem; border-radius: 0.6rem; border: 1px solid; font-size: 0.97rem; }
.notice ul { margin: 0; padding-left: 1.1rem; }
.notice-ok { border-color: color-mix(in srgb, var(--good) 45%, transparent); background: color-mix(in srgb, var(--good) 10%, transparent); }
.notice-info { border-color: color-mix(in srgb, var(--violet-light) 45%, transparent); background: color-mix(in srgb, var(--violet-light) 10%, transparent); }
.notice-warn { border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.notice-error { border-color: color-mix(in srgb, var(--bad) 50%, transparent); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.notice .inline-form button { margin-left: 0.5rem; }

/* Account details. */
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.6rem 1.5rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 0.1rem 0.6rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; border: 1px solid; vertical-align: 0.1em; }
.badge-good { color: var(--good); border-color: color-mix(in srgb, var(--good) 50%, transparent); }
.badge-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.badge-off { color: var(--muted); border-color: var(--rule); }
.badge-bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }

/* Product keys and the computers they're on. */
.keys { display: grid; gap: 1rem; }
.key { border: 1px solid var(--rule); border-radius: 0.7rem; padding: 1rem 1.1rem; display: grid; gap: 0.75rem; background: var(--ground); }
.key-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem 1rem; flex-wrap: wrap; }
.key code { font: 500 1rem/1.3 var(--mono); letter-spacing: 0.04em; color: var(--lavender); overflow-wrap: anywhere; }
.computers { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.computers li { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem 1rem; flex-wrap: wrap; padding-top: 0.5rem; border-top: 1px solid var(--rule); }
.computers .name { font-weight: 500; }
.computers .meta { color: var(--muted); font-size: 0.9rem; }

/* First and last name side by side (sign-up, account page); one above the other on a narrow phone. */
.name-row { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 23rem) { .name-row { grid-template-columns: 1fr; } }
.two-col { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }

@media (max-width: 30rem) {
  .facts { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; }
  .facts dd { margin-bottom: 0.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, button { transition: none; }
}
.panel h3 { font-size: 1.1rem; }

/* Admins (see _inc/admin.php): the menu under the heading, and the System Survey view. */
.admin-menu { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; margin-top: 0.4rem; color: var(--rule); font-weight: 500; }
.admin-menu a { color: var(--muted); text-decoration: none; padding: 0.2rem 0; }
.admin-menu a:hover { color: var(--lavender); }
.admin-menu a[aria-current="page"] { color: var(--lavender); text-decoration: underline; text-decoration-color: var(--violet-light); text-underline-offset: 0.4em; }
.badge-admin { color: var(--violet-light); border-color: color-mix(in srgb, var(--violet-light) 50%, transparent); }
.survey-hero { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem 3rem; }
.survey-figure { margin: 0; font: 600 clamp(2.5rem, 7vw, 3.5rem)/1 var(--display); font-variant-numeric: tabular-nums; }
.survey-grid { display: grid; gap: 1rem; align-items: start; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.survey-card { min-width: 0; }
.survey-card h2 { font-size: 1.15rem; }
.survey-note { margin: 0.2rem 0 0.8rem; font-size: 0.875rem; }
.survey-bars { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.survey-bars thead th { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.survey-bars th[scope="row"] { text-align: left; font-weight: 400; padding: 0.3rem 0.75rem 0.3rem 0; width: 40%; overflow-wrap: anywhere; }
.survey-bars td { padding: 0.3rem 0; }
.survey-bars td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 0.75rem; width: 1%; }
.survey-bars tr:hover th, .survey-bars tr:hover td.num { color: var(--text); }
.survey-bar { display: block; height: 0.8rem; background: var(--violet); border-radius: 0 4px 4px 0; }
.survey-bars tr:hover .survey-bar { background: var(--violet-light); }
.survey-bar.w0 { width: 0%; }
.survey-bar.w1 { width: 10%; }
.survey-bar.w2 { width: 20%; }
.survey-bar.w3 { width: 30%; }
.survey-bar.w4 { width: 40%; }
.survey-bar.w5 { width: 50%; }
.survey-bar.w6 { width: 60%; }
.survey-bar.w7 { width: 70%; }
.survey-bar.w8 { width: 80%; }
.survey-bar.w9 { width: 90%; }
.survey-bar.w10 { width: 100%; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* User administration (_inc/admin_users.php). */
select, textarea {
  font: inherit; color: var(--text); background: var(--ground);
  border: 1px solid var(--rule); border-radius: 0.5rem; padding: 0.55rem 0.7rem; width: 100%;
}
textarea { resize: vertical; min-height: 6rem; }
select:focus-visible, textarea:focus-visible { outline: 3px solid var(--lavender); outline-offset: 3px; }
label.check { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.95rem; color: var(--muted); }
label.check input { margin-top: 0.3rem; accent-color: var(--violet); }
.admin-search { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 0.75rem 1rem; align-items: end; }
@media (max-width: 40rem) { .admin-search { grid-template-columns: 1fr; } }
.admin-table-wrap { position: relative; overflow-x: auto; margin-inline: -0.25rem; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.admin-table th, .admin-table td { text-align: left; padding: 0.55rem 0.5rem; border-top: 1px solid var(--rule); vertical-align: middle; }
.admin-table thead th { border-top: 0; color: var(--muted); font-weight: 500; font-size: 0.85rem; white-space: nowrap; }
.admin-table th[scope="row"] { font-weight: 500; }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table form { margin: 0; }
/* Use-of-quota meters (users list and one account): the accent color, yellow from 75%, red from 90%. */
.meter { display: grid; gap: 0.3rem; min-width: 8.5rem; }
.meter-text { font-size: 0.85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter-bar { display: block; width: 100%; height: 0.4rem; border-radius: 999px; background: var(--rule); overflow: hidden; }
.meter-bar rect { fill: var(--violet); }
.meter-warn .meter-bar rect { fill: var(--warn); }
.meter-warn .meter-text { color: var(--warn); }
.meter-bad .meter-bar rect { fill: var(--bad); }
.meter-bad .meter-text { color: var(--bad); }
.admin-table .badge { white-space: nowrap; }
.admin-usage { margin: 1rem 0; grid-template-columns: minmax(0, 1fr); gap: 0.3rem; }
.admin-usage dd { margin-bottom: 0.6rem; }
.admin-usage dd .meter { min-width: 0; max-width: 20rem; }
.admin-usage dd .hint { display: block; margin-top: 0.25rem; color: var(--muted); font-size: 0.85rem; }
.admin-pages { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; }
.admin-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); align-items: start; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.admin-danger { border-color: color-mix(in srgb, var(--bad) 35%, var(--rule)); }
.admin-danger hr { border: 0; border-top: 1px solid var(--rule); margin: 1.25rem 0; }
input[type="date"], input[type="search"] { color-scheme: light dark; }
input[type="search"] { appearance: none; }

/* Cloud Projects (_inc/projects.php): the projects as the app lists them, each with its books as a tree. */
.icon { flex: none; vertical-align: -0.2em; }
.btn .icon { width: 1.05em; height: 1.05em; margin-right: 0.4em; vertical-align: -0.15em; }
.projects { list-style: none; margin: 1.25rem 0 0; padding: 0; }
.project { padding: 0.9rem 0; border-top: 1px solid var(--rule); }
.project:first-child { border-top: 0; padding-top: 0.25rem; }
.project-row { display: flex; align-items: center; gap: 0.85rem; }
.project-icon { flex: none; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 0.6rem; background: color-mix(in srgb, var(--violet) 18%, transparent); color: var(--violet-light); }
.project-icon .icon { width: 1.3rem; height: 1.3rem; }
.project-text { flex: 1; min-width: 0; }
.project-name { font-weight: 600; overflow-wrap: anywhere; }
.project-meta { color: var(--muted); font-size: 0.88rem; margin-top: 0.15rem; }
.project-meta .badge { font-size: 0.75rem; margin-right: 0.35rem; }
.project-download { flex: none; }
.project-tree { list-style: none; margin: 0.5rem 0 0 1.2rem; padding: 0 0 0 1.95rem; border-left: 1px solid var(--rule); }
.project-tree li { display: flex; align-items: center; gap: 0.5rem; padding: 0.22rem 0; font-size: 0.95rem; }
.project-tree .icon { width: 1rem; height: 1rem; color: var(--muted); }
.book-number { flex: none; min-width: 1.35rem; padding: 0 0.3rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--rule); color: var(--muted); font-size: 0.75rem; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.book-name { overflow-wrap: anywhere; }
.project-tree-empty { margin: 0.4rem 0 0 3.25rem; color: var(--muted); font-size: 0.9rem; font-style: italic; }
@media (max-width: 30rem) {
  .project-download span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .project-download .icon { margin-right: 0; }
  .project-tree { margin-left: 1.2rem; padding-left: 1rem; }
  .project-tree-empty { margin-left: 2.4rem; }
}
.book-length { margin-left: auto; padding-left: 1rem; color: var(--muted); font-size: 0.85rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.admin-grid > .admin-wide { grid-column: 1 / -1; }

/* The views menu's Admin entry (admins only): a submenu of the admin-only views (System Survey,
   Users), opened by clicking it; assets/view-menu.js closes it on a click outside or Escape. */
.view-submenu { position: relative; }
.view-submenu summary { list-style: none; display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.2rem 0; color: var(--muted); cursor: pointer; }
.view-submenu summary::-webkit-details-marker { display: none; }
.view-submenu summary:hover, .view-submenu[open] summary { color: var(--lavender); }
.view-submenu summary:focus-visible { outline: 3px solid var(--lavender); outline-offset: 3px; border-radius: 0.2rem; }
.view-submenu.is-current summary { color: var(--lavender); text-decoration: underline; text-decoration-color: var(--violet-light); text-underline-offset: 0.4em; }
.view-submenu summary svg { transition: transform 0.15s; }
.view-submenu[open] summary svg { transform: rotate(180deg); }
.view-submenu ul { position: absolute; z-index: 20; top: calc(100% + 0.35rem); left: 0; min-width: 12rem; margin: 0; padding: 0.35rem; list-style: none; background: var(--surface); border: 1px solid var(--rule); border-radius: 0.6rem; box-shadow: 0 10px 30px var(--shadow); }
.view-submenu li a { display: block; padding: 0.5rem 0.75rem; border-radius: 0.4rem; color: var(--text); text-decoration: none; white-space: nowrap; }
.view-submenu li a:hover, .view-submenu li a:focus-visible { background: var(--surface-2); color: var(--lavender); }
.view-submenu li a[aria-current="page"] { color: var(--lavender); text-decoration: none; background: color-mix(in srgb, var(--violet) 18%, transparent); }

/* The admin Users list (_inc/admin_users.php): one row per account showing its name, email and
   subscription; opened, the rest in a grid, and a Debug section (cloud sync use) under that. */
.user-list-head, .user-entry > summary { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) minmax(0, 0.9fr) 1.25rem; gap: 0.75rem; align-items: center; }
.user-list-head { padding: 0 0.6rem 0.5rem; color: var(--muted); font-size: 0.85rem; font-weight: 500; }
.user-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.user-list > li { border-bottom: 1px solid var(--rule); }
.user-entry > summary { list-style: none; cursor: pointer; padding: 0.7rem 0.6rem; border-radius: 0.5rem; }
.user-entry > summary::-webkit-details-marker { display: none; }
.user-entry > summary:hover { background: var(--surface-2); }
.user-entry > summary:focus-visible { outline: 3px solid var(--lavender); outline-offset: -3px; }
.user-name { font-weight: 500; overflow-wrap: anywhere; font-size: 0.9rem; }
.user-name .badge { margin-left: 0.3rem; }
.user-email { overflow-wrap: anywhere; color: var(--text); font-size: 0.9rem; }
.user-chevron { color: var(--muted); transition: transform 0.15s; justify-self: end; }
.user-entry[open] > summary .user-chevron { transform: rotate(180deg); }
.user-body { margin: 0 0 0.75rem; padding: 1rem 1.1rem 1.1rem; border-radius: 0.6rem; background: color-mix(in srgb, var(--ground) 60%, var(--surface)); border: 1px solid color-mix(in srgb, var(--rule) 70%, transparent); }
.user-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: 0.9rem 1.5rem; margin: 0; }
.user-facts dt { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.25rem; }
.user-facts dd { margin: 0; }
.user-facts .meter { max-width: 16rem; }
.user-open { margin: 1rem 0 0; }
.user-debug { margin-top: 1rem; }
.user-debug > summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; font-weight: 500; width: fit-content; }
.user-debug > summary:hover, .user-debug[open] > summary { color: var(--lavender); }
.user-debug > summary h2 { display: inline; }
.user-debug > p { font-size: 0.9rem; margin: 0.6rem 0; }
.debug-table { font-size: 0.88rem; }
.debug-table th[scope="row"] { font-weight: 400; }
.debug-table .num { white-space: nowrap; }
.debug-group th { color: var(--lavender); font-weight: 600; padding-top: 0.9rem; border-top: 0; }
.debug-total th, .debug-total td { font-weight: 600; }
@media (max-width: 40rem) {
  .user-list-head { display: none; }
  .user-entry > summary { grid-template-columns: minmax(0, 1fr) auto 1.25rem; row-gap: 0.2rem; }
  .user-name { grid-column: 1; grid-row: 1; }
  .user-plan { grid-column: 2; grid-row: 1; }
  .user-chevron { grid-column: 3; grid-row: 1; }
  .user-email { grid-column: 1 / -1; grid-row: 2; color: var(--muted); font-size: 0.85rem; }
}

/* An account's page (admin): a summary, then tabs, one section shown at a time. */
.admin-back { margin: 0 0 0.75rem; }
.user-summary .panel-head { align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.user-summary-email { color: var(--muted); margin-top: 0.2rem; overflow-wrap: anywhere; }
.user-summary-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.user-summary .user-facts { margin-top: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); }
/* An account's tabs: never a scrolling strip; on a narrow screen they wrap onto another line. */
.user-tabs { display: flex; flex-wrap: wrap; gap: 0 0.25rem; margin: 1.5rem 0 1rem; border-bottom: 1px solid var(--rule); overflow: visible; }
.user-tabs a { flex: none; padding: 0.6rem 0.9rem; color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 0.4rem 0.4rem 0 0; }
.user-tabs a:hover { color: var(--lavender); background: var(--surface); }
.user-tabs a[aria-current="page"] { color: var(--lavender); border-bottom-color: var(--violet-light); }
.user-tabs a.is-danger { margin-left: auto; }
.user-tabs a.is-danger:hover, .user-tabs a.is-danger[aria-current="page"] { color: var(--bad); border-bottom-color: var(--bad); }
.tab-count { display: inline-block; min-width: 1.4rem; margin-left: 0.25rem; padding: 0 0.35rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--rule); color: var(--muted); font-size: 0.75rem; text-align: center; font-variant-numeric: tabular-nums; }
.user-tab-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); align-items: start; }
.user-tab-grid > .panel { margin: 0; }
.admin-danger .user-tab-grid > div > p:first-child { margin-top: 0; }
.admin-table.compact th, .admin-table.compact td { padding-top: 0.35rem; padding-bottom: 0.35rem; }
.admin-table.compact button.small { padding: 0.25rem 0.7rem; font-size: 0.85rem; }
/* Grid children may shrink below their content's width, so a wide table scrolls in its own box
   (.admin-table-wrap) instead of widening the page on a phone. */
.page > *, .panel > * { min-width: 0; }

/* An account's tabs (assets/user-tabs.js): every section stacked in the same place, only the
   current one shown, so the area is as tall as the tallest and switching doesn't move the page. */
.user-tab-panels { display: grid; }
.user-tab-panel { grid-area: 1 / 1; display: grid; gap: 1.5rem; align-content: start; min-width: 0; }
.user-tab-panel:not(.is-active) { visibility: hidden; }
.user-tabs { scroll-margin-top: 1rem; }
/* A long list of sign-ins scrolls in its own box, so it doesn't make every tab that tall. */
.signins-scroll { max-height: 34rem; overflow-y: auto; }
.signins-scroll thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }

/* The API's use (_inc/admin_api.php): API Usage's figures and functions, and Live API's table. */
.api-stats { display: grid; gap: 1rem 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
.api-stat-figure { font: 600 clamp(1.9rem, 5vw, 2.6rem)/1.1 var(--display); font-variant-numeric: tabular-nums; margin-top: 0.2rem; }
.api-stat-note { font-size: 0.85rem; margin-top: 0.2rem; }
.api-fn { font: 500 0.82rem/1.4 var(--mono); white-space: nowrap; color: var(--text); }
.api-method { display: inline-block; min-width: 2.6em; color: var(--violet-light); }
.api-fn-label { display: block; font-size: 0.8rem; color: var(--muted); font-weight: 400; }
.api-fn-table th[scope="row"] { font-weight: 400; }
.api-fn-table tfoot th, .api-fn-table tfoot td { border-top: 2px solid var(--rule); }
.api-error-count { color: var(--warn); font-weight: 600; }
.api-ip { font: 500 0.82rem/1.4 var(--mono); white-space: nowrap; }
.api-time { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); }
.api-live-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; font-size: 0.9rem; }
.api-live-filter { max-width: 26rem; margin: 0.25rem 0 0.75rem; }
.api-live-filter input { width: 100%; }
.api-live-scroll { max-height: 40rem; overflow-y: auto; }
.api-live-scroll thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.api-live-table td, .api-live-table th { white-space: nowrap; }
.api-live-table tr.is-new td { animation: api-new 2.4s ease-out; }
@keyframes api-new { from { background: color-mix(in srgb, var(--violet) 22%, transparent); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .api-live-table tr.is-new td { animation: none; } }

/* The Subscription panel: the plans on offer (with PayPal's buttons), and managing one. */
.plan-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.plan-card { border: 1px solid var(--rule); border-radius: 0.7rem; padding: 1rem 1.1rem; display: grid; gap: 0.6rem; align-content: start; background: var(--ground); min-width: 0; }
.plan-card.is-current { border-color: var(--violet-light); }
.plan-card-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.plan-card h4 { margin: 0; font: 600 1.15rem/1.2 var(--display); }
.plan-price { font: 600 1.6rem/1.1 var(--display); font-variant-numeric: tabular-nums; }
.paypal-button { min-height: 45px; margin-top: 0.25rem; }
/* PayPal's frames are light pages: in the dark theme, a frame whose color scheme differs from the
   page gets an opaque white background (the white band around "Powered by PayPal"). Matching it
   keeps the frame see-through. */
.paypal-button iframe { color-scheme: light; }
.plan-note { font-size: 0.9rem; }
.paypal-why { display: block; margin-top: 0.4rem; font: 500 0.8rem/1.4 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.paypal-why[hidden] { display: none; }
.plan-manage { display: flex; flex-wrap: wrap; align-items: start; gap: 1rem 1.5rem; }
.plan-change { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.plan-change label { font-weight: 500; }
.plan-change select { width: auto; max-width: 100%; }
.plan-cancel { display: grid; gap: 0.75rem; }
.plan-cancel summary { list-style: none; cursor: pointer; justify-self: start; }
.plan-cancel summary::-webkit-details-marker { display: none; }
.plan-cancel .stack { max-width: 30rem; }

/* A service from another company that waits for the visitor's consent (_inc/consent.php): reCAPTCHA
   on the sign-up form, PayPal's buttons. Its notice, with the button that allows it. */
.consent-gate { display: grid; gap: 0.6rem; justify-items: start; }
.consent-gate p { margin: 0; }
.consent-gate a { color: var(--violet-light); }
.consent-gate[hidden], [data-aw-consent-wait][hidden] { display: none; }
