/* handtap.ai's frame, shared by every page: colours, type, the sidebar and the top bar.
   The look follows ElevenLabs: near-white and near-black, one ink colour for whatever is chosen, Inter for text
   (with its optical sizes) and Geist Mono for codes and numbers that line up. */
:root {
  --bg: #fcfcfc; --panel: #ffffff; --side: #f8f8f8; --ink: #0c0c0c; --muted: #6b6b6b; --line: #e8e8e8;
  --accent: #0c0c0c; --accent-ink: #ffffff; --brand: #ff5a1f; --soft: #f2f2f2; --hover: #ededed; --danger: #c0392b; --good: #1d7a3a;
  --lift: 0 1px 2px rgba(0, 0, 0, .04);
  --sans: "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --side-width: 260px;
  color-scheme: light dark;
}
/* Dark when the computer is dark and Light was not chosen (the sidebar's switch), or when Dark was. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d0d; --panel: #161616; --side: #111111; --ink: #f2f2f2; --muted: #9d9d9d; --line: #272727;
    --accent: #f2f2f2; --accent-ink: #0c0c0c; --soft: #1d1d1d; --hover: #212121; --danger: #f08b7c; --good: #7fd197;
    --lift: inset 0 1px 0 rgba(255, 255, 255, .03);
  }
}
:root[data-theme="dark"] {
  --bg: #0d0d0d; --panel: #161616; --side: #111111; --ink: #f2f2f2; --muted: #9d9d9d; --line: #272727;
  --accent: #f2f2f2; --accent-ink: #0c0c0c; --soft: #1d1d1d; --hover: #212121; --danger: #f08b7c; --good: #7fd197;
  --lift: inset 0 1px 0 rgba(255, 255, 255, .03);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
/* More contrast when the computer asks for it. */
@media (prefers-contrast: more) { :root { --line: #8a8a8a; --muted: #474747; } }
@media (prefers-contrast: more) and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --line: #737373; --muted: #cfcfcf; } }
@media (prefers-contrast: more) { :root[data-theme="dark"] { --line: #737373; --muted: #cfcfcf; } }

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 0.9375rem; line-height: 1.5;
       font-optical-sizing: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
code, kbd, .mono { font-family: var(--mono); font-size: 0.92em; }
:where(button, select, input, a, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The frame: the sidebar on the left, the page on the right. */
.shell { display: grid; grid-template-columns: var(--side-width) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.shell-main { min-width: 0; container: page / inline-size; }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding: 14px 10px 12px;
           background: var(--side); border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: block; padding: 8px 10px 20px; color: var(--ink); text-decoration: none; white-space: nowrap;
         font-size: 1.375rem; font-weight: 650; letter-spacing: -0.025em; line-height: 1; }
/* The name is one drawing (the wordmark), the hand-h and the letters placed together, so they line up at every screen
   scale: as separate pieces the browser snapped the letters and the picture to whole pixels differently, and the h sat
   half a pixel low at 100 %. Inside, 1 em is 100 units: the h's origin at x 22.2, the baseline at y 76. Inter's letters
   change with size (optical size); the h is fitted to opsz 22 (brand/final_mark.py), so the text is held there. */
.wordmark { display: block; height: .97em; width: auto; overflow: visible; }
.wordmark text { font-family: var(--sans); font-size: 100px; font-weight: 650; letter-spacing: -2.5px; font-variation-settings: "opsz" 22;
                 fill: currentColor; }
.wordmark .brand-dot { fill: var(--brand); }
.wordmark .tld { fill: var(--muted); font-weight: 550; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 12px; min-height: 34px; padding: 6px 10px; border-radius: 9px; color: var(--ink);
              text-decoration: none; font-size: 0.9375rem; font-weight: 450; transition: background-color 120ms ease, transform 160ms var(--ease-out); }
.side-nav a:active { transform: scale(0.98); }
/* The icons are Lucide's (lucide.dev, ISC licence), in the text's own colour, as on ElevenLabs. Sizes follow ElevenLabs,
   Submagic and Claude's sidebars: 15 px text, rows 36 px apart, 20 px icons. */
.side-nav svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round;
                stroke-linejoin: round; color: var(--ink); opacity: .78; }
.side-nav a[aria-current="page"] { background: var(--hover); font-weight: 550; }
.side-nav a[aria-current="page"] svg { opacity: 1; }
.side-nav .count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--ink); color: var(--side);
                   font-size: 0.6875rem; font-weight: 600; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.side-nav .count:empty { display: none; }
.side-label { margin: 22px 10px 8px; font-size: 0.8125rem; font-weight: 500; color: var(--muted); }
.side-foot { margin-top: auto; padding-top: 14px; }

/* The month's credits above the account (built in shell.js), as on ElevenLabs: open on the sidebar, no box, the total,
   what is left and a bar that shrinks as videos are made. */
.usage { margin: 0 0 6px; padding: 4px 9px 10px; }
.usage[hidden] { display: none; }
.usage-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.usage-title { display: inline-flex; align-items: center; gap: 1px; color: var(--ink); font-size: .875rem; font-weight: 600;
               text-decoration: none; }
.usage-title .icon { width: 16px; height: 16px; color: var(--muted); transition: transform 160ms var(--ease-out); }
.usage-upgrade { display: inline-block; padding: 4px 10px; border: 0; border-radius: 8px; background: var(--ink); color: var(--panel);
                 font: inherit; font-size: .75rem; font-weight: 600; line-height: 1.35; text-decoration: none; cursor: pointer;
                 transition: transform 160ms var(--ease-out); }
.usage-upgrade:active { transform: scale(0.96); }
.usage-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: .8125rem; }
.usage-row + .usage-row { margin-top: 5px; }
.usage-label { color: var(--muted); }
.usage-bar { display: block; height: 5px; margin-top: 11px; overflow: hidden; border-radius: 999px;
             background: color-mix(in srgb, var(--ink) 10%, transparent); }
.usage-bar i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--ink); transition: width 500ms var(--ease-out); }
.usage-bar.near i { background: var(--brand); }
.usage-count { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.usage-note { margin: 10px 0 0; color: var(--muted); font-size: .75rem; }
@media (hover: hover) and (pointer: fine) {
  .usage-title:hover .icon { color: var(--ink); transform: translateX(2px); }
  .usage-upgrade:hover { opacity: .86; }
}

/* The account at the foot of the sidebar (built in shell.js): photo or initial, email and plan, opening a menu upwards. */
.account { position: relative; }
.account-button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 8px; border: 1px solid transparent;
                  border-radius: 10px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer;
                  transition: background-color 120ms ease, transform 160ms var(--ease-out); }
