:root {
  --ink-50: #f6f8fb;
  --ink-100: #edf1f6;
  --ink-200: #d9e0ea;
  --ink-300: #b7c2d3;
  --ink-400: #8192ab;
  --ink-500: #5d7089;
  --ink-600: #45556a;
  --ink-700: #324053;
  --ink-800: #222d3d;
  --ink-900: #141c28;
  --white: #ffffff;
  --rose-50: #fff1f2;
  --rose-200: #fecdd3;
  --rose-800: #9f1239;
  --rose-950: #4c0519;
  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;
  --emerald-200: #a7f3d0;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --emerald-950: #022c22;
  --shadow-panel: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 30px rgba(15, 23, 42, 0.04);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink-50);
  color: var(--ink-900);
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.surface {
  border: 1px solid var(--ink-200);
  background: var(--white);
}

.surface-muted {
  border: 1px solid var(--ink-200);
  background: var(--ink-50);
}

.section-title {
  color: var(--ink-500);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.label {
  color: var(--ink-500);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.field {
  width: 100%;
  border: 1px solid var(--ink-300);
  border-radius: 0.375rem;
  background: var(--white);
  color: var(--ink-900);
  outline: none;
  padding: 0.5rem 0.75rem;
}

.field:focus {
  border-color: var(--ink-500);
  box-shadow: 0 0 0 3px rgba(129, 146, 171, 0.18);
}

.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.375rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.button-primary {
  border: 1px solid var(--ink-900);
  background: var(--ink-900);
  color: var(--white);
}

.button-primary:hover {
  background: var(--ink-800);
  border-color: var(--ink-800);
}

.button-secondary {
  border: 1px solid var(--ink-300);
  background: var(--white);
  color: var(--ink-700);
}

.button-secondary:hover {
  border-color: var(--ink-400);
  color: var(--ink-900);
}

/* Studio shell: left navigation rail + main column ------------------------ */
.studio-shell {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

.studio-main {
  flex: 1 1 auto;
  min-width: 0;
}

.studio-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 15rem;
  height: 100vh;
  padding: 1.5rem 0.75rem;
  border-right: 1px solid var(--ink-200);
  background: var(--white);
}

.studio-nav {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.studio-nav-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--ink-100);
}

.studio-nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-600);
  transition: background-color 120ms ease, color 120ms ease;
}

.studio-nav-link:hover {
  background: var(--ink-50);
  color: var(--ink-900);
}

.studio-nav-link.is-active {
  background: var(--ink-900);
  color: var(--white);
}

.studio-nav-link svg {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .studio-shell {
    flex-direction: column;
    align-items: stretch;
  }
  .studio-sidebar {
    position: static;
    width: auto;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border-right: 0;
    border-bottom: 1px solid var(--ink-200);
    overflow-x: auto;
  }
  .studio-nav {
    flex-direction: row;
  }
  .studio-nav-footer {
    margin-top: 0;
    margin-left: auto;
    padding-top: 0;
    padding-left: 0.5rem;
    border-top: 0;
    border-left: 1px solid var(--ink-100);
  }
  .studio-nav-link span {
    white-space: nowrap;
  }
}

.button-loading-spinner {
  display: none;
  width: 0.875rem;
  height: 0.875rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 9999px;
  animation: button-spin 0.8s linear infinite;
}

.is-loading {
  cursor: wait;
}

.is-loading .button-loading-spinner {
  display: inline-block;
}

@keyframes button-spin {
  to {
    transform: rotate(360deg);
  }
}

.shadow-panel {
  box-shadow: var(--shadow-panel);
}

.font-mono {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
}

.text-white {
  color: var(--white);
}

.text-current\/70 {
  color: color-mix(in srgb, currentColor 70%, transparent);
}

.text-ink-100 {
  color: var(--ink-100);
}

.text-ink-500 {
  color: var(--ink-500);
}

.text-ink-600 {
  color: var(--ink-600);
}

.text-ink-700 {
  color: var(--ink-700);
}

.text-ink-900 {
  color: var(--ink-900);
}

.text-ink-950 {
  color: #0d1520;
}

