/*
 * Conta OMEGA CLI — design tokens and components.
 * Apple Human Interface Guidelines, adapted to the web: system font stack,
 * 8 pt grid, system-like semantic colors with automatic light/dark mode,
 * grouped cards, capsule buttons, sheets, materials and generous whitespace.
 * Brand: OMEGA purple rgb(178,102,255) (strong rgb(130,60,210), light rgb(210,160,255))
 * and light blue rgb(120,200,255). Every text color here meets WCAG AA on its background.
 */

/* ---- tokens: light (default) ---------------------------------------------------------- */
:root {
  color-scheme: light dark;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-3xl: 28px;
  --radius-full: 999px;

  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out: cubic-bezier(0, 0, 0.58, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --dur-fast: 150ms;
  --dur: 200ms;
  --dur-slow: 300ms;

  --bg: #f2f2f7;
  --card: #ffffff;
  --elevated: #ffffff;
  --fill: rgba(120, 120, 128, 0.12);
  --fill-strong: rgba(120, 120, 128, 0.2);
  --label: #1c1c1e;
  --label-2: rgba(60, 60, 67, 0.8);
  --label-3: rgba(60, 60, 67, 0.55);
  --separator: rgba(60, 60, 67, 0.2);
  --segment-on: #ffffff;

  --brand: rgb(178, 102, 255);
  --brand-strong: rgb(130, 60, 210);
  --brand-text: rgb(130, 60, 210);
  --brand-soft: rgba(178, 102, 255, 0.14);
  --brand-line: rgba(178, 102, 255, 0.45);
  --sky: rgb(120, 200, 255);
  --grad-a: rgb(130, 60, 210);
  --grad-b: rgb(52, 110, 214);

  --green: #1b7a34;
  --green-soft: rgba(52, 199, 89, 0.16);
  --blue: #0a62b0;
  --blue-soft: rgba(120, 200, 255, 0.24);
  --orange: #9e4f00;
  --orange-soft: rgba(255, 149, 0, 0.16);
  --red: #c4001a;
  --red-soft: rgba(255, 59, 48, 0.12);
  --red-strong: #d70015;
  --gray: #56565c;
  --gray-soft: rgba(120, 120, 128, 0.16);

  --code-bg: #1d1b22;
  --code-fg: #f5f5f7;
  --code-accent: rgb(210, 160, 255);

  --material: rgba(250, 250, 252, 0.78);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
  --shadow-hero: 0 1px 2px rgba(0, 0, 0, 0.04), 0 24px 60px rgba(60, 20, 110, 0.1);
  --shadow-sheet: 0 24px 60px rgba(0, 0, 0, 0.25);
  --shadow-primary: 0 1px 2px rgba(0, 0, 0, 0.08), 0 8px 20px rgba(130, 60, 210, 0.28);
  --focus: rgba(178, 102, 255, 0.7);
  --focus-soft: rgba(178, 102, 255, 0.28);
  --glow: rgba(178, 102, 255, 0.16);
  --glow-2: rgba(120, 200, 255, 0.14);
}

/* ---- tokens: dark (automatic, or forced with data-tema) ---------------------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) {
    --bg: #000000;
    --card: #1c1c1e;
    --elevated: #2c2c2e;
    --fill: rgba(120, 120, 128, 0.24);
    --fill-strong: rgba(120, 120, 128, 0.36);
    --label: #f5f5f7;
    --label-2: rgba(235, 235, 245, 0.72);
    --label-3: rgba(235, 235, 245, 0.45);
    --separator: rgba(84, 84, 88, 0.65);
    --segment-on: #636366;
    --brand-text: rgb(210, 160, 255);
    --brand-soft: rgba(178, 102, 255, 0.22);
    --brand-line: rgba(178, 102, 255, 0.55);
    --grad-a: rgb(210, 160, 255);
    --grad-b: rgb(120, 200, 255);
    --green: #30d158;
    --green-soft: rgba(48, 209, 88, 0.18);
    --blue: rgb(120, 200, 255);
    --blue-soft: rgba(120, 200, 255, 0.18);
    --orange: #ff9f0a;
    --orange-soft: rgba(255, 159, 10, 0.18);
    --red: #ff6961;
    --red-soft: rgba(255, 69, 58, 0.2);
    --gray: #aeaeb2;
    --gray-soft: rgba(120, 120, 128, 0.28);
    --code-bg: #0e0d12;
    --material: rgba(22, 22, 24, 0.72);
    --shadow-card: 0 0 0 0.5px rgba(255, 255, 255, 0.08);
    --shadow-hero: 0 0 0 0.5px rgba(255, 255, 255, 0.08), 0 24px 60px rgba(0, 0, 0, 0.5);
    --shadow-sheet: 0 0 0 0.5px rgba(255, 255, 255, 0.1), 0 24px 60px rgba(0, 0, 0, 0.6);
    --shadow-primary: 0 8px 24px rgba(130, 60, 210, 0.4);
    --glow: rgba(178, 102, 255, 0.24);
    --glow-2: rgba(120, 200, 255, 0.12);
  }
}
:root[data-tema="escuro"] {
  --bg: #000000;
  --card: #1c1c1e;
  --elevated: #2c2c2e;
  --fill: rgba(120, 120, 128, 0.24);
  --fill-strong: rgba(120, 120, 128, 0.36);
  --label: #f5f5f7;
  --label-2: rgba(235, 235, 245, 0.72);
  --label-3: rgba(235, 235, 245, 0.45);
  --separator: rgba(84, 84, 88, 0.65);
  --segment-on: #636366;
  --brand-text: rgb(210, 160, 255);
  --brand-soft: rgba(178, 102, 255, 0.22);
  --brand-line: rgba(178, 102, 255, 0.55);
  --grad-a: rgb(210, 160, 255);
  --grad-b: rgb(120, 200, 255);
  --green: #30d158;
  --green-soft: rgba(48, 209, 88, 0.18);
  --blue: rgb(120, 200, 255);
  --blue-soft: rgba(120, 200, 255, 0.18);
  --orange: #ff9f0a;
  --orange-soft: rgba(255, 159, 10, 0.18);
  --red: #ff6961;
  --red-soft: rgba(255, 69, 58, 0.2);
  --gray: #aeaeb2;
  --gray-soft: rgba(120, 120, 128, 0.28);
  --code-bg: #0e0d12;
  --material: rgba(22, 22, 24, 0.72);
  --shadow-card: 0 0 0 0.5px rgba(255, 255, 255, 0.08);
  --shadow-hero: 0 0 0 0.5px rgba(255, 255, 255, 0.08), 0 24px 60px rgba(0, 0, 0, 0.5);
  --shadow-sheet: 0 0 0 0.5px rgba(255, 255, 255, 0.1), 0 24px 60px rgba(0, 0, 0, 0.6);
  --shadow-primary: 0 8px 24px rgba(130, 60, 210, 0.4);
  --glow: rgba(178, 102, 255, 0.24);
  --glow-2: rgba(120, 200, 255, 0.12);
  color-scheme: dark;
}
:root[data-tema="claro"] {
  color-scheme: light;
}

@media (prefers-contrast: more) {
  :root {
    --label-2: rgba(60, 60, 67, 0.95);
    --separator: rgba(60, 60, 67, 0.5);
  }
}

/* ---- base ---------------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.01em;
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* Soft brand glow behind the top of every page. */
body::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 560px;
  background:
    radial-gradient(760px 320px at 18% -80px, var(--glow), transparent 70%),
    radial-gradient(620px 300px at 88% -60px, var(--glow-2), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
a {
  color: var(--brand-text);
  text-underline-offset: 3px;
}
a:not(.btn):not(.tile):not(.tab):not(.segment):not(.brand) {
  text-decoration: none;
}
a:not(.btn):not(.tile):not(.tab):not(.segment):not(.brand):hover {
  text-decoration: underline;
}
strong,
b {
  font-weight: 600;
}
::selection {
  background: rgba(178, 102, 255, 0.3);
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
:focus:not(:focus-visible) {
  outline: none;
}
main:focus {
  outline: none;
}
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.icon,
.tab-icon,
.hero-icon,
.feature-icon,
.notice-icon,
.inline-icon,
.chevron {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.inline-icon {
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  color: var(--brand-text);
}
.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
  letter-spacing: 0;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--brand-strong);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus {
  top: 12px;
}

/* ---- typography ------------------------------------------------------------------------------ */
.large-title {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.title1 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.022em;
}
.title2 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.title3 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.headline {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-1);
  font-size: 17px;
  line-height: 1.35;
  font-weight: 600;
}
.lead {
  margin: 0;
  max-width: 62ch;
  font-size: 17px;
  color: var(--label-2);
}
.secondary {
  display: block;
  margin: 0;
  font-size: 15px;
  color: var(--label-2);
}
.caption {
  margin: var(--space-3) 0 0;
  font-size: 13px;
  color: var(--label-2);
}
.eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--label-2);
}
.section-title {
  margin: var(--space-8) var(--space-1) var(--space-2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--label-2);
}
.stack > .section-title:first-child {
  margin-top: 0;
}

