/*
 * LitL application foundation
 * ---------------------------
 * Cross-application design tokens and accessible interaction defaults.
 * App-specific layout remains in each app's ui.css.
 * See STYLE_GUIDE.md before adding or changing shared rules.
 */
:root {
  --litl-ink: #172033;
  --litl-muted: #5d6b82;
  --litl-canvas: #f4f6fa;
  --litl-surface: #ffffff;
  --litl-surface-soft: #f8fafc;
  --litl-border: #dce2ea;
  --litl-border-strong: #c8d0dc;
  --litl-brand: #174f63;
  --litl-brand-strong: #103c4c;
  --litl-accent: #c76533;
  --litl-focus: #20809f;
  --litl-danger: #b42318;
  --litl-radius-sm: .5rem;
  --litl-radius: .75rem;
  --litl-radius-lg: 1rem;
  --litl-shadow-sm: 0 1px 2px rgb(23 32 51 / .05), 0 5px 18px rgb(23 32 51 / .04);
  --litl-shadow-lg: 0 18px 45px rgb(23 32 51 / .14);
}

html { scroll-behavior: smooth; }

body.litl-app {
  min-height: 100vh;
  color: var(--litl-ink);
  background: radial-gradient(circle at 82% 4%, rgb(32 128 159 / .08), transparent 24rem), var(--litl-canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.litl-app button,
.litl-app input,
.litl-app select,
.litl-app textarea { font: inherit; }

.litl-app button { transition: transform .12s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease; }
.litl-app button:active:not(:disabled) { transform: translateY(1px); }
.litl-app button:focus-visible,
.litl-app a:focus-visible,
.litl-app input:focus-visible,
.litl-app select:focus-visible,
.litl-app textarea:focus-visible { outline: 3px solid rgb(32 128 159 / .35); outline-offset: 2px; }
.litl-app button:disabled { cursor: not-allowed; opacity: .55; }

.litl-brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--litl-ink); text-decoration: none; }
.litl-brand-mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: .7rem;
  color: #fff;
  background: var(--litl-brand);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .14);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .05em;
}
.litl-brand-copy { display: flex; flex-direction: column; line-height: 1.05; }
.litl-brand-copy strong { font-size: .88rem; letter-spacing: .04em; }
.litl-brand-copy small { margin-top: .2rem; color: var(--litl-muted); font-size: .67rem; }

.litl-page-intro {
  position: relative;
  overflow: hidden;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid #d6e2e6;
  border-radius: var(--litl-radius-lg);
  background: linear-gradient(115deg, #fff 0%, #f5fafb 72%, #e9f3f5 100%);
  box-shadow: var(--litl-shadow-sm);
}
.litl-page-intro::after {
  content: "";
  position: absolute;
  right: -4rem;
  top: -7rem;
  width: 17rem;
  height: 17rem;
  border: 3rem solid rgb(23 79 99 / .045);
  border-radius: 50%;
  pointer-events: none;
}
.litl-page-intro > * { position: relative; z-index: 1; }
.litl-eyebrow { display: flex; align-items: center; gap: .5rem; margin: 0 0 .65rem; color: var(--litl-brand); font-size: .72rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.litl-eyebrow::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--litl-accent); box-shadow: 0 0 0 4px rgb(199 101 51 / .12); }

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

/* Function-page hierarchy: main navigation, page introduction, subnavigation, widgets, then toolbar. */
.litl-function-nav {
  display: flex;
  gap: .2rem;
  overflow-x: auto;
  width: 100%;
  padding: .28rem;
  border: 0;
  border-radius: var(--litl-radius);
  background: #eef2f6;
  scrollbar-width: thin;
}
.litl-function-nav-item {
  flex: 0 0 auto;
  padding: .6rem .85rem;
  border: 0;
  border-radius: .55rem;
  color: var(--litl-muted);
  background: transparent;
  font-size: .875rem;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}
.litl-function-nav-item:hover { color: var(--litl-ink); background: rgb(255 255 255 / .65); }
.litl-function-nav-item[aria-current="page"],
.litl-function-nav-item.tab-btn-active {
  color: var(--litl-brand-strong);
  background: #fff;
  box-shadow: 0 1px 3px rgb(23 32 51 / .1);
}
.litl-function-subnav { margin-top: .9rem; }
.litl-function-page-intro { margin-top: 1rem; padding: .25rem 0 .9rem; border-bottom: 1px solid var(--litl-border); }
.litl-function-page-intro h1 { margin: 0; font-size: clamp(1.75rem, 3vw, 2.25rem); line-height: 1.15; }
.litl-function-page-intro > p:last-child { max-width: 60rem; margin: .5rem 0 0; color: var(--litl-muted); }

/* Portalled popover menus live under <body>, use viewport positioning, and are never clipped by tables or cards. */
.litl-popover-menu {
  position: fixed;
  z-index: 10000;
  min-width: 10rem;
  padding: .375rem;
  border: 1px solid var(--litl-border-strong);
  border-radius: var(--litl-radius-sm);
  background: var(--litl-surface);
  box-shadow: var(--litl-shadow-lg);
}
.litl-popover-menu button { display: block; width: 100%; padding: .5rem .625rem; border: 0; border-radius: .35rem; color: var(--litl-ink); background: transparent; text-align: left; cursor: pointer; }
.litl-popover-menu button:hover,
.litl-popover-menu button:focus-visible { color: var(--litl-brand-strong); background: #edf5f7; }