.account-button:active { transform: scale(0.98); }
.account.open .account-button { background: var(--hover); }
.account-button > .icon { width: 16px; height: 16px; margin-left: auto; flex: none; color: var(--muted); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: none; overflow: hidden; border-radius: 50%;
          background: var(--brand); color: #fff; font-size: .875rem; font-weight: 650; line-height: 1; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-text { display: grid; gap: 1px; min-width: 0; }
.account-email { overflow: hidden; color: var(--ink); font-size: .875rem; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.account-plan { color: var(--muted); font-size: .8125rem; }
.plan-pill { justify-self: start; margin-top: 3px; padding: 1px 8px; border-radius: 999px; font-size: .6875rem; font-weight: 600;
             color: var(--brand); background: color-mix(in srgb, var(--brand) 13%, transparent); }
.account-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 40; padding: 6px; border: 1px solid var(--line);
                border-radius: 12px; background: var(--panel); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .22), 0 2px 6px rgba(0, 0, 0, .06);
                transform-origin: 50% 100%; opacity: 0; transform: translateY(4px) scale(.98); visibility: hidden; pointer-events: none;
                transition: opacity 140ms ease, transform 200ms var(--ease-out), visibility 0s linear 200ms; }
.account.open .account-menu { opacity: 1; transform: none; visibility: visible; pointer-events: auto;
                              transition: opacity 140ms ease, transform 200ms var(--ease-out); }