/* ---- top bar (material) ------------------------------------------------------------------------ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--material);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--separator);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar,
  .tabbar {
    background: var(--card);
  }
}
.topbar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-4);
  max-width: 1080px;
  height: 60px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}
.topbar-public .topbar-inner {
  grid-template-columns: 1fr auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  justify-self: start;
  color: var(--label);
  text-decoration: none;
}
.brand-logo {
  width: 32px;
  height: 32px;
  flex: none;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brand-sub {
  font-size: 12px;
  color: var(--label-2);
}
.segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 11px;
  background: var(--fill);
}
.segment {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--label);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease);
}
.segment:hover {
  background: var(--fill);
}
.segment[aria-current="page"] {
  background: var(--segment-on);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}
.account {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  min-width: 0;
}
.account-email {
  max-width: 220px;
  overflow: hidden;
  font-size: 13px;
  color: var(--label-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inline-form {
  display: inline;
  margin: 0;
}

/* ---- layout ------------------------------------------------------------------------------------ */
.page {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--space-10) var(--space-5) var(--space-16);
}
.page-header {
  margin-bottom: var(--space-8);
}
.center-stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  place-items: center;
  padding: var(--space-12) var(--space-4);
}
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
}
@media (min-width: 1024px) {
  .overview-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: start;
  }
}
.footer {
  position: relative;
  z-index: 1;
  padding: var(--space-6) var(--space-4) var(--space-8);
  text-align: center;
  font-size: 13px;
  color: var(--label-2);
}
.footer p {
  margin: 0;
}

