/* Page Lemon portal (app.pagelemon.com). Also the staff admin's base stylesheet (admin.css adds to it).
   Two themes from one token set. Light (the default) is pagelemon.com's quiet mode: white cards on a warm off-white
   page, near-black text, the blue --primary for links and the primary button, lemon only as a small accent.
   Dark is a layered palette, not an inversion: page < card < raised (menus, table heads, hovers).
   theme.js sets <html data-theme="light|dark"> before first paint (Light, Dark or System; Light by default).
   Scales: type 12/13/14/15/18/22/26 px, spacing 4/8/12/16/24/32/48 px, radius 8/10/12 px. */

:root {
  --paper: #FAFAF7;        /* page */
  --surface: #FFFFFF;      /* cards, lists, the top bar */
  --raised: #F5F4EF;       /* table heads, row hovers */
  --input: #FFFFFF;
  --bare: #FFF8D6;         /* signed-out pages: pagelemon.com's lemon cream */
  --field: #FFE45C;        /* lemon: the avatar, small accents */
  --ink: #1E1D19;          /* text: 16.4:1 on paper */
  --ink-muted: #5F5D55;    /* 6.4:1 on paper */
  --brand: #1B2A9E;        /* navy: the sign-in page's titles and offset shadows */
  --primary: #2340D8;      /* links and the primary button: 6.8:1 on white */
  --primary-hover: #1B33B5;
  --on-primary: #FFFFFF;
  --alert: #B42318;
  --on-alert: #FFFFFF;
  --ok: #1E7A44;
  --line: rgba(30, 29, 25, 0.10);
  --line-strong: rgba(30, 29, 25, 0.22);
  --control: rgba(30, 29, 25, 0.38);   /* field borders: 3:1 on white */
  --placeholder: #77756C;
  --soft: #FFF6CC;         /* lemon tint: notices, the current plan */
  --selected: rgba(30, 29, 25, 0.06);  /* current tab, hovered menu item */
  --tint: rgba(35, 64, 216, 0.06);
  --alert-tint: rgba(180, 35, 24, 0.06);
  --ok-tint: rgba(30, 122, 68, 0.10);
  --focus: #2340D8;
  --ring: rgba(35, 64, 216, 0.18);
  --skel: rgba(30, 29, 25, 0.07);
  --topbar: rgba(255, 255, 255, 0.88);
  --backdrop: rgba(14, 20, 64, 0.40);

  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --wordmark: "Unbounded", "DM Sans", system-ui, sans-serif;

  --fs-xs: 0.75rem;   /* 12 */
  --fs-sm: 0.8125rem; /* 13: meta, hints */
  --fs-md: 0.875rem;  /* 14: buttons, tables, menus */
  --fs-base: 0.9375rem; /* 15: body */
  --fs-lg: 1.125rem;  /* 18: section titles */
  --fs-xl: 1.375rem;  /* 22 */
  --fs-2xl: 1.625rem; /* 26: page titles */

  --r-sm: 8px;
  --r-btn: 10px;
  --r-md: 12px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(30, 29, 25, 0.05);
  --shadow: 0 1px 2px rgba(30, 29, 25, 0.06), 0 12px 32px rgba(30, 29, 25, 0.10);
  --ease: 160ms ease;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #0F1115;
  --surface: #171A21;
  --raised: #20242D;
  --input: #12151A;
  --bare: #0F1115;
  --field: #FFE45C;
  --ink: #ECEAE3;          /* 15.7:1 paper, 14.5:1 surface */
  --ink-muted: #A9A79F;    /* 7.2:1 surface */
  --brand: #D6DCFF;
  --primary: #A5B4FF;      /* 8.8:1 surface */
  --primary-hover: #BAC6FF;
  --on-primary: #10163A;
  --alert: #FF9C92;
  --on-alert: #2B0B07;
  --ok: #8FD9A8;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --control: rgba(255, 255, 255, 0.36);
  --placeholder: #8A8983;
  --soft: rgba(255, 228, 92, 0.11);
  --selected: rgba(255, 255, 255, 0.07);
  --tint: rgba(165, 180, 255, 0.09);
  --alert-tint: rgba(255, 156, 146, 0.10);
  --ok-tint: rgba(143, 217, 168, 0.12);
  --focus: #C3CDFF;
  --ring: rgba(195, 205, 255, 0.22);
  --skel: rgba(255, 255, 255, 0.07);
  --topbar: rgba(15, 17, 21, 0.86);
  --backdrop: rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* CJK (app.js sets <html lang> and links that language's self-hosted Noto Sans): DM Sans / DM Mono keep
   Latin runs, the CJK face follows, then the system CJK faces for before it loads. Same choices as the
   marketing site's css/i18n.css. */
html:lang(ja) { --cjk: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo; }
html:lang(zh-TW) { --cjk: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Heiti TC"; }
html:lang(zh-CN) { --cjk: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Heiti SC"; }
html:lang(ko) { --cjk: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", "Nanum Gothic"; }
html:is(:lang(ja), :lang(zh-TW), :lang(zh-CN), :lang(ko)) {
  --font: "DM Sans", var(--cjk), system-ui, sans-serif;
  --mono: "DM Mono", var(--cjk), ui-monospace, monospace;
}
html:is(:lang(ja), :lang(zh-TW), :lang(zh-CN), :lang(ko)) body { line-height: 1.7; }
html:is(:lang(ja), :lang(zh-TW), :lang(zh-CN), :lang(ko)) :is(h1, h2, h3) { line-height: 1.4; }
html:is(:lang(ja), :lang(zh-TW), :lang(zh-CN), :lang(ko)) body *:not(.wordmark) { letter-spacing: normal; text-transform: none; }
html:is(:lang(ja), :lang(zh-TW), :lang(zh-CN), :lang(ko)) :is(em, cite) { font-style: normal; }
html:is(:lang(ja), :lang(zh-TW), :lang(zh-CN)) body { line-break: strict; }
html:lang(ko) body { word-break: keep-all; overflow-wrap: anywhere; }
/* Nav labels never split mid-word (ja "AI を接/続"). */
.nav a { white-space: nowrap; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--fs-base)/1.55 var(--font);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font); font-weight: 650; line-height: 1.25; margin: 0; color: var(--ink); }
h1 { font-size: var(--fs-2xl); letter-spacing: -0.015em; }
h2 { font-size: var(--fs-lg); letter-spacing: -0.005em; }
h3 { font-size: var(--fs-base); font-weight: 600; }
p { margin: 0; }
a { color: var(--primary); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code, pre, kbd { font-family: var(--mono); font-size: 0.9em; }
kbd { border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--surface); font-size: 0.85em; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--surface); color: var(--ink); padding: 8px 12px; z-index: 40; border-radius: var(--r-sm); }
.skip:focus { left: 8px; }

.muted { color: var(--ink-muted); }
.small { font-size: var(--fs-sm); }
.mono { font-family: var(--mono); }
.break { overflow-wrap: anywhere; }

/* ---------- Top bar: brand, tabs, Docs, account menu ---------- */

.topbar {
  background: var(--topbar);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 8px 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; flex: none;
  color: var(--ink); text-decoration: none;
}
.wordmark { font-family: var(--wordmark); font-weight: 800; font-size: 1rem; letter-spacing: -0.01em; }
.nav { display: flex; gap: 2px; flex: 1 1 auto; min-width: 0; }
.nav a {
  color: var(--ink-muted); text-decoration: none; font-weight: 500; font-size: var(--fs-md);
  padding: 7px 12px; border-radius: var(--r-sm);
  transition: background var(--ease), color var(--ease);
}
.nav a:hover { color: var(--ink); background: var(--selected); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--selected); font-weight: 600; }
.user { margin-left: auto; display: flex; align-items: center; gap: 6px; min-width: 0; }
.top-link { color: var(--ink-muted); text-decoration: none; font-size: var(--fs-md); font-weight: 500; padding: 7px 10px; border-radius: var(--r-sm); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.top-link:hover { color: var(--ink); background: var(--selected); }
/* The bell: the Notifications page, with the unread count. */
.bell { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--ink-muted); flex: none; }
.bell:hover, .bell[aria-current="page"] { color: var(--ink); background: var(--selected); }
.bell:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.bell .icon { width: 20px; height: 20px; }
.bell-count { position: absolute; top: 1px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--alert); color: var(--on-alert);
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.bell-count[hidden] { display: none; }
.lang-picker { font: inherit; font-size: var(--fs-sm); color: var(--ink); background: var(--input); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 5px 8px; max-width: 150px; min-height: 32px; }
.user-email { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-md); }
.icon { width: 16px; height: 16px; flex: none; }