.menu-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 6px; }
.menu-sep { height: 1px; margin: 6px 4px; background: var(--line); }
.menu-item, .menu-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 36px; padding: 7px 10px; border: 0;
                        border-radius: 8px; background: none; color: var(--ink); font: inherit; font-size: .9375rem; text-align: left; }
.menu-item { cursor: pointer; transition: background-color 120ms ease; }
.menu-item:focus-visible { outline: none; background: var(--hover); }
.menu-item .icon, .menu-row .icon { width: 19px; height: 19px; flex: none; opacity: .78; }
.menu-upgrade, .menu-upgrade .icon { color: var(--brand); opacity: 1; }
/* The theme switch sits inside the row's padding: 3 choices at 4 px a side fit the 260 px sidebar's menu with room. */
.menu-row { gap: 10px; }
.menu-row .theme { flex: none; margin-left: auto; }
.menu-row .theme span { padding: 2px 4px; font-size: .75rem; }
.icon { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) and (pointer: fine) {
  .account-button:hover { background: var(--hover); }
  .menu-item:hover { background: var(--hover); }
}

/* A short note at the bottom of the window (toast in shell.js). */
.toast { position: fixed; left: 50%; bottom: 20px; z-index: 50; max-width: calc(100vw - 32px); padding: 9px 14px; border: 1px solid var(--line);
         border-radius: 10px; background: var(--panel); color: var(--ink); font-size: .875rem; box-shadow: 0 12px 32px -10px rgba(0, 0, 0, .25);
         transform: translate(-50%, 8px); opacity: 0; pointer-events: none; transition: opacity 160ms ease, transform 220ms var(--ease-out); }
.toast.shown { transform: translate(-50%, 0); opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .account-menu, .account.open .account-menu, .toast, .account-button, .usage-bar i, .usage-title .icon { transition: none; }
  .account-button:active, .usage-upgrade:active { transform: none; }
}

/* The top bar: the page's name, and on a narrow screen the button that opens the sidebar. */
.topbar { display: flex; align-items: center; gap: 10px 14px; min-height: 56px; padding: 10px 24px; border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font-size: 0.9375rem; font-weight: 550; letter-spacing: -0.01em; white-space: nowrap; }
.topbar p { margin: 0; min-width: 0; color: var(--muted); font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-toggle { display: none; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 9px;
               background: var(--panel); color: var(--ink); cursor: pointer; transition: transform 160ms var(--ease-out); }
.side-toggle:active { transform: scale(0.94); }
.side-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.top-brand { display: none; }
.scrim { display: none; }

/* The top bar's Feedback box and What's new bell (shell.js), on the right as on ElevenLabs. */
.top-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.top-pop-wrap { position: relative; }
.top-button { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border: 1px solid var(--line);
              border-radius: 9px; background: var(--panel); color: var(--ink); font: inherit; font-size: .875rem; font-weight: 500; cursor: pointer;
              transition: background-color 120ms ease, transform 160ms var(--ease-out); }
.top-button:active { transform: scale(0.96); }
.top-button .icon { width: 16px; height: 16px; }
.top-button.icon-only { width: 34px; padding: 0; justify-content: center; }
.top-button[aria-expanded="true"] { background: var(--hover); }
.news-dot { position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px var(--panel); }
.news-dot[hidden] { display: none; }
.top-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 45; width: 340px; padding: 14px; border: 1px solid var(--line);
           border-radius: 12px; background: var(--panel); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .22), 0 2px 6px rgba(0, 0, 0, .06);
           transform-origin: 100% 0; opacity: 0; transform: translateY(-4px) scale(.98); visibility: hidden; pointer-events: none;
           transition: opacity 140ms ease, transform 200ms var(--ease-out), visibility 0s linear 200ms; }