/* ---- cards ----------------------------------------------------------------------------------- */
.card {
  position: relative;
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow-card);
}
.plan-card {
  overflow: hidden;
  padding: var(--space-8) var(--space-8) var(--space-6);
  box-shadow: var(--shadow-hero);
}
.plan-card::before,
.plan-card::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.plan-card::before {
  top: -160px;
  right: -120px;
  width: 380px;
  height: 380px;
  background: radial-gradient(closest-side, var(--glow), transparent);
}
.plan-card::after {
  bottom: -200px;
  left: -140px;
  width: 360px;
  height: 360px;
  background: radial-gradient(closest-side, var(--glow-2), transparent);
}
.plan-card > * {
  position: relative;
  z-index: 1;
}
.plan-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.plan-title {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.brand-word {
  color: var(--brand-text);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand-word {
    background: linear-gradient(95deg, var(--grad-a), var(--grad-b));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}
.plan-line {
  margin: 0;
  font-size: 17px;
  color: var(--label-2);
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin: var(--space-6) 0 var(--space-4);
  padding-top: var(--space-5);
  border-top: 0.5px solid var(--separator);
}
.stat dt {
  margin-bottom: var(--space-1);
  font-size: 13px;
  color: var(--label-2);
}
.stat dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat .of {
  font-size: 15px;
  font-weight: 500;
  color: var(--label-2);
}

/* meter: width via classes (no style attributes under the CSP) */
.meter {
  height: 8px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: var(--fill);
}
.meter-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--sky));
}
.w-0 { width: 0; }
.w-5 { width: 5%; }
.w-10 { width: 10%; }
.w-15 { width: 15%; }
.w-20 { width: 20%; }
.w-25 { width: 25%; }
.w-30 { width: 30%; }
.w-35 { width: 35%; }
.w-40 { width: 40%; }
.w-45 { width: 45%; }
.w-50 { width: 50%; }
.w-55 { width: 55%; }
.w-60 { width: 60%; }
.w-65 { width: 65%; }
.w-70 { width: 70%; }
.w-75 { width: 75%; }
.w-80 { width: 80%; }
.w-85 { width: 85%; }
.w-90 { width: 90%; }
.w-95 { width: 95%; }
.w-100 { width: 100%; }

