/* Exact installed sleek tokens bootstrap the initial paint. The injected theme takes over unchanged. */
html:not(:has(style#overflow-theme)) main.container { padding-top: .75rem; }

html:not(:has(style#overflow-theme)) {
  color-scheme: light;
  --background: #f5f8f7;
  --foreground: #172b30;
  --card: #ffffff;
  --card-foreground: #0f0f0f;
  --popover: #ffffff;
  --popover-foreground: #0f0f0f;
  --primary: #096c70;
  --primary-foreground: #fafafa;
  --secondary: #e6f2ef;
  --secondary-foreground: #23585a;
  --muted: #f2f2f2;
  --muted-foreground: #617277;
  --accent: #e0efec;
  --accent-foreground: #174f52;
  --destructive: #dc2626;
  --destructive-foreground: #ffffff;
  --border: #dce5e3;
  --input: #c8d6d3;
  --ring: #16858a;
  --chart-1: #4f46e5;
  --chart-2: #0891b2;
  --chart-3: #0f766e;
  --chart-4: #d97706;
  --chart-5: #db2777;
  --sidebar: #ffffff;
  --sidebar-foreground: #0f0f0f;
  --sidebar-primary: #18181b;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #f2f2f2;
  --sidebar-accent-foreground: #0f0f0f;
  --sidebar-border: #e5e5e5;
  --sidebar-ring: #525252;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius: 0.625rem;
  --shadow-x: 0;
  --shadow-y: 1px;
  --shadow-blur: 3px;
  --shadow-spread: 0;
  --shadow-opacity: 0.08;
  --shadow-color: #000000;
  --shadow-2xs: 0 1px 2px rgb(0 0 0 / 0.03);
  --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px rgb(0 0 0 / 0.08);
  --shadow: 0 2px 8px rgb(0 0 0 / 0.08);
  --shadow-md: 0 8px 20px -12px rgb(0 0 0 / 0.24);
  --shadow-lg: 0 14px 32px -16px rgb(0 0 0 / 0.3);
  --shadow-xl: 0 22px 48px -20px rgb(0 0 0 / 0.34);
  --shadow-2xl: 0 30px 70px -26px rgb(0 0 0 / 0.4);
  --tracking-normal: -0.01em;
  --spacing: 0.25rem;
}

html.dark:not(:has(style#overflow-theme)) {
  color-scheme: dark;
  --background: #0f0f0f;
  --foreground: #f1f1f1;
  --card: #181818;
  --card-foreground: #f1f1f1;
  --popover: #282828;
  --popover-foreground: #f1f1f1;
  --primary: #8dd9d0;
  --primary-foreground: #123536;
  --secondary: #203a39;
  --secondary-foreground: #c3eae5;
  --muted: #272727;
  --muted-foreground: #aaaaaa;
  --accent: #3f3f3f;
  --accent-foreground: #ffffff;
  --destructive: #f87171;
  --destructive-foreground: #1f0808;
  --border: #303030;
  --input: #505050;
  --ring: #f1f1f1;
  --chart-1: #818cf8;
  --chart-2: #22d3ee;
  --chart-3: #2dd4bf;
  --chart-4: #fbbf24;
  --chart-5: #f472b6;
  --sidebar: #0f0f0f;
  --sidebar-foreground: #f1f1f1;
  --sidebar-primary: #f1f1f1;
  --sidebar-primary-foreground: #0f0f0f;
  --sidebar-accent: #272727;
  --sidebar-accent-foreground: #ffffff;
  --sidebar-border: #303030;
  --sidebar-ring: #f1f1f1;
  --shadow-color: #000000;
  --shadow-2xs: 0 1px 2px rgb(0 0 0 / 0.18);
  --shadow-xs: 0 1px 3px rgb(0 0 0 / 0.22);
  --shadow-sm: 0 2px 8px rgb(0 0 0 / 0.24);
  --shadow: 0 4px 14px rgb(0 0 0 / 0.26);
  --shadow-md: 0 10px 26px -10px rgb(0 0 0 / 0.58);
  --shadow-lg: 0 18px 40px -14px rgb(0 0 0 / 0.66);
  --shadow-xl: 0 26px 56px -18px rgb(0 0 0 / 0.72);
  --shadow-2xl: 0 34px 76px -24px rgb(0 0 0 / 0.8);
}

html,
body {
  min-height: 100%;
}

.dark body {
  background-image: none;
}

body {
  margin: 0;
  background-image:
    radial-gradient(circle at 15% -10%, color-mix(in srgb, var(--primary) 9%, transparent), transparent 30rem),
    linear-gradient(180deg, color-mix(in srgb, var(--background) 92%, white), var(--background));
  background-attachment: fixed;
  font-family: var(--font-sans);
  letter-spacing: var(--tracking-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

*,
*::before,
*::after {
  border-color: var(--border);
}

::selection {
  color: var(--primary-foreground);
  background: var(--primary);
}

*::placeholder {
  color: var(--muted-foreground);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  letter-spacing: -0.025em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  text-underline-offset: 0.2em;
  text-decoration-thickness: 0.08em;
}

button,
a,
input,
select,
textarea,
[role="button"],
[role="menuitem"] {
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

button:active,
[role="button"]:active {
  transform: translateY(1px);
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 18%, transparent);
}

input,
select,
textarea {
  border-color: var(--input);
  background-color: var(--card);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--ring);
}

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

legend,
label {
  color: var(--foreground);
  font-weight: 500;
}

hr,
[role="separator"] {
  border-color: var(--border);
}

table {
  border-color: var(--border);
  border-collapse: separate;
  border-spacing: 0;
}

thead {
  background: color-mix(in srgb, var(--muted) 86%, transparent);
}

tbody tr {
  transition: background-color 150ms ease;
}

tbody tr:hover {
  background: var(--accent);
}

:where([role="menuitem"], [role="option"]):hover,
[role="menuitem"][data-highlighted],
[role="option"][aria-selected="true"],
[role="tab"][data-state="active"],
[data-sidebar="menu-button"][data-active="true"] {
  color: var(--accent-foreground);
  background: var(--accent);
}

code,
kbd,
pre,
samp {
  font-family: var(--font-mono);
}

code,
kbd {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 0.55);
  background: var(--muted);
}

blockquote {
  border-inline-start: 3px solid var(--primary);
  color: var(--muted-foreground);
}

[role="dialog"],
[role="menu"],
[role="listbox"] {
  border: 1px solid var(--border);
  background: var(--popover);
  box-shadow: var(--shadow-xl);
}

[data-slot="card"] {
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}

[data-slot="card-title"] {
  letter-spacing: -0.02em;
}

[data-slot="card-description"] {
  line-height: 1.55;
}

[data-slot="alert"] {
  box-shadow: var(--shadow-xs);
}

[data-slot="textarea"] {
  background: color-mix(in srgb, var(--card) 88%, transparent);
}

[data-slot="calendar"] {
  border-radius: var(--radius);
}

[aria-disabled="true"],
:disabled {
  cursor: not-allowed;
  filter: saturate(0.7);
}

* {
  scrollbar-color: var(--muted-foreground) transparent;
  scrollbar-width: thin;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.min-h-screen:has(#embedded-chatbot),
.min-h-screen:has(#procedure-authoring) {
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

main:has(#embedded-chatbot),
main:has(#procedure-authoring) {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;

  flex: 1 1 0;
  min-height: 0;
  display: flex;
}

#embedded-chatbot,
#procedure-authoring {
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1 1 auto;
  border: 0;
  box-shadow: none;
}

/* The branded lockup is decorative: the adjacent heading continues to name the application. */
.max-w-md:has(> form input[type="password"]) h2::before {
  content: "";
  display: block;
  width: 9rem;
  height: 1.8rem;
  margin: 0 auto 1.15rem;
  background: url("/public/assets/troople-light.svg") center / contain no-repeat;
}
.dark .max-w-md:has(> form input[type="password"]) h2::before {
  background-image: url("/public/assets/troople-dark.svg");
}
@media (forced-colors: active) {
  .max-w-md:has(> form input[type="password"]) h2::before { display: none; }
}
/* The mobile header has its own text-only home link. Keep its accessible name and touch target. */
@media (max-width: 47.99rem) {
  header a[class~="md:hidden"][href="/releases"]::before {
    content: "";
    display: block;
    flex: none;
    width: 1.5rem;
    height: 1.5rem;
    margin-inline-end: .4rem;
    background: url("/public/assets/logo_light.svg") center / contain no-repeat;
  }
  .dark header a[class~="md:hidden"][href="/releases"]::before {
    background-image: url("/public/assets/logo_dark.svg");
  }
}

/* In shallow windows the wordmark shares the heading line, without moving the submit button. */
@media (max-height: 30rem) {
  .max-w-md:has(> form input[type="password"]) h2::before {
    display: inline-block;
    width: 4.5rem;
    height: 1rem;
    margin: 0 .65rem 0 0;
    vertical-align: .05em;
  }
}
/* A narrow, shallow viewport cannot fit both labels on one line. Keep the application title. */
@media (max-height: 30rem) and (max-width: 30rem) {
  .max-w-md:has(> form input[type="password"]) h2::before { display: none; }
}