.top-pop.open { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition: opacity 140ms ease, transform 200ms var(--ease-out); }
.top-pop.news { width: 360px; }
.pop-title { margin: 0 0 10px; font-size: .9375rem; font-weight: 600; }
.pop-text { display: block; width: 100%; min-height: 96px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; resize: vertical;
            background: var(--bg); color: var(--ink); font: inherit; font-size: .875rem; }
.pop-text:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.pop-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; color: var(--muted); font-size: .75rem; }
.pop-send { padding: 6px 14px; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font: inherit; font-size: .8125rem;
            font-weight: 600; cursor: pointer; }
.pop-send:disabled { opacity: .6; cursor: default; }
.news-list { display: grid; max-height: min(60vh, 440px); margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.news-list li { display: grid; gap: 2px; padding: 11px 0; border-top: 1px solid var(--line); }
.news-list li:first-child { padding-top: 0; border-top: 0; }
.news-list time { color: var(--muted); font-size: .75rem; }
.news-list strong { font-size: .875rem; font-weight: 600; }
.news-list span { color: var(--muted); font-size: .8125rem; }
.news-list a { display: inline-flex; align-items: center; gap: 2px; justify-self: start; margin-top: 4px; color: var(--ink); font-size: .8125rem;
               font-weight: 550; text-decoration: none; }
.news-list a .icon { width: 14px; height: 14px; }
@media (hover: hover) and (pointer: fine) {
  .top-button:hover { background: var(--hover); }
  .news-list a:hover { text-decoration: underline; }
}
@media (prefers-reduced-motion: reduce) { .top-pop, .top-pop.open, .top-button { transition: none; } .top-button:active { transform: none; } }

/* Narrow screens: the sidebar slides in over the page from the menu button. */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: min(280px, 84vw); transform: translateX(-100%); visibility: hidden;
             transition: transform 300ms var(--ease-out), visibility 0s linear 300ms; }
  .shell.open .sidebar { transform: none; visibility: visible; box-shadow: 0 0 48px rgba(0, 0, 0, .28); transition: transform 300ms var(--ease-out); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 29; background: rgba(0, 0, 0, .34); opacity: 0; pointer-events: none;
           transition: opacity 220ms ease; }
  .shell.open .scrim { opacity: 1; pointer-events: auto; }
  .topbar { position: sticky; top: 0; z-index: 10; min-height: 52px; padding: 8px 12px; background: color-mix(in srgb, var(--bg) 86%, transparent);
            -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); }
  .side-toggle { display: inline-grid; }
  .top-brand { display: block; margin-left: auto; color: var(--ink); text-decoration: none; white-space: nowrap;
               font-size: 1.125rem; font-weight: 650; letter-spacing: -0.025em; line-height: 1; }
  .topbar p { display: none; }
  /* The top bar's buttons shrink to icons, sit before the name, and their boxes open across the screen. */
  .top-button { width: 34px; padding: 0; justify-content: center; }
  .top-button span { display: none; }
  .top-actions + .top-brand { margin-left: 10px; }
  .top-pop, .top-pop.news { position: fixed; top: 60px; left: 12px; right: 12px; width: auto; }
}
@media (hover: hover) and (pointer: fine) {
  .side-nav a:hover { background: var(--hover); }
  .side-toggle:hover { border-color: var(--muted); }
}

/* The theme switch at the foot of the sidebar, and switches like it (.switch: Monthly / Yearly on the Plans page): the
   choice is a white pill on a grey track, as on ElevenLabs. */