/* Account menu: who you are, account links, preferences, help, sign out. */
.account-menu { position: relative; }
.account-menu > summary {
  list-style: none; display: grid; place-items: center; cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%; padding: 2px;
  transition: box-shadow var(--ease);
}
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary:hover, .account-menu[open] > summary { box-shadow: 0 0 0 3px var(--selected); }
.account-menu > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 50%; }
.account-label { display: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--field); color: #23221D; font-weight: 700; font-size: var(--fs-md); flex: none; box-shadow: inset 0 0 0 1px rgba(30, 29, 25, 0.08); }
.avatar.lg { width: 44px; height: 44px; font-size: 1.05rem; }
.avatar.xl { width: 56px; height: 56px; font-size: 1.3rem; }
.account-menu .menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 288px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: var(--shadow);
  padding: 6px; display: grid; gap: 1px; z-index: 20;
}
[data-theme="dark"] .account-menu .menu { background: var(--raised); }
.menu-head { display: flex; gap: 12px; align-items: center; padding: 10px 10px 12px; min-width: 0; }
.menu-who { min-width: 0; display: grid; gap: 1px; }
.menu-name { font-weight: 600; font-size: var(--fs-base); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-email { font-size: var(--fs-sm); color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-head .badge { justify-self: start; margin-top: 4px; }
.menu-sep, .account-menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px -6px; width: auto; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0;
  font: 500 var(--fs-md)/1.3 var(--font); color: var(--ink); padding: 8px 10px; border-radius: var(--r-sm);
  cursor: pointer; text-decoration: none; min-height: 36px;
}
.menu-item .icon { color: var(--ink-muted); }
.menu-item:hover, .menu-item:focus-visible { background: var(--selected); }
.menu-item:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.menu-item[aria-current="page"] { font-weight: 600; }
.menu-item[aria-current="page"] .icon { color: var(--ink); }
.menu-item .ext { margin-left: auto; width: 12px; height: 12px; color: var(--ink-muted); }
.menu-item.danger { color: var(--alert); }
.menu-row, .menu-lang { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 10px; font-size: var(--fs-md); min-height: 40px; }
.menu-row > span:first-child, .menu-lang > span:first-child { display: inline-flex; align-items: center; gap: 10px; }
.menu-row > span:first-child .icon, .menu-lang > span:first-child .icon { color: var(--ink-muted); }
.menu-lang .lang-picker, .menu-row .lang-picker { max-width: 140px; }

/* Theme switch: three icon buttons (Light, Dark, System) as a radio group. */
.theme-seg { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--input); }
.theme-seg button { display: grid; place-items: center; width: 30px; height: 26px; border: 0; border-radius: 6px; background: none; color: var(--ink-muted); cursor: pointer; }
.theme-seg button:hover { color: var(--ink); }
.theme-seg button[aria-checked="true"] { background: var(--selected); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.theme-seg.labelled button { width: auto; padding: 0 12px; gap: 6px; display: inline-flex; font: 500 var(--fs-md)/1 var(--font); height: 32px; }

@media (max-width: 720px) {
  .topbar-inner { gap: 6px 8px; padding: 0 16px; min-height: 56px; }
  .brand .wordmark, .top-link { display: none; }
  .nav a { padding: 7px 10px; }
}

/* ---------- Layout ---------- */

.main { max-width: 1120px; margin: 0 auto; padding: 36px 24px 80px; outline: none; }
.main.narrow, .main:has(> .narrow) { max-width: 1120px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head > div:first-child { min-width: 0; flex: 1 1 320px; }
.page-head p { margin-top: 6px; }
.page-head .muted:not(.small) { font-size: var(--fs-base); max-width: 70ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: var(--fs-sm); margin-bottom: 6px; }
.crumb a { color: var(--ink-muted); text-decoration: none; }
.crumb a:hover { color: var(--ink); text-decoration: underline; }
.stack > * + * { margin-top: 16px; }
.section { margin-top: 40px; }
.section > h2 { margin-bottom: 4px; }
.section > .section-lede { margin-bottom: 14px; max-width: 75ch; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.loading { padding: 24px 0; }
@media (max-width: 720px) { .main { padding: 24px 16px 64px; } h1 { font-size: var(--fs-xl); } }

/* ---------- Cards and lists ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
}
.card.centered { max-width: 520px; margin: 32px auto 0; padding: 28px; }
.card.accent { border-top: 3px solid var(--field); }
.card h1 + p, .card h2 + p { margin-top: 6px; }
.card .actions { margin-top: 16px; }
@media (max-width: 720px) { .card { padding: 18px; } }

.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); overflow: hidden; }
.list > li { padding: 14px 20px; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.list-main { min-width: 0; flex: 1 1 260px; }
.list-title { font-weight: 600; }
.list-meta { color: var(--ink-muted); font-size: var(--fs-sm); margin-top: 2px; }

/* Sites: one row per site, the name and address on the left, status on the right. */
.site-card { display: grid; gap: 4px; transition: background var(--ease); position: relative; }
.site-card:hover { background: var(--raised); }
[data-theme="dark"] .site-card:hover { background: var(--selected); }
.site-card .site-name { font-weight: 650; font-size: var(--fs-base); color: var(--ink); text-decoration: none; }
.site-card .site-name:hover { text-decoration: underline; }
.site-card .small a { color: var(--ink-muted); text-decoration: none; }
.site-card .small a:hover { color: var(--primary); text-decoration: underline; }
.site-meta { display: flex; flex-wrap: wrap; gap: 4px 6px; color: var(--ink-muted); font-size: var(--fs-sm); }
.site-meta > span + span::before { content: "·"; margin-right: 6px; color: var(--line-strong); }

/* Empty states: an icon, one line, one action. */
.empty-state { text-align: center; padding: 40px 24px; display: grid; justify-items: center; gap: 8px; }
.empty-state .empty-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); color: var(--ink); margin-bottom: 6px; }
.empty-state .empty-icon .icon { width: 22px; height: 22px; }
.empty-state p.muted { max-width: 52ch; }
.empty-state .prompt-box { width: 100%; max-width: 620px; margin-top: 10px; text-align: left; }
.empty-state .actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); font-weight: 600; line-height: 1;
  padding: 4px 8px; border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); color: var(--ink-muted); background: var(--surface);
  white-space: nowrap;
}
.badge.pro { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 45%, transparent); background: var(--tint); }
.badge.live { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: var(--ok-tint); }
.badge.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.warn { color: var(--alert); border-color: color-mix(in srgb, var(--alert) 45%, transparent); background: var(--alert-tint); }
.badge.done { color: var(--ok); border-color: transparent; background: var(--ok-tint); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 var(--fs-md)/1.1 var(--font);
  padding: 9px 16px; min-height: 38px;
  border-radius: var(--r-btn);
  border: 1px solid var(--primary);
  background: var(--primary); color: var(--on-primary);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease);
}
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.block { width: 100%; min-height: 44px; }
.btn.social { background: var(--surface); color: var(--ink); border-color: var(--control); }
.btn.social:hover { background: var(--raised); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--raised); border-color: var(--control); }
[data-theme="dark"] .btn.secondary { background: transparent; }
[data-theme="dark"] .btn.secondary:hover { background: var(--raised); }
.btn.danger { background: var(--alert); border-color: var(--alert); color: var(--on-alert); }
.btn.danger:hover { filter: brightness(0.95); }
.btn.danger-quiet { background: transparent; color: var(--alert); border-color: color-mix(in srgb, var(--alert) 50%, transparent); box-shadow: none; }
.btn.danger-quiet:hover { background: var(--alert-tint); border-color: var(--alert); }
.btn.small { padding: 6px 12px; min-height: 32px; font-size: var(--fs-sm); }
.btn .icon { width: 15px; height: 15px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Forms ---------- */

.form { display: grid; gap: 14px; }
.form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.form-row > .field { flex: 1 1 220px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-weight: 600; font-size: var(--fs-md); }
.field > .label { font-weight: 600; font-size: var(--fs-md); }
.field > .seg { justify-self: start; }
.hint { font-size: var(--fs-sm); color: var(--ink-muted); }
.hint.bad { color: var(--alert); }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], select,
textarea, input[type="url"], input[type="number"], input[type="date"], input[type="time"], input[type="datetime-local"] {
  font: 400 var(--fs-base)/1.35 var(--font);
  color: var(--ink);
  background: var(--input);
  border: 1px solid var(--control);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  min-height: 40px;
  width: 100%;
  min-width: 0;
  transition: border-color var(--ease), box-shadow var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--placeholder); opacity: 1; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: var(--fs-md); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--primary); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; box-shadow: 0 0 0 4px var(--ring); }
input[aria-invalid="true"] { border-color: var(--alert); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; background: var(--input); }
.seg label { padding: 7px 14px; cursor: pointer; font-weight: 500; font-size: var(--fs-md); }
.seg label + label, .seg a + a { border-left: 1px solid var(--line); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--selected); color: var(--ink); font-weight: 600; }
.seg label:has(input:disabled) { color: var(--placeholder); cursor: not-allowed; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }

/* ---------- Code blocks and prompts ---------- */

.code {
  position: relative;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  padding-right: 84px;
}
.code-label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-muted); margin-bottom: 6px; }
.code pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.8125rem; line-height: 1.55; }
.code .copy { position: absolute; top: 6px; right: 6px; }

.prompt-box {
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--field);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 10px 10px 10px 14px;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.prompt-box p { flex: 1 1 240px; font-family: var(--mono); font-size: 0.8125rem; overflow-wrap: anywhere; }

/* Numbered steps (Get started: connect your AI). */
.connect-steps { list-style: none; counter-reset: step; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.connect-steps > li { counter-increment: step; position: relative; padding-left: 34px; min-height: 24px; font-size: var(--fs-base); }
.connect-steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); border: 1px solid var(--line-strong); color: var(--ink); font-weight: 600; font-size: var(--fs-xs); }
.connect-steps > li > p + * { margin-top: 6px; }
.connect-steps .code { margin-top: 8px; }
.connect-quick { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 10px; }

/* ---------- Notices ---------- */