/* ---- pills and tones ----------------------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.pill-green,
.tone-green { color: var(--green); background: var(--green-soft); }
.pill-blue,
.tone-blue { color: var(--blue); background: var(--blue-soft); }
.pill-orange,
.tone-orange { color: var(--orange); background: var(--orange-soft); }
.pill-red,
.tone-red { color: var(--red); background: var(--red-soft); }
.pill-gray,
.tone-gray { color: var(--gray); background: var(--gray-soft); }
.tone-brand { color: var(--brand-text); background: var(--brand-soft); }

/* ---- tiles (quick actions) -------------------------------------------------------------------- */
.tiles {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.tile {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 72px;
  padding: var(--space-4);
  color: var(--label);
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease);
}
.tile:hover {
  box-shadow: var(--shadow-card), 0 0 0 1.5px var(--brand-line);
}
.tile:active {
  transform: scale(0.98);
}
.tile-icon,
.row-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 11px;
}
.tile-icon .icon,
.row-icon .icon {
  width: 22px;
  height: 22px;
}
.tile-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.tile-title {
  font-weight: 600;
}
.tile-sub {
  font-size: 15px;
  color: var(--label-2);
}
.chevron {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
  color: var(--label-3);
}
.how-to .command {
  margin-top: var(--space-3);
}