.theme, .switch { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
.theme label, .switch label { position: relative; }
.theme input, .switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.theme span, .switch span { display: block; padding: 3px 9px; border-radius: 7px; font-size: 0.8125rem; color: var(--muted); cursor: pointer;
                            transition: transform 160ms var(--ease-out), color 200ms ease; }
.theme input:checked + span, .switch input:checked + span { background: var(--panel); color: var(--ink); font-weight: 550; box-shadow: 0 0 0 1px var(--line); }
.theme input:focus-visible + span, .switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.theme span:active, .switch span:active { transform: scale(0.96); }
/* A switch's choice is a pill that slides to it, as on iOS (placeThumbs in shell.js). */
.theme, .switch { position: relative; isolation: isolate; }
.seg-thumb { position: absolute; top: 2px; bottom: 2px; left: 0; width: 0; border-radius: 7px; background: var(--accent); z-index: -1;
             transition: transform 260ms var(--ease-out), width 260ms var(--ease-out), opacity 120ms ease; pointer-events: none; }
.theme .seg-thumb, .switch .seg-thumb { background: var(--panel); box-shadow: 0 0 0 1px var(--line), 0 1px 3px rgba(0, 0, 0, .1); }
.theme:has(.seg-thumb) input:checked + span, .switch:has(.seg-thumb) input:checked + span { background: transparent; box-shadow: none; }
/* A switch of theme eases the colours over, rather than flashing from dark to light. */
.theme-switching, .theme-switching * { transition: background-color 220ms ease, color 220ms ease, border-color 220ms ease, box-shadow 220ms ease !important; }

@media (prefers-reduced-motion: reduce) {
  .sidebar, .shell.open .sidebar, .scrim, .seg-thumb, .theme span, .switch span, .side-nav a, .side-toggle { transition: none; }
  .seg-thumb { transition: opacity 120ms ease; }
  .side-nav a:active, .theme span:active, .switch span:active, .side-toggle:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
}

/* ---- Page kit -------------------------------------------------------------------------------------------------------
   The parts every account page is built from (Settings, Billing, Usage, Developers, Referral; Plans has its own copy).
   Scoped to main.page so the Create page's own styles are untouched. Centred like Home, as on ElevenLabs. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
main.page { max-width: 1180px; margin: 0 auto; padding: 64px 32px 72px; }
main.page.narrow { max-width: 880px; }
@container page (max-width: 600px) { main.page { padding: 22px 16px 48px; } }
.page .page-heading { margin: 0 0 8px; font-size: 1.875rem; font-weight: 650; letter-spacing: -0.025em; line-height: 1.15; }
.page .page-lead { margin: 0 0 28px; color: var(--muted); }
@container page (max-width: 600px) { .page .page-heading { font-size: 1.5rem; } .page .page-lead { margin-bottom: 20px; } }
.page h2 { margin: 0; font-size: 1.125rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; }
.page h3 { margin: 0; font-size: .9375rem; font-weight: 600; }
.page p { margin: 0; }
.page .muted { color: var(--muted); }
.page .small { font-size: .8125rem; }
.page .section { margin-top: 44px; }
.page .section-head { display: flex; align-items: end; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; margin-bottom: 14px; }
.page .section-head p { margin-top: 4px; color: var(--muted); font-size: .875rem; }
.page .grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.page .grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@container page (max-width: 760px) { .page .grid-2, .page .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.page .panel { padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: var(--lift); }
.page .panel + .panel { margin-top: 12px; }
.page :is(.grid-2, .grid-3) > .panel + .panel { margin-top: 0; }  /* side by side in a grid, the gap does the spacing */
.page [hidden] { display: none !important; }  /* the kit's own display (grid, flex) must not bring a hidden part back */
.page .stat { font-size: 1.625rem; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }

/* Buttons: plain, primary (ink), danger (red text), small. */
.page .button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 7px 14px;
                border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font: inherit;
                font-size: .875rem; font-weight: 550; text-decoration: none; white-space: nowrap; cursor: pointer;
                transition: transform 160ms var(--ease-out), background-color 120ms ease; }