.notice { border: 1px solid var(--line); border-left: 3px solid var(--field); background: var(--surface); border-radius: var(--r-sm); padding: 12px 14px; }
.notice.error { border-left-color: var(--alert); background: var(--alert-tint); }
.notice.success { border-left-color: var(--ok); background: var(--ok-tint); }
.notice strong { display: block; margin-bottom: 2px; }
.notice.inline { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.notice.inline strong { display: inline; margin: 0; }

/* ---------- Usage meter ---------- */

.meter { height: 6px; background: var(--selected); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.meter > span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }

/* ---------- Plan table ---------- */

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.plan h3 { font-size: 1.05rem; }
.plan .price { font-size: 1.5rem; font-weight: 700; margin-top: 6px; }
.plan .price small { font-size: var(--fs-md); font-weight: 500; color: var(--ink-muted); }
.plan ul { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; font-size: var(--fs-md); }
.plan li { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.plan li span:last-child { font-weight: 600; text-align: right; }
.plan.current { border-color: var(--primary); }

/* ---------- Dialog ---------- */

dialog {
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  padding: 24px;
  width: min(460px, calc(100vw - 32px));
}
[data-theme="dark"] dialog { background: var(--raised); }
dialog::backdrop { background: var(--backdrop); }
dialog h2 { margin-bottom: 8px; }
dialog .dialog-body { display: grid; gap: 10px; }
dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }

/* ---------- Toasts ---------- */

.toasts { position: fixed; bottom: 16px; left: 16px; right: 16px; display: grid; justify-items: center; gap: 8px; pointer-events: none; z-index: 30; }
.toast {
  pointer-events: auto;
  max-width: 480px; width: 100%;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-left: 3px solid var(--ok);
  border-radius: var(--r-sm); box-shadow: var(--shadow);
  padding: 10px 12px;
  display: flex; gap: 12px; align-items: flex-start; justify-content: space-between;
  animation: fade-in 180ms ease;
}
[data-theme="dark"] .toast { background: var(--raised); }
.toast.error { border-left-color: var(--alert); }
.toast p { flex: 1; font-size: var(--fs-md); }
.toast button { background: none; border: 0; color: var(--ink-muted); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 2px 4px; }

@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .toast, .spinner { animation: none; }
  * { transition: none !important; }
}

/* ---------- Sign-in and claim (signed-out pages: no top bar) ---------- */

body.bare { border-top: 4px solid var(--field); background: var(--bare); }
html:has(body.bare) { background: var(--bare); } /* signed-out pages: the site's lemon-cream page colour */
body.bare .main { padding-top: 0; }
.auth { max-width: 400px; margin: 0 auto; padding: 56px 0 40px; }
.auth.wide { max-width: 460px; }
.auth-brand {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: max-content; margin: 0 auto 36px;
  color: var(--ink); text-decoration: none;
}
.auth-brand .wordmark { font-size: 1.2rem; }
.auth > h1 { text-align: center; font-size: 1.9rem; letter-spacing: -0.02em; }
.auth-lede { text-align: center; color: var(--ink-muted); margin-top: 10px; }
.auth > .notice { margin-top: 20px; }
.auth-body { margin-top: 32px; }
.auth-form { display: grid; gap: 0; }
.auth-title { font-size: 1.1rem; text-align: center; margin-bottom: 18px; }
.auth-sub { text-align: center; color: var(--ink-muted); margin: -10px 0 18px; font-size: 0.95rem; }
.auth-slot { min-height: 280px; } /* about the height of Clerk's first step, so the page doesn't jump when it mounts */
/* While Clerk loads (and in the server's first paint), the empty slot shows the outline of Clerk's first step: the
   Google button, the "or" line, the email field and Continue, in the same places. */
.auth-slot:empty {
  background:
    linear-gradient(var(--skel), var(--skel)) 0 8px / 100% 44px no-repeat,
    linear-gradient(var(--line), var(--line)) 0 86px / 100% 1px no-repeat,
    linear-gradient(var(--skel), var(--skel)) 0 118px / 34% 14px no-repeat,
    linear-gradient(var(--skel), var(--skel)) 0 142px / 100% 44px no-repeat,
    linear-gradient(var(--skel), var(--skel)) 0 206px / 100% 44px no-repeat;
  animation: skel-pulse 1.4s ease-in-out infinite alternate;
}
.shell-skeleton { display: grid; gap: 14px; justify-items: center; }
.shell-skeleton span { display: block; height: 14px; width: 70%; border-radius: var(--r-pill); background: var(--skel); animation: skel-pulse 1.4s ease-in-out infinite alternate; }
.shell-skeleton span:first-child { height: 30px; width: 60%; margin-bottom: 6px; }
.shell-skeleton span:last-child { height: 180px; width: 100%; border-radius: var(--r-md); margin-top: 18px; }
@keyframes skel-pulse { from { opacity: 1; } to { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .auth-slot:empty, .shell-skeleton span { animation: none; } }
.auth-switch { text-align: center; margin-top: 22px; font-size: 0.95rem; color: var(--ink-muted); }
.auth-switch .linkish { font-weight: 600; text-decoration: none; }
.auth-switch .linkish:hover { text-decoration: underline; }
.auth-terms { text-align: center; color: var(--ink-muted); font-size: 0.8rem; margin-top: 28px; }
.auth-terms a { color: inherit; }
.auth-foot .auth-terms { margin-top: 0; }
.auth-foot .auth-terms a { font-weight: 400; text-decoration: underline; text-underline-offset: 2px; }

/* The small print under every full-page form (owner 2026-10-14: three parts, each with one job): terms, who handles
   the password, then home, help and the language, quiet and set apart from the form. */
.auth-foot { max-width: 400px; margin: 0 auto; padding: 20px 0 8px; display: grid; gap: 10px; text-align: center; font-size: 0.8rem; line-height: 1.5; color: var(--ink-muted); border-top: 1px solid var(--line); }
.auth-foot p { margin: 0; text-wrap: balance; }
.auth-secure svg { vertical-align: -2px; margin-right: 6px; }
.auth-foot nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 18px; margin-top: 4px; font-size: 0.85rem; }
.auth-foot .lang-picker { font-size: 0.8rem; min-height: 30px; padding: 3px 6px; }
.auth-foot a { color: var(--ink); font-weight: 500; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }

/* Sign-in / sign-up: the form, then the yellow value panel in the home page's style (pagelemon.com hero card:
   loud yellow, Unbounded headline, white chat card with an ink border and offset shadow). Phones: form first. */
.main:has(> .auth-split) { max-width: 1200px; }
.auth-split { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "form" "panel" "foot"; padding-bottom: 8px; }
.auth-split > .auth { grid-area: form; padding-bottom: 0; }
.auth-split > .auth-foot { grid-area: foot; }
.auth-panel {
  grid-area: panel; display: grid; gap: 22px; align-content: start;
  background: var(--field); color: var(--ink); border-radius: 24px; padding: 28px 20px;
}
[data-theme="dark"] .auth-panel {
  --surface: #FFFFFF; --paper: #FFFDF5; --soft: #FFF8D6; --ink: #23221D; --ink-muted: #5B5950; --brand: #1B2A9E;
  --line: rgba(35, 34, 29, 0.14); color: var(--ink);
}
.auth-panel-title { font: 900 clamp(26px, 6vw, 40px)/1.08 var(--wordmark); letter-spacing: -0.03em; color: var(--brand); text-wrap: balance; }
.auth-chat { background: var(--surface); border: 2.5px solid var(--brand); border-radius: var(--r-md); box-shadow: 6px 6px 0 var(--brand); overflow: hidden; }
.auth-chat-bar { padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--paper); font: 500 0.8rem/1.2 var(--mono); color: var(--ink-muted); }
.auth-chat-log { display: flex; flex-direction: column; gap: 10px; padding: 14px 12px; }
.auth-chat .msg { margin: 0; max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: 0.95rem; line-height: 1.45; }
.auth-chat .msg-user { align-self: flex-end; background: var(--brand); color: var(--paper); border-bottom-right-radius: 4px; }
.auth-chat .msg-ai { align-self: flex-start; background: var(--soft); color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
/* Sign-in: three prompts in a bottom-aligned log of fixed height (room for three two-line messages), so a new one
   arriving every 5 s (app.js signinChat) never changes the panel's size; older ones glide up and the oldest fades out. */
.auth-chat-log.prompt-feed {
  --lines: 3; justify-content: flex-end; height: calc(3 * (var(--lines) * 0.95rem * 1.45 + 20px) + 2 * 10px + 28px); overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14px); mask-image: linear-gradient(to bottom, transparent, #000 14px);
}
@media (min-width: 600px) { .auth-chat-log.prompt-feed { --lines: 2; } }
.auth-chat-log .msg-user { transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.4s ease; }
.auth-chat-log .msg-in { animation: msg-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; transform-origin: 100% 100%; }
.auth-chat-log .msg-out { opacity: 0; }
@keyframes msg-in { from { opacity: 0; transform: translateY(12px) scale(0.96); } }
@media (prefers-reduced-motion: reduce) { .auth-chat-log .msg-user { transition: none; } .auth-chat-log .msg-in { animation: none; } }
.auth-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 1rem; line-height: 1.5; }
.auth-checks li { position: relative; padding-left: 26px; }
.auth-checks li::before { content: ""; position: absolute; left: 3px; top: 0.5em; width: 11px; height: 5.5px; border-left: 2.5px solid var(--brand); border-bottom: 2.5px solid var(--brand); transform: rotate(-45deg); }
.auth-panel-more a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }
.auth-panel-more a::after { content: " \2192"; }