/* ---- buttons ---------------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--fill);
  --btn-fg: var(--brand-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 11px 22px;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 600 17px/1.25 var(--font);
  letter-spacing: -0.01em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: transform var(--dur-fast) var(--ease), filter var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.btn:hover {
  filter: brightness(1.07) saturate(1.05);
}
.btn:active {
  transform: scale(0.97);
}
.btn .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}
.btn[disabled],
.btn[aria-busy="true"] {
  cursor: progress;
  opacity: 0.72;
  transform: none;
}
.btn[aria-busy="true"]::after {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.btn-primary {
  --btn-bg: var(--brand-strong);
  --btn-fg: #ffffff;
  box-shadow: var(--shadow-primary);
}
.btn-tinted {
  --btn-bg: var(--brand-soft);
  --btn-fg: var(--brand-text);
}
.btn-plain {
  --btn-bg: transparent;
  --btn-fg: var(--brand-text);
  padding-inline: var(--space-3);
}
.btn-plain:hover {
  --btn-bg: var(--fill);
  filter: none;
}
.btn-destructive {
  --btn-bg: var(--red-strong);
  --btn-fg: #ffffff;
}
.btn-destructive-tinted {
  --btn-bg: var(--red-soft);
  --btn-fg: var(--red);
}
.btn-compact {
  min-height: 36px;
  padding: 7px 14px;
  font-size: 15px;
}
.btn-large {
  min-height: 54px;
  padding: 15px 30px;
}
.btn-block {
  width: 100%;
}
@media (pointer: coarse) {
  .btn-compact {
    min-height: 44px;
  }
}
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
.button-row.center {
  justify-content: center;
}

/* ---- forms ------------------------------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  text-align: left;
}
.field-label {
  font-size: 15px;
  font-weight: 600;
}
.input {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--fill);
  color: var(--label);
  font: 400 17px/1.3 var(--font);
  -webkit-appearance: none;
  appearance: none;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.input::placeholder {
  color: var(--label-3);
}
.input:hover {
  background: var(--fill-strong);
}
.input:focus,
.input:focus-visible {
  outline: none;
  border-color: var(--brand);
  background: var(--card);
  box-shadow: 0 0 0 4px var(--focus-soft);
}
.has-error .input {
  border-color: var(--red);
}
.field-error {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 15px;
  color: var(--red);
}
.field-error .icon {
  width: 18px;
  height: 18px;
}

/* ---- centered cards (sign-in, confirmations, errors) -------------------------------------------- */
.auth-card {
  width: 100%;
  max-width: 440px;
  padding: var(--space-10) var(--space-8) var(--space-8);
  border-radius: var(--radius-3xl);
  background: var(--card);
  box-shadow: var(--shadow-hero);
  text-align: center;
}
.auth-card .lead {
  margin: 0 auto var(--space-8);
}
.auth-card .stack {
  gap: var(--space-5);
}
.logo-hero {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto var(--space-6);
  filter: drop-shadow(0 10px 24px rgba(130, 60, 210, 0.35));
}
.hero-symbol {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto var(--space-6);
  border-radius: 50%;
}
.hero-icon {
  width: 34px;
  height: 34px;
  stroke-width: 1.7;
}
.hero-symbol.small {
  width: 56px;
  height: 56px;
  margin: 0 0 var(--space-4);
}
.hero-symbol.small .hero-icon {
  width: 28px;
  height: 28px;
}
.features {
  display: grid;
  gap: var(--space-4);
  margin: var(--space-8) 0 0;
  padding: var(--space-6) 0 0;
  border-top: 0.5px solid var(--separator);
  list-style: none;
  text-align: left;
}
.features li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.feature-icon {
  width: 34px;
  height: 34px;
  padding: 7px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-text);
}
.features strong {
  display: block;
  font-size: 15px;
}
.features span {
  display: block;
  font-size: 14px;
  color: var(--label-2);
}
.fine {
  margin: var(--space-6) 0 0;
  font-size: 14px;
  color: var(--label-2);
}
.checklist {
  display: grid;
  gap: var(--space-3);
  margin: 0 0 var(--space-6);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--fill);
  list-style: none;
  text-align: left;
}
.checklist li {
  display: flex;
  gap: var(--space-3);
  font-size: 15px;
  color: var(--label-2);
}
.checklist .icon {
  margin-top: 1px;
  color: var(--brand-text);
}
.checklist strong {
  color: var(--label);
}

/* ---- notices --------------------------------------------------------------------------------- */
.notice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin: 0 0 var(--space-6);
  padding: 14px var(--space-4);
  border-radius: 14px;
  font-size: 15px;
  text-align: left;
  color: var(--label);
}
.notice-icon {
  margin-top: 1px;
}
.notice a {
  font-weight: 600;
}
.notice-info { background: var(--blue-soft); }
.notice-info .notice-icon { color: var(--blue); }
.notice-success { background: var(--green-soft); }
.notice-success .notice-icon { color: var(--green); }
.notice-warning { background: var(--orange-soft); }
.notice-warning .notice-icon { color: var(--orange); }
.notice-error { background: var(--red-soft); }
.notice-error .notice-icon { color: var(--red); }
.card > .notice:last-child {
  margin-bottom: 0;
}