.page .button .icon { width: 16px; height: 16px; }
.page .button.primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.page .button.danger { color: var(--danger); }
.page .button.small { min-height: 32px; padding: 4px 10px; font-size: .8125rem; border-radius: 8px; }
.page .button:disabled { color: var(--muted); cursor: default; opacity: .7; }
.page .button:not(:disabled):active { transform: scale(0.97); }
.page .icon-button { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid transparent;
                     border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.page .icon-button .icon { width: 16px; height: 16px; }

/* Fields: a label over an input, select or textarea, with an optional hint under it. */
.page .field { display: grid; gap: 6px; }
.page .field > span { color: var(--muted); font-size: .8125rem; font-weight: 500; }
.page .field .hint { color: var(--muted); font-size: .75rem; }
.page .input { width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
               color: var(--ink); font: inherit; font-size: .875rem; }
.page textarea.input { min-height: 96px; resize: vertical; }
.page .input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.page .input[readonly] { color: var(--muted); }
.page .code { font-family: var(--mono); font-size: .8125rem; }

/* A settings row: what it is on the left, its control on the right, a line between rows. */
.page .rows { border-top: 1px solid var(--line); }
.page .row { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.page .row > div:first-child { min-width: 0; }
.page .row p { margin-top: 2px; color: var(--muted); font-size: .8125rem; }
@container page (max-width: 600px) { .page .row.stack { flex-direction: column; align-items: stretch; } }

/* An on/off switch: <label class="toggle"><input type="checkbox" role="switch"><span></span></label>. */
.page .toggle { position: relative; display: inline-block; flex: none; width: 38px; height: 22px; }
.page .toggle input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.page .toggle span { position: absolute; inset: 0; border-radius: 999px; background: color-mix(in srgb, var(--ink) 18%, transparent);
                     transition: background-color 160ms ease; pointer-events: none; }
.page .toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
                            box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform 200ms var(--ease-out); }
.page .toggle input:checked + span { background: var(--accent); }
.page .toggle input:checked + span::after { transform: translateX(16px); background: var(--accent-ink); }
.page .toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Tables of records. On a phone the wrapper scrolls sideways rather than the page. */
.page .table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.page table.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.page .table th, .page .table td { padding: 11px 16px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.page .table thead th { color: var(--muted); font-size: .8125rem; font-weight: 500; background: var(--soft); }
.page .table tbody tr:last-child td { border-bottom: 0; }
.page .table td.num, .page .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Small labels: status tags and the orange "new" tag. */
.page .tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; background: var(--soft);
             color: var(--muted); font-size: .75rem; font-weight: 550; white-space: nowrap; }
.page .tag.good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.page .tag.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.page .tag.brand { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }

/* Tabs under the heading, underlined, as on ElevenLabs' Subscription page. Buttons with aria-selected. */
.page .tabs { display: flex; gap: 4px; margin-bottom: 28px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.page .tabs button { flex: none; padding: 9px 12px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none;
                     color: var(--muted); font: inherit; font-size: .9375rem; cursor: pointer; }
.page .tabs button[aria-selected="true"] { border-bottom-color: var(--ink); color: var(--ink); font-weight: 550; }

/* A bar of something used against a limit. */
.page .meter { display: block; height: 8px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--ink) 9%, transparent); }
.page .meter i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--ink); transition: width 600ms var(--ease-out); }
.page .meter.near i { background: var(--brand); }

/* Nothing here yet: a short line and what to do next. */
.page .empty { display: grid; justify-items: center; gap: 8px; padding: 40px 20px; border: 1px dashed var(--line); border-radius: 14px;
               color: var(--muted); text-align: center; }
.page .empty .icon { width: 22px; height: 22px; }
.page .empty strong { color: var(--ink); font-weight: 600; }

@media (hover: hover) and (pointer: fine) {
  .page .button:not(:disabled):not(.primary):hover { background: var(--hover); }
  .page .button.primary:not(:disabled):hover { opacity: .88; }
  .page .icon-button:hover { background: var(--hover); color: var(--ink); }
  .page .tabs button:hover { color: var(--ink); }
}
@media (prefers-reduced-motion: reduce) {
  .page .button, .page .toggle span, .page .toggle span::after, .page .meter i { transition: none; }
  .page .button:not(:disabled):active { transform: none; }
}