@media (min-width: 960px) {
  body.bare .main:has(> .auth-split) { padding: 24px 24px 24px; }
  .auth-split {
    grid-template-columns: 440px minmax(0, 1fr); grid-template-areas: "form panel" "foot panel";
    grid-template-rows: 1fr auto; column-gap: 56px; row-gap: 24px; min-height: calc(100vh - 52px);
  }
  .auth-split > .auth { width: 100%; max-width: 400px; padding-top: 40px; }
  .auth-split > .auth-foot { max-width: 400px; width: 100%; padding-bottom: 12px; }
  .auth-panel { padding: 56px 48px; align-content: center; gap: 28px; }
  .auth-panel > * { max-width: 520px; }
  .auth-panel-title { font-size: clamp(34px, 3.2vw, 46px); }
}
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-muted); font-size: 0.85rem; margin: 4px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.center { text-align: center; justify-content: center; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

/* Clerk's embedded form. Our page already has the heading: hide Clerk's on the first step only (later steps, e.g.
   "Check your email", "Use another method" or "Forgot password?", keep theirs; those also show the Google button, so
   the start step is matched by Clerk's flow class), and its Privacy/Terms links, which our own terms line covers. */
.cl-card.cl-signIn-start .cl-header, .cl-card.cl-signUp-start .cl-header,
.cl-footerPages { display: none !important; }
.auth-slot .cl-rootBox, .auth-slot .cl-cardBox { width: 100% !important; }
/* The home page's buttons: the primary is a blue pill with an ink border and offset ink shadow; Google is a white
   pill with a full ink outline and ink text, so it never looks disabled. !important: Clerk sets its own shadows. (Clerk turns the
   mount node itself into .cl-rootBox, so these hang off .auth-form, not .auth-slot.) */
.auth-form .cl-formButtonPrimary {
  border: 2px solid var(--brand) !important; box-shadow: 3px 3px 0 var(--brand) !important; background-image: none !important;
  transition: transform var(--ease), box-shadow var(--ease);
}
.auth-form .cl-formButtonPrimary:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--brand) !important; }
.auth-form .cl-formButtonPrimary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--brand) !important; }
.auth-form .cl-socialButtonsBlockButton, .auth-form .cl-alternativeMethodsBlockButton { border: 2px solid var(--brand) !important; box-shadow: none !important; }
.auth-form .cl-socialButtonsBlockButton:hover, .auth-form .cl-alternativeMethodsBlockButton:hover { background: var(--soft) !important; }
.auth-form .cl-socialButtonsBlockButtonText { color: var(--ink) !important; opacity: 1 !important; }
/* "Secured by Clerk" centred under the button, not left-aligned. */
.auth-form .cl-footer, .auth-form .cl-footer div { justify-content: center; text-align: center; }
/* One consent line: when Clerk shows its own terms checkbox (sign-up), ours goes. */
body:has(.cl-checkbox__legalAccepted) .auth-terms { display: none; }
/* Clerk's later steps ("Check your email", password, other methods) carry their own heading: ours goes, so the page
   shows one heading (owner 2026-10-14). The start step keeps ours and hides Clerk's (above). */
.auth:has(.cl-card[class*="cl-sign"]:not(.cl-signIn-start):not(.cl-signUp-start)) > :is(h1, .auth-lede) { display: none; }

.claim-card { padding: 28px; box-shadow: var(--shadow); border-color: var(--line); }
.claim-card > h1 { font-size: 1.6rem; letter-spacing: -0.01em; }
.claim-card > h1 + p { margin-top: 8px; }
.claim-card .check { margin-top: 14px; }
.claim-card > .muted.small { margin-top: 10px; }
.claim-card .actions { margin-top: 20px; }
.auth.wide .claim-card { margin-top: 0; }
/* The Terms line right under "Keep this site" (or the sign-up form). */
.claim-card .claim-terms { margin-top: 12px; }
.claim-card .check-hint { margin: 4px 0 0 28px; }
.claim-card .claim-facts { list-style: none; margin: 14px auto 0; padding: 0; width: fit-content; max-width: 100%; font-size: var(--fs-sm); }
.claim-card .claim-facts li { position: relative; padding-left: 20px; margin-top: 4px; }
.claim-card .claim-facts li::before { content: ""; position: absolute; left: 4px; top: 0.45em; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.claim-card .claim-facts + .claim-terms { margin-top: 8px; }
/* Permanent deletes (the delete page and type-to-confirm dialogs): what goes, and the text to type with a copy button. */
.delete-card { text-align: left; }
.delete-card > h1 { font-size: 1.5rem; }
.delete-card .site-preview { margin: 14px 0; }
.delete-warning { color: var(--alert); font-weight: 600; }
.delete-goes { margin: 8px 0 10px; padding-left: 20px; display: grid; gap: 4px; }
.delete-card .form { margin-top: 14px; }
.confirm-text { margin: 6px 0 8px; }
.site-preview {
  display: flex; align-items: center; gap: 12px;
  margin-top: 18px; padding: 14px 16px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm);
}
.site-preview-main { flex: 1 1 auto; min-width: 0; }
.site-preview-name { font-weight: 700; }
.site-preview-url { font-size: 0.9rem; }
.site-preview-url a { color: var(--primary); }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #2E9E5B; box-shadow: 0 0 0 3px rgba(46, 158, 91, 0.18); flex: none; }

.claim-card.success { text-align: center; padding: 36px 28px 28px; }
.claim-card.success .site-preview { text-align: left; }
.success-mark {
  width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--field); color: #23221D; box-shadow: 0 0 0 6px var(--soft);
}
.success-lede { font-size: 1.15rem; font-weight: 600; margin-top: 10px; }
.success-lede + .muted { margin-top: 6px; }
.spinner { width: 28px; height: 28px; margin-bottom: 14px; border-radius: 50%; border: 3px solid var(--soft); border-top-color: var(--brand); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
  .auth { padding-top: 36px; }
  .auth > h1 { font-size: 1.6rem; }
  .claim-card, .card.centered { padding: 22px 18px; }
  .claim-card.success { padding: 28px 18px 22px; }
  .actions.row.center > .btn { flex: 1 1 100%; }
}

.site-card a[data-link] { text-decoration: none; }
.site-card a[data-link]:hover .site-name { text-decoration: underline; }
@media (max-width: 480px) {
  .user-email { display: none; }
}

/* ---------- Site tabs, stats, bars (plugins, inbox, analytics) ---------- */

.tabs { display: flex; flex-wrap: wrap; gap: 0 4px; margin: 8px 0 24px; border-bottom: 1px solid var(--line); }
.tabs a { flex: none; color: var(--ink-muted); text-decoration: none; font-weight: 500; font-size: var(--fs-md); padding: 10px 10px 11px; margin-bottom: -1px; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
textarea.mono { font: 400 0.85rem/1.5 var(--mono); min-height: 160px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); padding: 14px 16px; }
.stat .n { font-size: 1.5rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .k { font-size: var(--fs-sm); color: var(--ink-muted); }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; font-size: 0.9rem; }
.bars .bar { grid-column: 1 / -1; height: 6px; background: var(--selected); border-radius: 999px; overflow: hidden; }
.bars .bar > span { display: block; height: 100%; background: var(--primary); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 16px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; font-size: 0.9rem; margin: 8px 0 0; }
.kv dt { color: var(--ink-muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 24px; margin-top: 14px; }
.meters p { font-size: 0.9rem; }

/* ---------- Shop (payments: Products, Orders, Money) ---------- */

.shop-panes { margin: 4px 0 16px; }
.seg a { padding: 7px 14px; font-weight: 500; font-size: var(--fs-md); color: var(--ink-muted); text-decoration: none; }
.seg a[aria-current="page"] { background: var(--selected); color: var(--ink); font-weight: 600; }
.product-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.product-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.product-img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--soft); }
.product-img.empty { aspect-ratio: auto; height: 56px; display: grid; place-items: center; color: var(--ink-muted); font-size: 0.85rem; }
.product-body { padding: 12px 14px 14px; }
.stock-rows { list-style: none; margin: 10px 0 0; padding: 0; }
.stock-rows > li { padding: 6px 0; border-top: 1px solid var(--line); }
.stock-rows .btn.small { min-width: 36px; }
.badge.stock-out { color: var(--on-alert); background: var(--alert); border-color: var(--alert); }
.badge.stock-low { color: #8A4B00; background: #FFF1D6; border-color: #E8A33D; }
[data-theme="dark"] .badge.stock-low { color: #F5C27A; background: rgba(232, 163, 61, 0.12); border-color: rgba(232, 163, 61, 0.5); }
.order-focus { box-shadow: inset 4px 0 0 var(--field); background: var(--soft); }
.order-details { margin-top: 8px; }
.order-details summary { cursor: pointer; color: var(--ink-muted); }
.order-details > div { margin-top: 6px; }
.approve-card { border-color: var(--field); background: var(--soft); }

/* Upload links: drop zone, progress, saved paths */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 140px; padding: 20px 16px; text-align: center; border: 2px dashed var(--line-strong); border-radius: var(--r-md); background: var(--surface); cursor: pointer; transition: background var(--ease), border-color var(--ease); }
.dropzone:hover, .dropzone.over { background: var(--raised); border-color: var(--primary); }
.dropzone.busy { opacity: 0.6; pointer-events: none; }
.uploader input[type=file]:focus-visible + .dropzone { outline: 2px solid var(--focus); outline-offset: 2px; }
.upload-progress { width: 100%; height: 10px; margin-top: 12px; accent-color: var(--primary); }
.upload-paths { margin: 6px 0 0; padding-left: 18px; }
.upload-paths code { word-break: break-all; }
.uploader .check { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 4px; cursor: pointer; }
.uploader .check input { margin-top: 3px; flex: none; }

/* ---------- Site overview, access, plugin settings, Connect disclosure ---------- */

.overview-url { font-size: 1.1rem; font-weight: 600; margin-top: 2px; }
.section > .card + .card, .section > .card + div, .section > div + .section { margin-top: 12px; }
.plugin-settings, .disclosure { margin-top: 16px; }
.plugin-settings > summary, .disclosure > summary { cursor: pointer; font-weight: 600; }
.disclosure-title { font-size: var(--fs-base); }
.disclosure > summary > span:last-child { display: block; font-weight: 400; margin: 2px 0 0 1.1em; }
.stack > .notice + .card, .stack > .notice + .notice { margin-top: 12px; }

/* ---------- Plan comparison (compact table; scrolls inside its box on phones) ---------- */

.compare-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.compare { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 0.9rem; }
.compare th, .compare td { padding: 10px 12px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.compare thead th { border-top: 0; font-weight: 700; background: var(--raised); }
.compare tbody th { color: var(--ink-muted); font-weight: 500; white-space: nowrap; }
.compare th:first-child { position: sticky; left: 0; background: var(--surface); }
.compare .current { background: var(--tint); }
.compare .price { font-size: 1.2rem; font-weight: 700; display: block; margin-top: 2px; }
.compare .plan-price small { display: block; font-weight: 400; color: var(--ink-muted); font-size: 0.75rem; }
.compare .btn { white-space: normal; text-align: center; line-height: 1.2; }
/* Invite friends (referrals) and "Have a code?" (promo codes) */
.referral-link { display: flex; gap: 8px; align-items: center; }
.referral-link input { flex: 1 1 auto; }
.referral-link .btn { white-space: nowrap; }
.referral-note { margin-top: 10px; }
/* Checkout renewal wording, Cancel your contract, email notification switches (subscriptions.ts, notify-prefs.ts) */
.plan-action { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.plan-action .renewal { max-width: 22ch; margin: 0; }
.renewal p { margin: 6px 0 0; }
.renewal-terms { margin-top: 10px; }
.notify-row { margin-top: 0; }
.notify-row .list-meta, .notify-row .notify-hint { display: block; margin-top: 2px; }

/* The sign-in page keeps pagelemon.com's pill buttons (the Clerk form beside it has them too). */
.auth-form .btn, .auth .btn.block { border-radius: var(--r-pill); min-height: 46px; font-size: var(--fs-base); }

/* ---------- Get started: hero, step 1 (connect), step 2 (prompts as small chats), guides ----------
   pagelemon.com's visual language in the portal: the lemon hero field, Unbounded navy headline, a chat card with an
   ink border and offset shadow over a site in a browser frame, ink "you" bubbles and lemon-cream AI bubbles. */

:root { --hero-bg: var(--field); --hero-ink: var(--brand); --hero-line: transparent; --pop-line: var(--brand); }
:root[data-theme="dark"] { --hero-bg: rgba(255, 228, 92, 0.10); --hero-ink: var(--field); --hero-line: rgba(255, 228, 92, 0.22); --pop-line: rgba(0, 0, 0, 0.55); }

.start-hero {
  display: grid; gap: 28px; align-items: center; margin-bottom: 24px; padding: 28px 20px 24px;
  background: var(--hero-bg); border: 1px solid var(--hero-line); border-radius: 24px; color: var(--ink);
}
@media (min-width: 880px) { .start-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr); padding: 40px 40px; gap: 40px; } }
.sh-eyebrow { font: 600 var(--fs-xs)/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); opacity: 0.75; margin-bottom: 12px; }
.start-hero h1 { font: 800 clamp(28px, 6.6vw, 40px)/1.08 var(--wordmark); letter-spacing: -0.03em; color: var(--hero-ink); max-width: 14em; text-wrap: balance; }
.sh-lede { margin-top: 14px; font-size: var(--fs-lg); line-height: 1.45; font-weight: 500; max-width: 26em; }
.start-hero .start-progress { margin-top: 22px; max-width: 320px; }
.start-hero .meter { background: rgba(30, 29, 25, 0.12); height: 8px; }
.start-hero .meter > span { background: var(--ink); }
:root[data-theme="dark"] .start-hero .meter { background: rgba(255, 255, 255, 0.14); }
:root[data-theme="dark"] .start-hero .meter > span { background: var(--field); }
.start-count { font-weight: 600; font-size: var(--fs-md); }