/* ---- grouped lists --------------------------------------------------------------------------- */
.list-card {
  overflow: hidden;
  padding: 0;
}
.capacity {
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 0.5px solid var(--separator);
}
.capacity-text {
  margin-bottom: 10px;
}
.capacity-number {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 14px var(--space-5);
}
.row + .row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 74px;
  right: 0;
  border-top: 0.5px solid var(--separator);
}
.row-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.row-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
}
.row-badge {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--fill);
  font-size: 12px;
  font-weight: 600;
  color: var(--label-2);
}
.row-sub {
  font-size: 15px;
  color: var(--label-2);
}
.row-meta {
  font-size: 13px;
  color: var(--label-2);
}
.row-meta .mono {
  white-space: nowrap;
}
.os-windows { color: var(--blue); background: var(--blue-soft); }
.os-mac { color: var(--label); background: var(--gray-soft); }
.os-linux { color: var(--orange); background: var(--orange-soft); }
.os-desktop { color: var(--gray); background: var(--gray-soft); }

/* ---- terminal command ------------------------------------------------------------------------ */
.command {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
  padding: 10px 10px 10px var(--space-4);
  border-radius: 14px;
  background: var(--code-bg);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.08);
  text-align: left;
}
.command code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  padding: 4px 0;
  color: var(--code-fg);
  font: 500 15px/1.5 var(--font-mono);
  white-space: nowrap;
  scrollbar-width: thin;
}
.prompt {
  color: var(--code-accent);
  user-select: none;
}
.command .copy {
  --btn-bg: rgba(255, 255, 255, 0.12);
  --btn-fg: #ffffff;
  flex: none;
}

/* ---- license key ---------------------------------------------------------------------------- */
.key-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.key-masked {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}
.divider {
  height: 0.5px;
  margin: var(--space-5) 0;
  background: var(--separator);
}
.key-reveal {
  margin-bottom: var(--space-4);
  padding: var(--space-8);
  box-shadow: var(--shadow-hero);
}
.keybox {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-3);
}
.key-text {
  display: block;
  padding: var(--space-5);
  border: 1.5px dashed var(--brand-line);
  border-radius: var(--radius-lg);
  background: var(--brand-soft);
  color: var(--label);
  font: 600 clamp(16px, 4.4vw, 22px) / 1.45 var(--font-mono);
  letter-spacing: 0.04em;
  text-align: center;
  overflow-wrap: anywhere;
  user-select: all;
}
@media (min-width: 744px) {
  .keybox {
    flex-direction: row;
    align-items: center;
  }
  .key-text {
    flex: 1;
  }
}
.steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
}
.steps li {
  display: flex;
  gap: 14px;
}
.steps li > div {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.step-n {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-text);
  font-size: 15px;
  font-weight: 700;
}

/* ---- empty states ---------------------------------------------------------------------------- */
.empty {
  padding: var(--space-12) var(--space-6);
  border-radius: var(--radius-2xl);
  background: var(--card);
  box-shadow: var(--shadow-card);
  text-align: center;
}
.logo-empty {
  display: block;
  width: 88px;
  height: 88px;
  margin: 0 auto var(--space-6);
  filter: drop-shadow(0 12px 28px rgba(130, 60, 210, 0.35));
}
.empty-text {
  max-width: 44ch;
  margin: var(--space-2) auto 0;
  color: var(--label-2);
}
.empty-inline {
  padding: var(--space-10) var(--space-6);
  text-align: center;
}
.empty-inline .command {
  max-width: 440px;
  margin: var(--space-5) auto 0;
}

/* ---- payment --------------------------------------------------------------------------------- */
.pay-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  margin-top: var(--space-6);
}