.text-emerald-700 {
  color: var(--emerald-700);
}

.text-emerald-950 {
  color: var(--emerald-950);
}

.text-rose-800 {
  color: var(--rose-800);
}

.text-rose-950 {
  color: var(--rose-950);
}

.bg-white {
  background: var(--white);
}

.bg-ink-50 {
  background: var(--ink-50);
}

.bg-ink-900 {
  background: var(--ink-900);
}

.bg-emerald-50 {
  background: var(--emerald-50);
}

.bg-rose-50 {
  background: var(--rose-50);
}

.border {
  border: 1px solid var(--ink-200);
}

.border-b {
  border-bottom: 1px solid var(--ink-200);
}

.border-t {
  border-top: 1px solid var(--ink-200);
}

.border-x-0 {
  border-left: 0;
  border-right: 0;
}

.border-t-0 {
  border-top: 0;
}

.border-dashed {
  border-style: dashed;
}

.border-transparent {
  border-color: transparent;
}

.border-ink-200 {
  border-color: var(--ink-200);
}

.border-ink-900 {
  border-color: var(--ink-900);
}

.border-rose-200 {
  border-color: var(--rose-200);
}

.border-emerald-200 {
  border-color: var(--emerald-200);
}

.hover\:bg-ink-50:hover {
  background: var(--ink-50);
}

.hover\:border-ink-200:hover {
  border-color: var(--ink-200);
}

.hover\:text-ink-700:hover {
  color: var(--ink-700);
}

.hover\:text-ink-950:hover {
  color: #0d1520;
}

.rounded-md {
  border-radius: 0.375rem;
}

.rounded-lg {
  border-radius: 0.5rem;
}

.rounded-xl {
  border-radius: 0.75rem;
}

.rounded-2xl {
  border-radius: 1rem;
}

.rounded-3xl {
  border-radius: 1.5rem;
}

.flex {
  display: flex;
}

.grid {
  display: grid;
}

.block {
  display: block;
}

.inline-block {
  display: inline-block;
}