/* The picture: site frame top right, chat card overlapping bottom left. */
.sh-art { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); min-width: 0; }
.sh-site {
  grid-area: 1 / 3 / 2 / 13; min-width: 0; background: var(--surface); border: 1.5px solid var(--line-strong);
  border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm);
}
:root[data-theme="dark"] .sh-site img { filter: brightness(0.82); }
.sh-site img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.sh-url > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.sh-url { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--paper); border-bottom: 1px solid var(--line); font: 500 var(--fs-xs)/1.2 var(--mono); white-space: nowrap; overflow: hidden; }
.sh-win { display: inline-flex; gap: 5px; margin-right: 4px; }
.sh-win i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.sh-live { width: 7px; height: 7px; border-radius: 50%; background: #2E9E5B; flex: none; }
.sh-chat {
  grid-area: 1 / 1 / 2 / 9; align-self: end; margin-top: 42%; position: relative; z-index: 1; min-width: 0;
  background: var(--surface); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 6px 6px 0 var(--pop-line); overflow: hidden;
  transform: translateY(18px);
}
.sh-chat-bar { padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--paper); font: 500 var(--fs-xs)/1.2 var(--mono); color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-log { display: flex; flex-direction: column; gap: 8px; padding: 12px; }

/* Chat bubbles: the hero, and each prompt card. */
.bubble { margin: 0; max-width: 92%; padding: 9px 13px; border-radius: 16px; font-size: var(--fs-md); line-height: 1.45; overflow-wrap: anywhere; }
.bubble.you { align-self: flex-end; background: var(--ink); color: var(--surface); border-bottom-right-radius: 4px; }
.bubble.ai { align-self: flex-start; background: var(--soft); color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: 4px; }

/* Steps */
.step-head { display: flex; gap: 14px; align-items: flex-start; }
.step-mark {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--ink); color: var(--surface); font: 700 var(--fs-md)/1 var(--wordmark);
}
.step-mark.done { background: var(--ok); color: var(--surface); }
.step-mark .icon { width: 16px; height: 16px; stroke-width: 2.6; }
.step-title { flex: 1 1 auto; min-width: 0; }
.step-title p { margin-top: 3px; }
.step-head h2 { font-size: var(--fs-xl); letter-spacing: -0.01em; }
.step-head > .badge { margin-top: 6px; }
.field-label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-muted); }
.step-connect { padding: 28px; }
.step-connect .step-body { margin-top: 20px; padding-left: 46px; display: grid; gap: 16px; }
.connect-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--r-md); background: var(--ok-tint); font-size: var(--fs-md); }
.connect-status > .icon { width: 18px; height: 18px; color: var(--ok); stroke-width: 2.4; flex: none; }
.connect-status p { flex: 1 1 200px; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.connect-status a { font-weight: 600; }
.connector-link { display: grid; gap: 8px; }
.link-box { border-color: var(--ink); border-width: 2px; }
.link-box { flex-wrap: nowrap; }
.link-box p { flex: 1 1 0; min-width: 0; font-weight: 500; font-size: var(--fs-md); word-break: break-all; }

/* App cards: Claude, ChatGPT, coding tools */
.app-tabs { display: grid; gap: 12px; }
.app-tablist { display: flex; gap: 8px; flex-wrap: wrap; }
.app-tab {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 16px 7px 7px; min-height: 48px; cursor: pointer;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--ink);
  font: 600 var(--fs-base)/1 var(--font); transition: border-color var(--ease), background var(--ease);
}
.app-tab:hover { border-color: var(--ink); }
.app-tab[aria-selected="true"] { border-color: var(--ink); background: var(--soft); box-shadow: 3px 3px 0 var(--pop-line); }
.app-tab .app-tile { width: 32px; height: 32px; border-radius: 50%; border-width: 1.5px; box-shadow: none; }
.app-tab .app-tile .icon { width: 17px; height: 17px; }
.app-tabs .app-card-head .app-tile { display: none; }
@media (min-width: 720px) {
  .app-tabs .app-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; align-items: start; }
  .app-tabs .app-card > * { grid-column: 1; }
  .app-tabs .app-card > .app-card-foot { grid-column: 2; grid-row: 1; margin-top: 0; }
}
@media (max-width: 480px) {
  .app-tablist { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .app-tab { flex-direction: column; gap: 6px; padding: 10px 6px; border-radius: 14px; font-size: var(--fs-sm); text-align: center; line-height: 1.2; }
}
.app-card { display: flex; flex-direction: column; gap: 14px; padding: 20px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--paper); min-width: 0; }
.app-card-head { display: flex; gap: 12px; align-items: center; }
.app-card-head h3 { font-size: var(--fs-lg); }
.app-card-head p { margin-top: 1px; }
.app-tile { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--pop-line); }
.app-tile .icon { width: 22px; height: 22px; stroke-width: 2; }
.tile-claude { background: var(--field); color: #1E1D19; }
.tile-chatgpt { background: var(--surface); color: var(--ink); }
.tile-code { background: var(--ink); color: var(--surface); }
.app-steps-list { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 8px; font-size: var(--fs-md); }
.app-steps-list > li { counter-increment: s; position: relative; padding-left: 28px; line-height: 1.45; }
.app-steps-list > li::before { content: counter(s); position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line-strong); font-size: var(--fs-xs); font-weight: 600; }
.app-card-foot { margin-top: auto; }
.app-card-foot .btn .ext { width: 12px; height: 12px; margin-left: 6px; }
.app-card-links { display: grid; gap: 8px; font-size: var(--fs-md); font-weight: 500; }
.term { border-radius: 10px; background: #1E1D19; color: #F2F0E8; overflow: hidden; border: 1px solid var(--line-strong); }
.term-bar { padding: 6px 12px; font: 500 var(--fs-xs)/1.2 var(--mono); color: #B9B6AC; border-bottom: 1px solid rgba(255, 255, 255, 0.10); }
.term-line { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; }
.term-line code { flex: 1; min-width: 0; font: 400 0.75rem/1.5 var(--mono); overflow-wrap: anywhere; color: inherit; background: none; padding: 0; }
.term-ps { color: var(--field); }
.term .copy { flex: none; }
.perms > summary { cursor: pointer; font-weight: 600; font-size: var(--fs-md); }
.perms ul { margin: 10px 0 0; display: grid; gap: 4px; }
.connect-quick { padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 10px; }

/* Step 2: each prompt as a tiny chat */
.step-ask { margin-top: 40px; }
.step-ask > .step-head { margin-bottom: 18px; padding-left: 4px; }
.lessons { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.lesson { display: flex; flex-direction: column; gap: 14px; }
/* The last prompt card spans the row, so seven cards never leave a hole. */
.lesson:last-child { grid-column: 1 / -1; }
@media (min-width: 760px) {
  .lesson:last-child { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 14px 24px; align-items: start; }
  .lesson:last-child > .lesson-head { grid-column: 1; }
  .lesson:last-child > .mini-chat { grid-column: 2; grid-row: 1 / span 2; }
  .lesson:last-child > .lesson-foot { grid-column: 1; grid-row: 2; align-self: end; }
}
.lesson.is-done { border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.lesson-head { display: flex; gap: 12px; align-items: center; }
.lesson-head h3 { font-size: var(--fs-base); line-height: 1.3; }
.lesson-head .badge { flex: none; }
.step-plan { font-size: var(--fs-xs); color: var(--ink-muted); }
.lesson-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--soft); color: var(--ink); flex: none; border: 1px solid var(--line); }
.lesson-icon.done { background: var(--ok-tint); color: var(--ok); border-color: transparent; }
.lesson-icon .icon { width: 19px; height: 19px; }
.mini-chat { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); }
.mini-you { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.mini-you .bubble { font-family: var(--mono); font-size: 0.8125rem; }
.mini-you .copy { align-self: flex-end; }
.mini-chat .bubble.ai { font-size: var(--fs-sm); }
.lesson-foot { margin-top: auto; display: flex; gap: 8px 16px; align-items: center; flex-wrap: wrap; font-size: var(--fs-md); }
.lesson-foot a { font-weight: 500; text-decoration: none; }
.lesson-foot a:hover { text-decoration: underline; }
.lesson-foot .btn { margin-left: auto; }
.doc-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 8px; }
.doc-links a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-sm); color: var(--ink); text-decoration: none; font-weight: 500; font-size: var(--fs-md); }
.doc-links a:hover { border-color: var(--control); }
.doc-links a > .icon { color: var(--ink-muted); }
.doc-links .ext { margin-left: auto; width: 12px; height: 12px; color: var(--ink-muted); }
@media (max-width: 720px) {
  .start-hero { padding: 24px 16px 28px; border-radius: 18px; }
  .sh-lede { font-size: var(--fs-base); }
  .step-connect { padding: 18px; }
  .step-connect .step-body { padding-left: 0; }
  .step-head h2 { font-size: var(--fs-lg); }
}