/* ---- sheets (native <dialog>) ------------------------------------------------------------------ */
.sheet {
  width: min(420px, calc(100% - 32px));
  max-width: 420px;
  padding: var(--space-2) var(--space-6) var(--space-6);
  border: 0;
  border-radius: var(--radius-2xl);
  background: var(--elevated);
  color: var(--label);
  box-shadow: var(--shadow-sheet);
  text-align: center;
}
.sheet::backdrop {
  background: rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.sheet[open] {
  animation: sheet-in var(--dur-slow) var(--ease-spring);
}
.sheet[open]::backdrop {
  animation: fade-in var(--dur) var(--ease-out);
}
.sheet-grabber {
  display: none;
  width: 36px;
  height: 5px;
  margin: 0 auto var(--space-2);
  border-radius: 3px;
  background: var(--fill-strong);
}
.sheet-symbol {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: var(--space-4) auto;
  border-radius: 50%;
}
.sheet-symbol .hero-icon {
  width: 28px;
  height: 28px;
}
.sheet-title {
  margin: 0 0 var(--space-2);
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.sheet-message {
  margin: 0 0 var(--space-6);
  font-size: 15px;
  color: var(--label-2);
}
.sheet-actions {
  display: flex;
  gap: var(--space-3);
  margin: 0;
}
.sheet-actions .btn {
  flex: 1;
}
@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: none;
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- tab bar (compact width) --------------------------------------------------------------- */
.tabbar {
  display: none;
}

@media (max-width: 743px) {
  .topbar-inner {
    grid-template-columns: 1fr auto;
    height: 56px;
    padding: 0 var(--space-4);
  }
  .segmented,
  .account-email {
    display: none;
  }
  .page {
    padding: var(--space-6) var(--space-4) var(--space-8);
  }
  .page-header {
    margin-bottom: var(--space-6);
  }
  .large-title {
    font-size: 30px;
  }
  .card:not(.list-card) {
    padding: var(--space-5);
  }
  .plan-card {
    padding: var(--space-6) var(--space-5) var(--space-5);
  }
  .plan-title {
    font-size: 28px;
  }
  .stat dd {
    font-size: 20px;
  }
  .key-reveal {
    padding: var(--space-5);
  }
  .auth-card {
    padding: var(--space-8) var(--space-5) var(--space-6);
    border-radius: var(--radius-2xl);
  }
  .center-stage {
    padding: var(--space-6) var(--space-4);
    align-items: start;
  }
  .row {
    align-items: flex-start;
    padding: 14px var(--space-4);
  }
  .row > .btn {
    align-self: center;
  }
  .row + .row::before {
    left: 70px;
  }
  .pay-form {
    align-items: stretch;
    text-align: center;
  }
  .command .copy span {
    display: none;
  }
  /* Bottom sheet with grabber; destructive action on top, Cancel at the bottom. */
  .sheet {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  }
  .sheet[open] {
    animation: sheet-up var(--dur-slow) var(--ease-out);
  }
  .sheet-grabber {
    display: block;
  }
  .sheet-actions {
    flex-direction: column-reverse;
  }
  .has-session .tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 6px var(--space-2) calc(6px + env(safe-area-inset-bottom));
    background: var(--material);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-top: 0.5px solid var(--separator);
  }
  .tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    padding: 2px;
    border-radius: 10px;
    color: var(--label-2);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
    text-decoration: none;
  }
  .tab[aria-current="page"] {
    color: var(--brand-text);
    font-weight: 600;
  }
  .tab-icon {
    width: 26px;
    height: 26px;
    stroke-width: 1.7;
  }
  .tab[aria-current="page"] .tab-icon {
    stroke-width: 2.2;
  }
  .has-session .footer {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 380px) {
  .stats {
    gap: var(--space-2);
  }
  .stat dt {
    font-size: 12px;
  }
  .brand-sub {
    display: none;
  }
}

/* ---- accessibility preferences ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .btn:active,
  .tile:active {
    transform: none;
  }
}
@media (forced-colors: active) {
  .btn {
    border: 1px solid ButtonText;
  }
  .brand-word {
    color: CanvasText;
    background: none;
  }
  .meter-fill {
    background: Highlight;
  }
  .pill,
  .notice {
    border: 1px solid CanvasText;
  }
}
@media print {
  .topbar,
  .tabbar,
  .footer,
  .btn {
    display: none !important;
  }
  body::before {
    display: none;
  }
}