.hidden {
  display: none !important;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.flex-1 {
  flex: 1 1 0%;
}

.min-w-0 {
  min-width: 0;
}

.min-w-full {
  min-width: 100%;
}

.w-full {
  width: 100%;
}

.w-5 {
  width: 1.25rem;
}

.w-7 {
  width: 1.75rem;
}

.w-8 {
  width: 2rem;
}

.w-10 {
  width: 2.5rem;
}

.w-11 {
  width: 2.75rem;
}

.w-12 {
  width: 3rem;
}

.w-16 {
  width: 4rem;
}

.w-20 {
  width: 5rem;
}

.h-5 {
  height: 1.25rem;
}

.h-7 {
  height: 1.75rem;
}

.h-8 {
  height: 2rem;
}

.h-10 {
  height: 2.5rem;
}

.h-11 {
  height: 2.75rem;
}

.h-12 {
  height: 3rem;
}

.h-16 {
  height: 4rem;
}

.h-20 {
  height: 5rem;
}

.h-full {
  height: 100%;
}

.min-h-screen {
  min-height: 100vh;
}

.min-h-28 {
  min-height: 7rem;
}

.min-h-80 {
  min-height: 20rem;
}

.max-w-2xl {
  max-width: 42rem;
}

.max-w-3xl {
  max-width: 48rem;
}

.max-w-lg {
  max-width: 32rem;
}

.max-w-xl {
  max-width: 36rem;
}

.max-w-\[16rem\] {
  max-width: 16rem;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.mt-0\.5 {
  margin-top: 0.125rem;
}

.mt-1 {
  margin-top: 0.25rem;
}

.mt-1\.5 {
  margin-top: 0.375rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-3 {
  margin-top: 0.75rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mt-5 {
  margin-top: 1.25rem;
}

.mt-6 {
  margin-top: 1.5rem;
}

.mt-8 {
  margin-top: 2rem;
}

.mt-10 {
  margin-top: 2.5rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-6 {
  margin-bottom: 1.5rem;
}

.p-4 {
  padding: 1rem;
}

.p-5 {
  padding: 1.25rem;
}

.p-6 {
  padding: 1.5rem;
}

.p-8 {
  padding: 2rem;
}

.px-3 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.px-5 {
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.px-6 {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.py-1\.5 {
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
}

.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.py-2\.5 {
  padding-top: 0.625rem;
  padding-bottom: 0.625rem;
}

.py-3 {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.py-4 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.py-5 {
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.py-6 {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.py-8 {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.py-12 {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.pb-4 {
  padding-bottom: 1rem;
}

.pb-5 {
  padding-bottom: 1.25rem;
}

.pt-4 {
  padding-top: 1rem;
}

.gap-0 {
  gap: 0;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-5 {
  gap: 1.25rem;
}

.gap-6 {
  gap: 1.5rem;
}

.space-y-1\.5 > * + * {
  margin-top: 0.375rem;
}

.space-y-2 > * + * {
  margin-top: 0.5rem;
}

.space-y-4 > * + * {
  margin-top: 1rem;
}

.space-y-5 > * + * {
  margin-top: 1.25rem;
}

.space-y-6 > * + * {
  margin-top: 1.5rem;
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-x-auto {
  overflow-x: auto;
}

.break-all {
  word-break: break-all;
}

.object-contain {
  object-fit: contain;
}

.align-middle {
  vertical-align: middle;
}

.align-top {
  vertical-align: top;
}

.text-left {
  text-align: left;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-xs {
  font-size: 0.75rem;
}

.text-sm {
  font-size: 0.875rem;
}

.text-base {
  font-size: 1rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-xl {
  font-size: 1.25rem;
}

.text-2xl {
  font-size: 1.5rem;
}

.text-3xl {
  font-size: 1.875rem;
}

.text-4xl {
  font-size: 2.25rem;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.leading-6 {
  line-height: 1.5rem;
}

.leading-7 {
  line-height: 1.75rem;
}

.uppercase {
  text-transform: uppercase;
}

.tracking-tight {
  letter-spacing: -0.025em;
}

.tracking-\[0\.18em\] {
  letter-spacing: 0.18em;
}

.tracking-\[0\.2em\] {
  letter-spacing: 0.2em;
}

.tracking-\[0\.35em\] {
  letter-spacing: 0.35em;
}

.transition {
  transition: all 120ms ease;
}

.tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
}

.tab {
  display: inline-flex;
  align-items: center;
  padding: 0 0.875rem;
  height: 2.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
  transition: color 120ms ease, border-color 120ms ease;
}

.tab:hover {
  color: var(--ink-900);
}

.tab-active {
  color: var(--ink-900);
  border-bottom-color: var(--ink-900);
  font-weight: 600;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.divide-y.divide-ink-200 > * + * {
  border-top: 1px solid var(--ink-200);
}

.file\:rounded-xl::file-selector-button {
  border-radius: 0.75rem;
}

.file\:border-0::file-selector-button {
  border: 0;
}

.file\:bg-ink-900::file-selector-button,
.file\:bg-ink-950::file-selector-button {
  background: var(--ink-900);
}

.file\:mr-3::file-selector-button {
  margin-right: 0.75rem;
}

.file\:mr-4::file-selector-button {
  margin-right: 1rem;
}

.file\:px-3::file-selector-button {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.file\:px-4::file-selector-button {
  padding-left: 1rem;
  padding-right: 1rem;
}

.file\:py-1\.5::file-selector-button {
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
}

.file\:py-2::file-selector-button {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.file\:text-sm::file-selector-button {
  font-size: 0.875rem;
}

.file\:font-semibold::file-selector-button {
  font-weight: 600;
}

.file\:text-white::file-selector-button {
  color: var(--white);
}

.field::file-selector-button {
  cursor: pointer;
}

@media (min-width: 640px) {
  .sm\:px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 768px) {
  .md\:col-span-2 {
    grid-column: span 2 / span 2;
  }

  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .md\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .md\:grid-cols-\[1\.2fr_auto\] {
    grid-template-columns: 1.2fr auto;
  }

  .md\:grid-cols-\[96px_minmax\(0\,1fr\)\] {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .md\:grid-cols-\[minmax\(0\,1\.4fr\)_minmax\(0\,1fr\)\] {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }

  .md\:items-center {
    align-items: center;
  }

  .md\:items-start {
    align-items: flex-start;
  }

  .md\:justify-self-end {
    justify-self: end;
  }

  .md\:divide-x > * + * {
    border-left: 1px solid var(--ink-200);
  }

  .md\:divide-y-0 > * + * {
    border-top: 0;
  }
}

@media (min-width: 1024px) {
  .lg\:min-h-screen {
    min-height: 100vh;
  }

  .lg\:w-72 {
    width: 18rem;
  }

  .lg\:flex-row {
    flex-direction: row;
  }

  .lg\:items-center {
    align-items: center;
  }

  .lg\:items-end {
    align-items: flex-end;
  }

  .lg\:items-start {
    align-items: flex-start;
  }

  .lg\:justify-between {
    justify-content: space-between;
  }

  .lg\:border-b-0 {
    border-bottom: 0;
  }

  .lg\:border-r {
    border-right: 1px solid var(--ink-200);
  }

  .lg\:px-7 {
    padding-left: 1.75rem;
    padding-right: 1.75rem;
  }

  .lg\:px-8 {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .lg\:py-8 {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .lg\:py-10 {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }

  .lg\:grid-cols-\[24rem_minmax\(0\,1fr\)\] {
    grid-template-columns: 24rem minmax(0, 1fr);
  }

  .lg\:grid-cols-\[minmax\(0\,1\.4fr\)_minmax\(0\,1fr\)\] {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }

  .lg\:grid-cols-\[minmax\(0\,1\.6fr\)_22rem\] {
    grid-template-columns: minmax(0, 1.6fr) 22rem;
  }
}

@media (min-width: 1280px) {
  .xl\:grid-cols-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .xl\:grid-cols-\[minmax\(0\,1\.5fr\)_22rem\] {
    grid-template-columns: minmax(0, 1.5fr) 22rem;
  }

  .xl\:grid-cols-\[minmax\(0\,1\.7fr\)_22rem\] {
    grid-template-columns: minmax(0, 1.7fr) 22rem;
  }
}

/* --- in-product glossary ------------------------------------------------- */
/* A term the glossary knows about, highlighted inline in prose. Rendered by
   the `glossary` Jinja filter as a <button>; styled to read as underlined
   text with a soft green underline rather than a control. */
.glossary-term {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--emerald-500);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.15em;
  transition: text-decoration-color 120ms ease;
}

.glossary-term:hover {
  text-decoration-color: var(--emerald-700);
}

.glossary-term:focus-visible {
  outline: none;
  text-decoration-color: var(--emerald-700);
  box-shadow: 0 0 0 2px var(--emerald-200);
  border-radius: 0.15em;
}

/* Backdrop dims the view and, when open, blocks interaction with it until the
   drawer is closed. The view itself never moves. */
.glossary-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 28, 40, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 1000;
}

.glossary-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.glossary-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  height: 100dvh;
  width: min(26rem, 100%);
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-left: 1px solid var(--ink-200);
  box-shadow: -12px 0 40px rgba(15, 23, 42, 0.16);
  transform: translateX(100%);
  transition: transform 260ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1001;
}

.glossary-drawer.is-open {
  transform: translateX(0);
}

.glossary-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--ink-200);
}

.glossary-drawer-eyebrow {
  margin: 0;
  color: var(--emerald-700);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.glossary-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--ink-200);
  border-radius: 0.5rem;
  background: var(--white);
  color: var(--ink-600);
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background-color 120ms ease;
}

.glossary-drawer-close:hover {
  border-color: var(--ink-400);
  color: var(--ink-900);
  background: var(--ink-50);
}

.glossary-drawer-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--emerald-200);
}

.glossary-drawer-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.glossary-drawer-term {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink-950, #0d1520);
}

.glossary-drawer-def {
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--ink-700);
}

body.glossary-open {
  overflow: hidden;
}