/* ---------- Account settings ----------
   One page per section (owner, 2026-10-14): a side menu on desktop, a 2x2 grid of short links on phones, a wrapping
   row between. Every section is a heading (with an optional action on the right) over one card of rows. */

.set-layout { display: grid; gap: 20px; }
@media (min-width: 900px) { .set-layout { grid-template-columns: 200px minmax(0, 1fr); gap: 40px; align-items: start; } }
.set-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.set-nav-link { display: inline-flex; align-items: center; gap: 8px; min-width: 0; min-height: 40px; padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); color: var(--ink-muted); background: var(--surface); text-decoration: none; font-size: var(--fs-md); font-weight: 500; }
.set-nav-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-nav-link .icon { width: 16px; height: 16px; flex: none; }
.set-nav-link:hover { color: var(--ink); border-color: var(--ink); }
.set-nav-link[aria-current] { color: var(--ink); font-weight: 600; border-color: var(--ink); background: var(--soft); }
@media (max-width: 599px) { .set-nav { display: grid; grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) {
  .set-nav { position: sticky; top: 88px; flex-direction: column; flex-wrap: nowrap; gap: 2px; }
  .set-nav-link { border: 0; border-radius: var(--r-sm); background: transparent; padding: 9px 12px; }
  .set-nav-link:hover { background: var(--selected); }
  .set-nav-link[aria-current] { background: var(--selected); box-shadow: inset 3px 0 0 var(--field); }
}
.set-body { min-width: 0; display: grid; gap: 40px; }
.set-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.set-head > div { min-width: 0; flex: 1 1 280px; }
.set-head h2 { font-size: var(--fs-lg); }
.set-head h2:focus { outline: none; }
.set-head p { margin-top: 2px; max-width: 70ch; }

.setting-row.profile-card { display: flex; gap: 16px; align-items: center; justify-content: flex-start; flex-wrap: nowrap; }
.profile-who { min-width: 0; }
.profile-name { font-weight: 650; font-size: var(--fs-lg); }
.profile-plan { margin-top: 6px; }
.profile-slot { min-height: 120px; }
.profile-slot .cl-rootBox, .profile-slot .cl-cardBox { width: 100% !important; max-width: 100% !important; }
.settings { padding: 0; overflow: hidden; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; padding: 16px 24px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.setting-row:first-child { border-top: 0; }
.setting-text { flex: 1 1 280px; min-width: 0; }
.setting-row > form.row { flex-wrap: nowrap; }
.setting-row > form.row input { min-width: 0; }
/* A text field in a settings card (the profile name): under its label, full width up to a readable line, standard
   input height, its button the same height. */
.setting-row.stacked { display: grid; gap: 10px; }
.setting-row > form.setting-field { width: 100%; max-width: 560px; gap: 8px; }
.setting-row > form.setting-field input { flex: 1 1 auto; }
.setting-row > form.setting-field .btn { min-height: 40px; flex: none; }
.setting-row .lang-picker { max-width: 220px; min-height: 36px; font-size: var(--fs-md); }
.danger-zone { border-color: color-mix(in srgb, var(--alert) 35%, transparent); }
@media (max-width: 720px) { .setting-row { padding: 14px 18px; } }

/* Connected apps and tokens: compact rows (icon, name, one meta line, Details, a quiet Disconnect). */
.conn-list { list-style: none; margin: 0; padding: 0; }
.conn-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 14px; align-items: start; padding: 14px 24px; border-top: 1px solid var(--line); }
.conn-row:first-child { border-top: 0; }
.conn-icon { grid-row: 1 / span 2; }
.conn-actions { display: contents; }
.conn-actions .conn-more { grid-column: 2; grid-row: 2; justify-self: start; }
.conn-actions .btn { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
.conn-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--raised); color: var(--ink); border: 1px solid var(--line); }
.conn-icon.app { background: var(--soft); }
.conn-icon .icon { width: 18px; height: 18px; }
.conn-name { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.conn-meta { color: var(--ink-muted); font-size: var(--fs-sm); margin-top: 2px; }
.conn-more { margin-top: 4px; padding: 0; border: 0; background: none; color: var(--primary); font: inherit; font-size: var(--fs-sm); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.conn-more::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); transition: transform var(--ease); }
.conn-more[aria-expanded="true"]::after { transform: translateY(1px) rotate(-135deg); }
.conn-more:hover { text-decoration: underline; }
.conn-details { grid-column: 2 / -1; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 10px 0 0; padding: 10px 12px; background: var(--raised); border-radius: var(--r-sm); font-size: var(--fs-sm); }
.conn-details[hidden] { display: none; }
.conn-details dt { color: var(--ink-muted); }
.conn-details dd { margin: 0; overflow-wrap: anywhere; }
.conn-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; padding: 12px 24px; border-top: 1px solid var(--line); background: var(--raised); }
[data-theme="dark"] .conn-foot { background: color-mix(in srgb, var(--raised) 55%, var(--surface)); }
.conn-docs { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; }
.conn-docs .icon { width: 16px; height: 16px; }
.conn-docs .ext { width: 12px; height: 12px; }
.conn-loading { padding: 16px 24px; }
.tokens-empty { padding: 32px 24px; }
.btn.ghost-danger { background: transparent; border-color: var(--line-strong); color: var(--ink); box-shadow: none; }
.btn.ghost-danger:hover { border-color: var(--alert); }
.btn.ghost-danger:hover { color: var(--alert); background: var(--alert-tint); }
@media (max-width: 560px) {
  .conn-row { padding: 14px 16px; column-gap: 12px; grid-template-columns: auto minmax(0, 1fr); }
  .conn-icon { grid-row: 1; }
  .conn-actions { display: flex; grid-column: 2; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
  .conn-actions .conn-more { margin-top: 0; }
  .conn-actions .btn { margin-right: -10px; }
  .conn-details { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr); gap: 0; }
  .conn-details dd + dt { margin-top: 6px; }
  .conn-foot { padding: 12px 16px; }
}

