/* Scoped to the three public application pages; admin screens keep stock styles. */
html[data-dlg-page="auth"], html[data-dlg-page="pricing"] {
  --background: #f7f8fc;
  --foreground: #101625;
  --card: #fff;
  --card-foreground: #101625;
  --popover: #fff;
  --popover-foreground: #101625;
  --muted: #eef0f8;
  --muted-foreground: #596378;
  --border: #e2e5ee;
  --input: #d4d9e5;
  --primary: #4f46e5;
  --primary-foreground: #fff;
  --ring: #818cf8;
  --dlg-wash: radial-gradient(ellipse at 12% 0%, #e6e8ff 0, transparent 55%), radial-gradient(ellipse at 100% 0%, #e1f5f8 0, transparent 48%), #f7f8fc;
}
html.dark[data-dlg-page="auth"], html.dark[data-dlg-page="pricing"] {
  --background: #07091a;
  --foreground: #f5f7ff;
  --card: #0f1426;
  --card-foreground: #f5f7ff;
  --popover: #141b34;
  --popover-foreground: #f5f7ff;
  --muted: #1b2440;
  --muted-foreground: #a8b2cc;
  --border: #2b3552;
  --input: #354362;
  --primary: #a5b4fc;
  --primary-foreground: #111733;
  --ring: #a5b4fc;
  --dlg-wash: radial-gradient(ellipse at 12% 0%, #1b2150 0, transparent 55%), radial-gradient(ellipse at 100% 0%, #103443 0, transparent 48%), #07091a;
}
html[data-dlg-page]:not([data-dlg-page=""]) body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--background);
}
html[data-dlg-page]:not([data-dlg-page=""]) ::selection { background: #c7d2fe; color: #101625; }
html[data-dlg-page]:not([data-dlg-page=""]) :is(button,a,input):focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }
.dlg-auth-shell { height: auto; min-height: 100svh; background: var(--dlg-wash); }
.dlg-auth-shell > a[href="/"] { top: 24px; left: 32px; min-height: 40px; gap: 10px; }
.dlg-auth-shell > a h1 { font-size: 20px; font-weight: 700; }
.dlg-auth-layout { width: 100%; max-width: none; min-height: 100svh; align-items: flex-start; padding: clamp(96px, 15vh, 144px) 24px 48px; }
.dlg-auth-card { width: 100%; max-width: 440px; margin: 0 auto; padding: 32px; border-radius: 16px; background: var(--card); box-shadow: 0 16px 48px rgb(25 35 70 / 8%); }
.dlg-auth-content { display: flex; flex-direction: column; gap: 28px; }
.dlg-auth-content > * { margin-block: 0; }
.dlg-auth-intro h2 { margin: 0 0 10px; text-align: left; font-size: 30px; line-height: 1.3; letter-spacing: -.02em; }
.dlg-auth-intro p { margin: 0; font-size: 14px; line-height: 1.7; }
.dlg-auth-card a { color: var(--primary); text-underline-offset: 4px; }
.dlg-auth-card form { gap: 20px; }
.dlg-auth-card [data-slot="form-item"] { gap: 9px; }
.dlg-auth-card [data-slot="form-label"] { font-size: 14px; line-height: 20px; }
.dlg-auth-card input { height: 48px; border-radius: 10px; padding: 12px 14px; background: var(--background); font-size: 16px; line-height: 22px; }
.dlg-auth-card input:not([aria-invalid="true"]) { border-color: var(--input); }
.dlg-auth-card input:has(+ button[data-dlg-password]) { padding-right: 50px; }
.dlg-auth-card button[data-dlg-password] { width: 44px; height: 44px; right: 2px; border-radius: 8px; }
.dlg-auth-card button[type="submit"] { min-height: 48px; border-radius: 10px; margin-top: 4px; font-size: 15px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #4f46e5, #605bea); }
.dlg-auth-card a[href="/forgot-password"] { top: -2px; padding: 3px 0; font-size: 13px; }

html[data-dlg-page="pricing"] #root > .bg-background { background: var(--dlg-wash); }
.dlg-market-content { max-width: 1240px; padding: 88px 24px 40px; }
.dlg-market-intro { padding-top: 12px; margin-bottom: 28px; }
.dlg-market-intro h1 { font-size: clamp(30px, 4vw, 42px); line-height: 1.2; letter-spacing: -.02em; }
.dlg-market-intro > p { color: var(--muted-foreground); line-height: 1.7; }
.dlg-market-intro > p:nth-of-type(2) { font-size: 14px; }
.dlg-market-intro input { height: 48px; border-radius: 12px; background: var(--card); font-size: 16px; }
.dlg-market-intro input::placeholder { color: var(--muted-foreground); }
.dlg-market-toolbar { border-radius: 14px; padding: 12px; }
.dlg-market-toolbar button { min-height: 36px; border-radius: 8px; }
.dlg-market-toolbar [data-slot="toggle-group"] { min-height: 36px; }
.dlg-market-toolbar [data-slot="tooltip-trigger"] { min-width: 36px; }
.dlg-market-main > .border-dashed { min-height: 240px; padding: 32px 24px; border-radius: 16px; background: var(--card); }
.dlg-market-content aside { border-radius: 14px; padding: 16px; }
.dlg-market-content [data-slot="card"] { border-radius: 14px; background: var(--card); }
.dlg-market-content [data-slot="card"] h3 { line-height: 1.5; overflow-wrap: anywhere; }
.dlg-market-content [data-slot="card-footer"] button { min-height: 40px; }
html[data-dlg-page="pricing"] [data-slot="sheet-content"] { background: var(--card); color: var(--foreground); }
@media (max-width: 640px) {
  .dlg-auth-shell > a[href="/"] { top: 18px; left: 20px; }
  .dlg-auth-layout { padding: 84px 16px 32px; }
  .dlg-auth-card { padding: 26px 22px; }
  .dlg-auth-content { gap: 24px; }
  .dlg-auth-intro h2 { font-size: 28px; }
  .dlg-market-content { padding: 84px 14px 28px; }
  .dlg-market-intro { padding-top: 0; margin-bottom: 20px; }
  .dlg-market-intro h1 { font-size: 30px; }
  .dlg-market-intro > p { font-size: 14px; }
  .dlg-market-intro input { padding-right: 12px; }
  .dlg-market-toolbar { padding: 12px; }
  .dlg-market-toolbar > div { gap: 12px; }
  .dlg-market-toolbar > div > div { flex-wrap: wrap; }
  .dlg-market-toolbar button { min-height: 44px; }
  .dlg-market-toolbar [data-slot="toggle-group"] { min-height: 44px; }
  .dlg-market-toolbar [data-slot="tooltip-trigger"] { min-width: 44px; }
  .dlg-market-main > .border-dashed { min-height: 220px; padding: 24px 16px; }
  .dlg-market-content [data-slot="card-footer"] button { min-height: 44px; }
  html[data-dlg-page="pricing"] [data-slot="sheet-content"] button { min-height: 44px; }
  html[data-dlg-page="pricing"] [data-slot="sheet-content"] { width: min(360px, 92vw); }
}
@media (max-height: 620px) and (min-width: 641px) { .dlg-auth-layout { padding-top: 88px; } }
/* Keep the view switch inside its own hit area as controls grow. */
.dlg-market-toolbar div:has(> button[data-slot="tooltip-trigger"]) { height: auto; min-height: 42px; }
@media (max-width: 640px) {
  .dlg-market-toolbar > div > div:last-child { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 8px; }
  .dlg-market-toolbar button { min-width: 44px; }
  .dlg-market-toolbar div:has(> button[data-slot="tooltip-trigger"]) { min-height: 50px; width: fit-content; }
}

html[data-dlg-page="pricing"] [data-slot="sheet-header"] { padding-right: 68px; }
html[data-dlg-page="pricing"] [data-slot="sheet-close"] { width: 44px; height: 44px; }