/* Create token dialog: a name, a two-way choice, then the token once with setup tabs. */
.token-dlg { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; }
.token-dialog { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.seg-tabs, .seg-panel { grid-template-columns: minmax(0, 1fr); }
.token-dialog h2 { margin: 0; }
.token-dialog h2:focus { outline: none; }
.token-dialog h3 { font-size: var(--fs-base); margin-top: 4px; }
.token-dialog > p.muted { margin-top: -8px; }
.token-dialog .actions { margin-top: 6px; }
.choices { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.choices legend { font-weight: 600; font-size: var(--fs-md); margin-bottom: 6px; padding: 0; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); cursor: pointer; background: var(--input); }
.choice:has(input:checked) { border-color: var(--primary); background: var(--tint); box-shadow: inset 0 0 0 1px var(--primary); }
.choice input { margin-top: 3px; flex: none; accent-color: var(--primary); }
.choice-title { display: block; font-weight: 600; }
.choice-hint { display: block; color: var(--ink-muted); font-size: var(--fs-sm); margin-top: 2px; }
.seg-tabs { display: grid; gap: 10px; }
.seg-tablist { width: max-content; max-width: 100%; }
.seg-tablist [role="tab"] { padding: 7px 14px; border: 0; background: transparent; color: var(--ink-muted); font: inherit; font-size: var(--fs-md); font-weight: 500; cursor: pointer; }
.seg-tablist [role="tab"] + [role="tab"] { border-left: 1px solid var(--line); }
.seg-tablist [role="tab"][aria-selected="true"] { background: var(--selected); color: var(--ink); font-weight: 600; }
.seg-tablist [role="tab"]:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.seg-panel { display: grid; gap: 8px; }
.seg-panel .code { padding: 44px 12px 10px; }
.seg-panel .code pre { white-space: pre-wrap; overflow-wrap: break-word; }
.seg-tablist [role="tab"] { white-space: nowrap; }
.token-dialog .setup-lede { margin-top: -10px; }
@media (max-width: 560px) {
  .token-dialog .actions { flex-direction: column-reverse; }
  .token-dialog .actions .btn { width: 100%; }
  #api-tokens .set-head > .btn { width: 100%; }
  .seg-tablist [role="tab"] { padding: 7px 10px; font-size: var(--fs-sm); }
}
.seg-panel[hidden] { display: none; }

/* ---------- Notifications page and the Sites banner ---------- */
.notice-filters { display: flex; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 8px; }
.notice-filters .field { flex: 0 1 260px; }
.tab-count { display: inline-block; min-width: 20px; margin-left: 6px; padding: 0 6px; border-radius: var(--r-pill); background: var(--selected); color: var(--ink); font-size: var(--fs-xs); font-weight: 600; line-height: 20px; text-align: center; }
.tabs a[aria-current="page"] .tab-count { background: var(--ink); color: var(--surface); }
.notice-section + .notice-section { margin-top: 32px; }
.notice-section > h2 { font-size: var(--fs-lg); margin-bottom: 10px; }
.notice-row .list-title { font-weight: 500; }
.notice-row.unread .list-title { font-weight: 700; }
.notice-row.unread { box-shadow: inset 3px 0 0 var(--primary); }
.notice-body { margin-top: 4px; max-width: 75ch; }
.problem-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.problem-banner .problem-text { min-width: 0; flex: 1 1 320px; }
.problem-banner p { margin: 0; }

/* Customers' money still open (a refused delete): the "Resolve these" panel */
.money-dialog { max-width: 640px; }
.money-panel { display: grid; gap: 14px; text-align: left; }
.money-panel h3 { margin: 4px 0 0; }
.money-group h4 { margin: 0 0 2px; }
.money-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.money-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.money-what { min-width: 0; overflow-wrap: anywhere; }
.money-actions { gap: 6px; align-items: center; flex-wrap: wrap; }

/* "Demo data" pill for the investor demo account and workspace; stays visible on phones. */
.demo-badge {
  display: inline-flex; align-items: center; flex: none; margin-right: 8px; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--selected); color: var(--ink-muted);
  font-size: 0.75rem; font-weight: 600; line-height: 1.4; white-space: nowrap; cursor: help;
}

/* ---------- Invite friends (referrals): the lemon hero of /start with the link and share buttons, two reward tickets,
   progress and credit cards, a three-step strip and the friend list. ---------- */
.ref-hero {
  display: grid; gap: 24px; align-items: center; margin-bottom: 20px; padding: 28px 20px 24px;
  background: var(--hero-bg); border: 1px solid var(--hero-line); border-radius: 24px; color: var(--ink);
}
@media (min-width: 880px) { .ref-hero { grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr); padding: 40px; gap: 32px; } }
.ref-hero h1 { font: 800 clamp(30px, 7vw, 44px)/1.05 var(--wordmark); letter-spacing: -0.03em; color: var(--hero-ink); text-wrap: balance; }
.ref-hero .sh-lede { max-width: 32em; }
.ref-link { display: flex; gap: 8px; margin-top: 20px; max-width: 560px; }
.ref-link input { flex: 1 1 auto; min-width: 0; background: var(--surface); border-color: var(--ink); font-size: var(--fs-md); }
.ref-link .btn { white-space: nowrap; }
.ref-shares { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; max-width: 640px; }
.ref-share {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 8px 14px; border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink); border: 1.5px solid var(--ink); font: 600 var(--fs-md)/1 var(--font);
  text-decoration: none; cursor: pointer; transition: transform var(--ease), box-shadow var(--ease);
}
.ref-share:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--pop-line); text-decoration: none; }
.ref-share:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ref-share .icon { width: 17px; height: 17px; flex: none; }
.ref-share.ai { background: var(--ink); color: var(--surface); }
:root[data-theme="dark"] .ref-share { border-color: var(--line-strong); }
:root[data-theme="dark"] .ref-share.ai { background: var(--field); color: #1E1D19; border-color: var(--field); }
:root[data-theme="dark"] .ref-link input { border-color: var(--line-strong); }

/* Two tickets, offset like the /start chat card. */
.ref-art { position: relative; min-height: 200px; display: none; }
@media (min-width: 880px) { .ref-art { display: block; } }
.ref-ticket {
  position: absolute; width: 74%; display: flex; flex-direction: column; gap: 4px; padding: 18px 20px;
  background: var(--surface); border: 2px solid var(--ink); border-radius: 16px; box-shadow: 6px 6px 0 var(--pop-line);
}
.ref-ticket.friend { top: 0; left: 0; transform: rotate(-4deg); }
.ref-ticket.you { bottom: 0; right: 0; transform: rotate(3deg); background: var(--ink); color: var(--surface); }
:root[data-theme="dark"] .ref-ticket.you { background: var(--field); color: #1E1D19; border-color: var(--field); }
.ref-ticket-who { font: 600 var(--fs-xs)/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.75; }
.ref-ticket-amt { font: 800 34px/1 var(--wordmark); letter-spacing: -0.03em; }
.ref-art-gift { position: absolute; top: 42%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; display: grid; place-items: center; z-index: 1;
  border-radius: 50%; background: var(--field); border: 2px solid var(--ink); color: #1E1D19; }
.ref-art-gift .icon { width: 22px; height: 22px; }

.ref-grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .ref-grid { grid-template-columns: 1fr 1fr; } }
.ref-card { display: flex; flex-direction: column; gap: 8px; }
.ref-card h2 { font-size: var(--fs-md); color: var(--ink-muted); font-weight: 600; }
.ref-big { font-size: var(--fs-lg); }
.ref-big strong { font: 800 2rem/1.1 var(--wordmark); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-right: 2px; }
.ref-meter { height: 10px; margin-top: 2px; }
.ref-meter > span { background: var(--ink); }
:root[data-theme="dark"] .ref-meter > span { background: var(--field); }
.ref-facts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 6px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.ref-facts dt { font-size: var(--fs-xs); color: var(--ink-muted); }
.ref-facts dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.ref-bonus { display: flex; gap: 8px; align-items: flex-start; margin-top: 4px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--soft); }
.ref-bonus .icon { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.ref-card .actions { margin-top: auto; padding-top: 4px; }

.ref-steps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; counter-reset: none; }
@media (min-width: 720px) { .ref-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ref-step { display: flex; gap: 12px; align-items: flex-start; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.ref-step-n { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--field); color: #1E1D19; font: 800 var(--fs-md)/1 var(--wordmark); }
.ref-step .list-title + p { margin-top: 2px; }

.ref-friends { margin-top: 12px; }
.ref-friends > li { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
.ref-friends .list-title { overflow-wrap: anywhere; }
.ref-status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.ref-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--ink-muted); }
.ref-status.paid::before { background: var(--primary); border-color: var(--primary); }
.ref-status.done { color: var(--ok); }
.ref-status.done::before { background: var(--ok); border-color: var(--ok); }
.ref-status.muted { color: var(--ink-muted); }
.ref-empty { display: flex; gap: 12px; align-items: center; margin-top: 12px; color: var(--ink-muted); }
.ref-empty .icon { width: 22px; height: 22px; flex: none; }
.ref-rules { margin-top: 24px; }

.qr-dlg { text-align: center; max-width: 360px; }
.ref-qr { display: block; width: 240px; height: 240px; margin: 12px auto 4px; border-radius: var(--r-sm); border: 1px solid var(--line); image-rendering: pixelated; }
.ref-qr-url { overflow-wrap: anywhere; color: var(--ink-muted); }
.qr-dlg .actions { justify-content: center; }

@media (max-width: 480px) {
  .ref-hero { padding: 24px 16px 20px; border-radius: 20px; }
  .ref-link { flex-direction: column; }
  .ref-link .btn { min-height: 44px; }
  .ref-shares { display: grid; grid-template-columns: 1fr 1fr; }
  .ref-share { justify-content: center; min-height: 44px; }
  .ref-share.ai:nth-child(odd) { grid-column: 1 / -1; }
}

/* ---------- Billing (owner 2026-10-14): the lemon hero with one sentence and one button, what the next plan adds,
   usage tiles, the comparison folded away. Same hero field as Get started (--hero-bg, --hero-ink). ---------- */
.bill-hero {
  display: grid; gap: 24px; align-items: start; margin-bottom: 8px; padding: 28px 20px 24px;
  background: var(--hero-bg); border: 1px solid var(--hero-line); border-radius: 24px; color: var(--ink);
}
@media (min-width: 880px) { .bill-hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); padding: 36px 40px; gap: 40px; align-items: center; } .bill-hero.solo { grid-template-columns: 1fr; } }
.bill-hero h1 { font: 800 clamp(26px, 5.6vw, 36px)/1.1 var(--wordmark); letter-spacing: -0.03em; color: var(--hero-ink); max-width: 16em; text-wrap: balance; }
.bill-hero .sh-lede { font-size: var(--fs-base); max-width: 34em; }
.bill-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 20px; }
.bill-cta .btn { border-radius: var(--r-pill); min-height: 46px; padding: 10px 22px; font-size: var(--fs-base); }
.bill-cta .btn.link-btn { background: transparent; border-color: transparent; color: var(--hero-ink); box-shadow: none; text-decoration: underline; text-underline-offset: 3px; padding-inline: 4px; }
.bill-cta .btn.link-btn:hover { background: transparent; text-decoration-thickness: 2px; }
.bill-hero .renewal, .bill-hero .hint { color: var(--ink); opacity: 0.78; margin-top: 10px; max-width: 46ch; }
.bill-price-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 18px; }
.bill-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; }
.bill-price .amount, .compare-price .amount { font: 800 34px/1 var(--wordmark); letter-spacing: -0.02em; color: var(--hero-ink); }
.bill-price .per, .compare-price .per { font-weight: 600; color: var(--ink-muted); }
.bill-price .was, .compare-price .was { color: var(--ink-muted); font-weight: 500; margin-left: 4px; }
.bill-price .billed, .compare-price .billed { flex-basis: 100%; font-size: var(--fs-sm); color: var(--ink-muted); }
.bill-hero .bill-price .per, .bill-hero .bill-price .was, .bill-hero .bill-price .billed { color: var(--ink); opacity: 0.75; }
.iv-seg { background: var(--surface); border-radius: var(--r-pill); padding: 3px; gap: 2px; border-color: var(--line-strong); }
.iv-seg label { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--r-pill); padding: 6px 12px; font-size: var(--fs-sm); }
.iv-seg label + label { border-left: 0; }
.iv-seg label:has(input:checked) { background: var(--ink); color: var(--surface); }
.save-pill { display: inline-block; padding: 2px 8px; border-radius: var(--r-pill); background: var(--field); color: #1E1D19; font-size: var(--fs-xs); font-weight: 700; line-height: 1.4; white-space: nowrap; }
.bill-gains { background: var(--surface); border: 1px solid var(--pop-line); border-radius: 18px; padding: 20px 22px; box-shadow: 5px 5px 0 var(--pop-line); color: var(--ink); }
.bill-gains-title { font-weight: 700; font-size: var(--fs-base); margin-bottom: 10px; }
.bill-gains .btn { margin-top: 12px; }
.gain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.gain-list li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.4; }
.gain-list .icon { flex: none; width: 18px; height: 18px; margin-top: 1px; padding: 2px; border-radius: 50%; background: var(--ok-tint); color: var(--ok); }
.trial-steps { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; max-width: 360px; margin-top: 18px; }
.trial-steps span { height: 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-strong); }
.trial-steps span.done { background: var(--hero-ink); border-color: var(--hero-ink); }
.yearly-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 20px; padding: 14px 16px; background: var(--surface); border-radius: 14px; border: 1px solid var(--line); }
.yearly-offer p { margin: 0; font-weight: 600; flex: 1 1 200px; }
.yearly-offer .btn { border-radius: var(--r-pill); }

.bill-usage .spread { margin-bottom: 12px; }
.usage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.usage-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); padding: 14px 16px; }
.usage-label { font-size: var(--fs-sm); color: var(--ink-muted); font-weight: 500; }
.usage-num { margin-top: 4px; font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.usage-num > span { font-size: var(--fs-sm); font-weight: 500; color: var(--ink-muted); }
.usage-num.off { color: var(--ink-muted); }
.usage-num .chip { padding: 1px 8px; border-radius: var(--r-pill); background: var(--tint); color: var(--primary); font-weight: 600; font-size: var(--fs-xs); align-self: center; }
.usage-tile .meter { height: 8px; margin-top: 10px; }
.usage-tile .meter.ghost { background: repeating-linear-gradient(90deg, var(--selected) 0 6px, transparent 6px 10px); }
.usage-tile.high .meter > span { background: #C27C0E; }
.usage-tile.full .meter > span { background: var(--alert); }
.usage-tile.full { border-color: color-mix(in srgb, var(--alert) 35%, var(--line)); }

.bill-compare { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.bill-compare > summary { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; padding: 16px 20px; cursor: pointer; list-style: none; font-weight: 700; font-size: var(--fs-lg); }
.bill-compare > summary::-webkit-details-marker { display: none; }
.bill-compare > summary::after { content: "+"; margin-left: auto; font: 500 20px/1 var(--mono); color: var(--ink-muted); }
.bill-compare[open] > summary::after { content: "\2212"; }
.bill-compare-body { padding: 0 20px 20px; display: grid; gap: 14px; }
.bill-compare .compare-wrap { box-shadow: none; }
.compare-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px; margin-top: 4px; font-weight: 400; }
.compare-price .amount { font-size: 20px; color: var(--ink); }
.compare-price .per { font-size: var(--fs-xs); }
.compare td .icon { width: 18px; height: 18px; color: var(--ok); }
/* "Have a code?" (app.js codeEntry): a quiet button, the discount code waiting for checkout, its dialog, and the
   congrats dialog after a partner code (a lemon burst; still under prefers-reduced-motion). */
.code-entry { display: grid; gap: 10px; justify-items: start; margin-top: 16px; }
.code-entry .btn.link-btn, .code-applied .btn.link-btn { background: transparent; border-color: transparent; box-shadow: none; color: var(--primary); padding-inline: 4px; min-height: 0; }
.code-entry .code-open { gap: 8px; font-weight: 600; }
.code-entry .code-open .icon { width: 18px; height: 18px; }
.code-entry .btn.link-btn:hover { background: var(--tint); }
.code-applied:empty { display: none; }
.code-applied { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-tint); border-radius: var(--r-md); max-width: 640px; }
.code-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); background: var(--soft); border: 1px dashed color-mix(in srgb, var(--ink) 30%, transparent); font-size: var(--fs-md); font-weight: 600; letter-spacing: 0.04em; }
.code-chip .icon { width: 14px; height: 14px; color: var(--ok); }
.code-dialog-form { display: grid; gap: 14px; }
.code-dialog-form .actions { margin-top: 6px; }
.code-dialog-head { display: flex; align-items: center; gap: 12px; }
.code-dialog-head h2 { margin: 0; }
.code-dialog-head h2:focus { outline: none; }
.code-dialog-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--field); color: #1E1D19; }
.code-dialog-icon .icon { width: 20px; height: 20px; }
.code-dialog-icon.ok { background: var(--ok-tint); color: var(--ok); }
.code-dialog input.mono { font-family: var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.code-dialog input.mono::placeholder { text-transform: none; letter-spacing: 0; }
.code-saved-line { font-weight: 600; font-size: var(--fs-base); }
.congrats-dialog { width: min(480px, calc(100vw - 32px)); text-align: center; padding: 0 24px 24px; overflow: hidden; }
.congrats-dialog h2 { font-size: var(--fs-xl); margin: 0 0 8px; }
.congrats-dialog .sh-eyebrow { margin: 0 0 8px; }
.congrats-dialog .cg-lede { color: var(--ink-muted); margin: 0 auto 16px; max-width: 36ch; }
.congrats-dialog .cg-box { text-align: start; border: 1px solid var(--line); background: var(--paper); border-radius: var(--r-md); padding: 14px 16px; margin-top: 10px; }
.congrats-dialog .cg-box-title { font-weight: 650; font-size: var(--fs-md); margin-bottom: 8px; }
.congrats-dialog .actions { justify-content: center; }
.cg-burst { position: relative; overflow: hidden; height: 150px; margin: 0 -24px 4px; background: radial-gradient(circle at 50% 62%, color-mix(in srgb, var(--field) 55%, transparent) 0, transparent 62%); }
.cg-lemon { position: absolute; left: 50%; top: 58%; width: 72px; height: 72px; margin: -36px 0 0 -36px; display: grid; place-items: center; border-radius: 50% 50% 46% 54% / 56% 50% 50% 44%;
  background: var(--field); color: #1E1D19; box-shadow: 0 0 0 6px color-mix(in srgb, var(--field) 35%, transparent), 4px 5px 0 var(--brand); animation: cg-pop 620ms cubic-bezier(.2, 1.6, .4, 1) both; }
.cg-lemon .icon { width: 34px; height: 34px; stroke-width: 2.6; }
.cg-rays { position: absolute; left: 50%; top: 58%; width: 220px; height: 220px; margin: -110px 0 0 -110px; border-radius: 50%;
  background: repeating-conic-gradient(color-mix(in srgb, var(--field) 70%, transparent) 0 8deg, transparent 8deg 30deg); -webkit-mask: radial-gradient(circle, transparent 38%, #000 40%, transparent 70%); mask: radial-gradient(circle, transparent 38%, #000 40%, transparent 70%);
  animation: cg-rays 900ms ease-out both, cg-spin 18s linear 900ms infinite; }
.cg-bit { position: absolute; left: 50%; top: 58%; width: 8px; height: 14px; margin: -7px 0 0 -4px; background: var(--c); border-radius: 2px; opacity: 0;
  animation: cg-fly 1100ms cubic-bezier(.15, .7, .3, 1) var(--t) forwards; }
.cg-bit.round { width: 9px; height: 9px; border-radius: 50%; }
@keyframes cg-pop { 0% { transform: scale(0.2) rotate(-25deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes cg-rays { 0% { transform: scale(0.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes cg-spin { to { transform: rotate(360deg); } }
@keyframes cg-fly { 0% { opacity: 1; transform: translate(0, 0) rotate(0) scale(0.6); } 70% { opacity: 1; } 100% { opacity: 0.9; transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .cg-lemon, .cg-rays { animation: none; }
  .cg-bit { animation: none; opacity: 0.9; transform: translate(var(--x), var(--y)) rotate(var(--r)); }
}
@media (max-width: 480px) {
  .congrats-dialog { padding: 0 18px 18px; }
  .cg-burst { margin: 0 -18px 4px; }
  .congrats-dialog .actions, .code-dialog .actions { flex-direction: column-reverse; }
  .congrats-dialog .actions .btn, .code-dialog .actions .btn { width: 100%; }
}
.bill-invite { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 32px; padding: 14px 16px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); color: var(--ink-muted); }
.bill-invite .icon { width: 18px; height: 18px; color: var(--ink); }
.bill-invite a { font-weight: 600; }
@media (max-width: 480px) {
  .bill-hero { padding: 22px 16px; border-radius: 18px; }
  .bill-cta .btn:not(.link-btn) { width: 100%; }
  .bill-gains { padding: 16px; box-shadow: 4px 4px 0 var(--pop-line); }
  .usage-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .usage-tile { padding: 12px; }
  .usage-num { font-size: var(--fs-lg); }
  .bill-compare-body { padding: 0 12px 14px; }
}
