@import "tailwindcss";
@import "tw-animate-css";
@import "shadcn/tailwind.css";
@import "katex/dist/katex.min.css";

@plugin "@tailwindcss/typography";

/* A text field has focus, so on a phone the on-screen keyboard is up: bottom-fixed bars hide
   instead of riding over the keyboard or covering the field (Paper `Posts / New · SEO title`). */
@custom-variant typing (body:has(:is(textarea, [contenteditable='true'], input:not([type='checkbox'], [type='radio'], [type='file'], [type='hidden'], [type='range'], [type='color'], [type='button'], [type='submit'])):focus) &);

@theme inline {
  --color-background: var(--background);
  --color-background-light: var(--background-light);
  --color-foreground: var(--foreground);
  --font-sans: var(--font-geist-sans);
  --font-mono: var(--font-geist-mono);
  --color-sidebar-ring: var(--sidebar-ring);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-accent-light: var(--sidebar-accent-light);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar: var(--sidebar);
  --color-chart-5: var(--chart-5);
  --color-chart-4: var(--chart-4);
  --color-chart-3: var(--chart-3);
  --color-chart-2: var(--chart-2);
  --color-chart-1: var(--chart-1);
  --color-ring: var(--ring);
  --color-input: var(--input);
  --color-border: var(--border);
  --color-highlight: var(--highlight);
  --color-placeholder: var(--placeholder);
  --color-destructive: var(--destructive);
  --color-success: var(--success);
  --color-warning: var(--warning);
  --color-warning-foreground: var(--warning-foreground);
  --color-accent-foreground: var(--accent-foreground);
  --color-accent: var(--accent);
  --color-muted-foreground: var(--muted-foreground);
  --color-muted: var(--muted);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-secondary: var(--secondary);
  --color-primary-foreground: var(--primary-foreground);
  --color-primary: var(--primary);
  --color-popover-foreground: var(--popover-foreground);
  --color-popover: var(--popover);
  --color-card-foreground: var(--card-foreground);
  --color-card: var(--card);
  --text-*: initial;
  --text-sm: 12px;
  --text-sm--line-height: var(--leading-base);
  --text-base: 14px;
  --text-base--line-height: var(--leading-base);
  --text-editor: 16px;
  --text-editor--line-height: var(--leading-base);
  --radius-*: initial;
  --radius: 6px;
  --radius-lg: calc(var(--radius) + 2px);
  --radius-full: 99999px;
  /* The phone text-style sheet's top corners (Paper `Posts / New · Writing · Text style`). */
  --radius-sheet: 12px;
  --font-heading: var(--font-sans);
  --shadow-*: initial;
  --shadow-sm:
    0 0 0 1px var(--ds-gray-alpha-200),
    0 1px 2px -1px #0000000f;
  --shadow-md:
    0 0 0 1px var(--ds-gray-alpha-200),
    0 1px 2px -1px #0000000f,
    0 4px 8px -4px #00000014,
    0 8px 16px -8px #0000000a;
  --shadow-lg:
    0 0 0 1px var(--ds-gray-alpha-200),
    0 1px 2px -1px #0000000f,
    0 8px 16px -6px #00000014,
    0 24px 32px -12px #00000014,
    0 40px 64px -24px #0000000f;
}

@theme {
  --leading-*: initial;
  --leading-none: 1;
  --leading-base: 1.42857;
  --leading-prose: 1.6;
  --breakpoint-xs: 480px;
  --spacing-entity-editor: 300px;
  --spacing-table-cell: 300px;
  --spacing-session-device: 296px;
  --spacing-session-location: 200px;
  --spacing-session-ip: 160px;
  --spacing-session-actions: 96px;
  --spacing-media-dialog: 700px;
  --spacing-media-tile: 180px;
  --spacing-media-thumb: 100px;
  --spacing-gallery-item: 184px;
  --spacing-date-range-trigger: 206px;
  --spacing-date-range-popover: 282px;
  --spacing-source-editor: 240px;
  --grid-template-columns-entity-form: 1fr 360px;
  --grid-template-columns-page-header: minmax(0, 1fr) auto minmax(0, 1fr);
  --grid-template-columns-page-header-compact: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
  --grid-template-columns-auth-card: 5fr 7fr;
  --grid-template-columns-audit-detail: 96px 1fr;
  --grid-template-columns-messages: 420px 1fr;
  --grid-template-columns-message-detail: 140px 1fr;
}

:root {
  --ds-background-100: lab(99% 0 0);
  --ds-background-200: lab(97% 0 -0.0000119209);
  --ds-gray-100: lab(95.476% -0.0000298023 0);
  --ds-gray-200: lab(93.04% 0.0000298023 -0.0000119209);
  --ds-gray-300: lab(91.3% 0 -0.0000119209);
  --ds-gray-400: lab(92.692% 0 0);
  --ds-gray-500: lab(80.976% 0 -0.0000119209);
  --ds-gray-600: lab(68.912% 0 -0.0000119209);
  --ds-gray-700: lab(59.4% 0 0);
  --ds-gray-800: lab(45.44% 0 0);
  --ds-gray-900: lab(32.72% -0.0000149012 0);
  --ds-gray-1000: lab(7.78201% -0.0000149012 0);
  --ds-gray-alpha-50: lab(0% 0 0 / 0.03);
  --ds-gray-alpha-100: lab(0% 0 0 / 0.05);
  --ds-gray-alpha-200: lab(0% 0 0 / 0.081);
  --ds-gray-alpha-300: lab(0% 0 0 / 0.1);
  --ds-gray-alpha-400: lab(0% 0 0 / 0.08);
  --ds-gray-alpha-500: lab(0% 0 0 / 0.21);
  --ds-gray-alpha-600: lab(0% 0 0 / 0.24);
  --ds-gray-alpha-700: lab(0% 0 0 / 0.44);
  --ds-gray-alpha-800: lab(0% 0 0 / 0.51);
  --ds-gray-alpha-900: lab(0% 0 0 / 0.7);
  --ds-gray-alpha-1000: lab(0% 0 0 / 0.91);
  --ds-blue-100: lab(96.8732% -1.39889 -5.07131);
  --ds-blue-200: lab(95.6744% -2.00856 -6.9569);
  --ds-blue-300: lab(93.6801% -3.04809 -10.3604);
  --ds-blue-400: lab(90.2207% -5.88808 -16.0541);
  --ds-blue-500: lab(79.7793% -8.30209 -33.3699);
  --ds-blue-600: lab(68.1823% -8.44929 -52.7934);
  --ds-blue-700: lab(47.9229% 22.3147 -86.8328);
  --ds-blue-800: lab(40.8106% 23.698 -82.9445);
  --ds-blue-900: lab(42.9093% 21.1896 -82.6493);
  --ds-blue-1000: lab(13.8687% 6.36795 -37.4197);
  --ds-red-100: lab(95.6935% 7.32443 2.00332);
  --ds-red-200: lab(94.3497% 9.77078 2.91723);
  --ds-red-300: lab(93.0242% 12.0165 3.78883);
  --ds-red-400: lab(89.6749% 14.9771 6.30434);
  --ds-red-500: lab(80.9124% 32.7639 12.5167);
  --ds-red-600: lab(64.5512% 60.0041 29.3131);
  --ds-red-700: lab(53.9255% 80.6033 48.0845);
  --ds-red-800: lab(48.9343% 78.946 55.0086);
  --ds-red-900: lab(45.3957% 73.7444 51.3924);
  --ds-red-1000: lab(11.6345% 33.5137 13.8317);
  --ds-amber-100: lab(97.2024% 1.01992 12.7992);
  --ds-amber-200: lab(96.5222% 0.44781 19.38);
  --ds-amber-300: lab(95.5532% 0.730604 25.1573);
  --ds-amber-400: lab(89.9281% 6.02812 56.553);
  --ds-amber-500: lab(84.4286% 16.6827 71.0758);
  --ds-amber-600: lab(76.726% 29.5673 105.476);
  --ds-amber-700: lab(78.7256% 26.6905 107.161);
  --ds-amber-800: lab(72.7954% 39.7122 103.301);
  --ds-amber-900: lab(44.3662% 36.3127 70.4646);
  --ds-amber-1000: lab(19.0178% 27.3692 31.8945);
  --ds-green-100: lab(97.5853% -8.11777 6.20661);
  --ds-green-200: lab(96.9166% -10.612 7.60013);
  --ds-green-300: lab(94.6031% -18.6422 15.0889);
  --ds-green-400: lab(91.3796% -27.7496 20.9385);
  --ds-green-500: lab(85.1416% -46.4903 35.8939);
  --ds-green-600: lab(79.6441% -60.3529 50.7117);
  --ds-green-700: lab(61.0339% -50.9714 38.8312);
  --ds-green-800: lab(52.9002% -44.1062 33.0987);
  --ds-green-900: lab(45.7946% -42.7208 32.0975);
  --ds-green-1000: lab(19.2017% -35.6785 27.2939);
  --ds-teal-100: lab(97.7805% -12.1079 -1.6973);
  --ds-teal-200: lab(97.0232% -11.8163 -0.259781);
  --ds-teal-300: lab(94.6978% -16.2983 -0.800061);
  --ds-teal-400: lab(92.4757% -24.5274 -1.99826);
  --ds-teal-500: lab(86.4355% -46.7053 -2.48644);
  --ds-teal-600: lab(80.5746% -56.8254 0.696123);
  --ds-teal-700: lab(61.2492% -55.7738 -2.36303);
  --ds-teal-800: lab(52.4585% -49.4257 -1.83064);
  --ds-teal-900: lab(45.9452% -44.2291 -2.67519);
  --ds-teal-1000: lab(22.2372% -28.1244 -0.0907302);
  --ds-purple-100: lab(95.8064% 5.66289 -6.77673);
  --ds-purple-200: lab(95.9251% 5.05617 -6.57121);
  --ds-purple-300: lab(93.5693% 8.17552 -10.3939);
  --ds-purple-400: lab(89.6505% 14.5975 -16.7056);
  --ds-purple-500: lab(76.2735% 33.6932 -38.7706);
  --ds-purple-600: lab(64.3635% 50.5605 -58.6804);
  --ds-purple-700: lab(42.3587% 81.2683 -86.4789);
  --ds-purple-800: lab(35.0556% 71.1896 -76.2188);
  --ds-purple-900: lab(33.4854% 69.2003 -76.1092);
  --ds-purple-1000: lab(9.18347% 35.0629 -37.5931);
  --ds-pink-100: lab(94.5133% 11.6709 -3.49871);
  --ds-pink-200: lab(94.6026% 10.7321 -1.35195);
  --ds-pink-300: lab(92.2617% 15.1106 -0.957537);
  --ds-pink-400: lab(88.9731% 19.1876 -0.249231);
  --ds-pink-500: lab(80.5902% 30.3695 -1.5003);
  --ds-pink-600: lab(68.2806% 50.7706 0.897086);
  --ds-pink-700: lab(54.7091% 76.7064 2.85504);
  --ds-pink-800: lab(50.1788% 75.5319 8.12644);
  --ds-pink-900: lab(43.5237% 66.4129 5.12512);
  --ds-pink-1000: lab(12.9204% 31.3916 -0.183001);

  --background: var(--ds-background-200);
  --background-light: var(--ds-background-100);
  --foreground: var(--ds-gray-1000);
  --card: var(--color-white);
  --card-foreground: var(--ds-gray-1000);
  --popover: var(--ds-background-100);
  --popover-foreground: var(--ds-gray-1000);
  --primary: var(--ds-gray-1000);
  --primary-foreground: var(--ds-background-100);
  --secondary: var(--ds-gray-200);
  --secondary-foreground: var(--ds-gray-1000);
  --muted: var(--ds-gray-100);
  --muted-foreground: var(--ds-gray-800);
  --placeholder: var(--ds-gray-700);
  --accent: var(--ds-gray-100);
  --accent-foreground: var(--ds-gray-1000);
  --destructive: var(--ds-red-900);
  --success: var(--ds-green-900);
  --warning: var(--ds-amber-900);
  --warning-foreground: var(--ds-amber-900);
  --border: var(--ds-gray-300);
  --highlight: var(--ds-gray-500);
  --input: var(--color-white);
  --ring: var(--ds-gray-600);
  --chart-1: var(--ds-blue-700);
  --chart-2: var(--ds-purple-700);
  --chart-3: var(--ds-teal-700);
  --chart-4: var(--ds-amber-700);
  --chart-5: var(--ds-pink-700);
  --radius: 6px;
  --sidebar: var(--background);
  --sidebar-foreground: var(--ds-gray-900);
  --sidebar-primary: var(--ds-gray-1000);
  --sidebar-primary-foreground: var(--ds-background-100);
  --sidebar-accent-light: var(--ds-gray-200);
  --sidebar-accent: var(--ds-gray-300);
  --sidebar-accent-foreground: var(--ds-gray-1000);
  --sidebar-border: var(--ds-gray-400);
  --sidebar-ring: var(--ds-gray-600);
  --tt-bg-color: var(--background);
  --tt-bg-color-contrast: var(--border);
  --tt-color-highlight-yellow: #fef9c3;
  --tt-color-highlight-green: #dcfce7;
  --tt-color-highlight-blue: #e0f2fe;
  --tt-color-highlight-purple: #f3e8ff;
  --tt-color-highlight-red: #ffe4e6;
  --tt-color-highlight-gray: rgb(248, 248, 247);
  --tt-color-highlight-brown: rgb(244, 238, 238);
  --tt-color-highlight-orange: rgb(251, 236, 221);
  --tt-color-highlight-pink: rgb(252, 241, 246);
  --tt-color-highlight-yellow-contrast: #fbe604;
  --tt-color-highlight-green-contrast: #c7fad8;
  --tt-color-highlight-blue-contrast: #ceeafd;
  --tt-color-highlight-purple-contrast: #e4ccff;
  --tt-color-highlight-red-contrast: #ffccd0;
  --tt-color-highlight-gray-contrast: rgba(84, 72, 49, 0.15);
  --tt-color-highlight-brown-contrast: rgba(210, 162, 141, 0.35);
  --tt-color-highlight-orange-contrast: rgba(224, 124, 57, 0.27);
  --tt-color-highlight-pink-contrast: rgba(225, 136, 179, 0.27);
}

@layer base {
  * {
    @apply border-border outline-ring/50 [text-box:trim-both];
  }

  html,
  body,
  :host {
    text-rendering: optimizeLegibility;
  }

  body {
    @apply bg-background text-foreground leading-base;
    font-size: 14px;
  }

  /* Placeholder text is always 14px, whatever text size the field or its container sets. */
  input::placeholder,
  textarea::placeholder {
    font-size: var(--text-base);
  }

  .admin-root .tiptap-button-icon,
  .admin-root .tiptap-button-icon-sub {
    @apply text-foreground;
  }

  svg.lucide {
    @apply size-4 text-foreground;
    stroke-width: 2;
  }

  html {
    @apply font-sans;
    scrollbar-width: thin;
    scrollbar-color: gray transparent;
  }
}

.admin-root .content-editor-prose {
  --tw-prose-body: var(--foreground);
  --tw-prose-headings: var(--foreground);
  --tw-prose-lead: var(--muted-foreground);
  --tw-prose-links: var(--primary);
  --tw-prose-bold: var(--foreground);
  --tw-prose-counters: var(--muted-foreground);
  --tw-prose-bullets: var(--muted-foreground);
  --tw-prose-hr: var(--border);
  --tw-prose-quotes: var(--foreground);
  --tw-prose-quote-borders: var(--border);
  --tw-prose-captions: var(--muted-foreground);
  --tw-prose-kbd: var(--foreground);
  --tw-prose-kbd-shadows: color-mix(in oklab,
      var(--foreground) 20%,
      transparent);
  --tw-prose-code: var(--foreground);
  --tw-prose-pre-code: var(--foreground);
  --tw-prose-pre-bg: var(--muted);
  --tw-prose-th-borders: var(--border);
  --tw-prose-td-borders: var(--border);
  --tw-prose-invert-body: var(--foreground);
  --tw-prose-invert-headings: var(--foreground);
  --tw-prose-invert-lead: var(--muted-foreground);
  --tw-prose-invert-links: var(--primary);
  --tw-prose-invert-bold: var(--foreground);
  --tw-prose-invert-counters: var(--muted-foreground);
  --tw-prose-invert-bullets: var(--muted-foreground);
  --tw-prose-invert-hr: var(--border);
  --tw-prose-invert-quotes: var(--foreground);
  --tw-prose-invert-quote-borders: var(--border);
  --tw-prose-invert-captions: var(--muted-foreground);
  --tw-prose-invert-kbd: var(--foreground);
  --tw-prose-invert-kbd-shadows: color-mix(in oklab,
      var(--foreground) 20%,
      transparent);
  --tw-prose-invert-code: var(--foreground);
  --tw-prose-invert-pre-code: var(--foreground);
  --tw-prose-invert-pre-bg: var(--muted);
  --tw-prose-invert-th-borders: var(--border);
  --tw-prose-invert-td-borders: var(--border);
  @apply caret-foreground text-foreground leading-prose outline-none whitespace-pre-wrap;
  font-size: 0.9375rem;
}

/* iOS Safari zooms the page when a focused control renders text below 16px. Phones
   get 16px on every editable control, including the TipTap contenteditable above; the markdown
   editor (`.cm-content`) keeps its 14px, which the admin layout's `maximumScale: 1` keeps from
   zooming (user decision 2026-11-12). */
@media (width < theme(--breakpoint-md)) {
  .admin-root :is(input, textarea, select, [contenteditable='true']):not(.cm-content) {
    font-size: 16px;
  }
}

.admin-root .content-editor-prose> :first-child {
  @apply mt-0;
}

.admin-root .content-editor-prose> :last-child {
  @apply mb-0;
}

.admin-root .content-editor-prose :where(p):not(:where([class~="not-prose"] *)) {
  @apply my-3 leading-prose;
}

.admin-root .content-editor-prose :where(h1, h2, h3, h4):not(:where([class~="not-prose"] *)) {
  @apply mt-6 mb-[1.2rem] text-balance font-semibold leading-none tracking-normal;
}

.admin-root .content-editor-prose :where(h1):not(:where([class~="not-prose"] *)) {
  @apply mt-7;
  font-size: 1.75rem;
}

.admin-root .content-editor-prose :where(h2):not(:where([class~="not-prose"] *)) {
  @apply mt-6;
  font-size: 1.375rem;
}

.admin-root .content-editor-prose :where(h3):not(:where([class~="not-prose"] *)) {
  @apply mt-5;
  font-size: 1.125rem;
}

.admin-root .content-editor-prose :where(h4):not(:where([class~="not-prose"] *)) {
  @apply mt-[1.125rem];
  font-size: 1rem;
}

.admin-root .content-editor-prose :where(h1, h2, h3, h4)+ :where(p, ul, ol, blockquote, pre):not(:where([class~="not-prose"] *)) {
  @apply mt-0;
}

.admin-root .content-editor-prose :where(ul, ol):not(:where([class~="not-prose"] *)) {
  @apply my-3.5 pl-[1.55em];
}

.admin-root .content-editor-prose :where(li):not(:where([class~="not-prose"] *)) {
  @apply my-[0.3em] pl-[0.15em];
}

.admin-root .content-editor-prose :where(li > p):not(:where([class~="not-prose"] *)) {
  @apply my-[0.25em];
}

.admin-root .content-editor-prose :where(li > ul, li > ol):not(:where([class~="not-prose"] *)) {
  @apply my-[0.35em];
}

.admin-root .content-editor-prose :where(blockquote):not(:where([class~="not-prose"] *)) {
  @apply my-4 border-l-[3px] border-l-border py-[0.1em] pl-[1em] text-foreground not-italic font-normal leading-prose;
}

.admin-root .content-editor-prose :where(blockquote p):not(:where([class~="not-prose"] *)) {
  @apply my-[0.45em];
}

.admin-root .content-editor-prose :where(blockquote p:first-of-type)::before,
.admin-root .content-editor-prose :where(blockquote p:last-of-type)::after {
  content: none;
}

.admin-root .content-editor-prose :where(strong):not(:where([class~="not-prose"] *)) {
  @apply font-semibold;
}

.admin-root .content-editor-prose :where(a):not(:where([class~="not-prose"] *)) {
  @apply decoration-[1px] underline-offset-[0.18em];
  font-weight: inherit;
}

.admin-root .content-editor-prose :where(code):not(:where(pre code, [class~="not-prose"] *)) {
  @apply rounded border border-border bg-muted px-[0.3em] py-[0.1em] font-medium leading-base;
  font-size: 0.875em;
}

.admin-root .content-editor-prose :where(code):not(:where(pre code, [class~="not-prose"] *))::before,
.admin-root .content-editor-prose :where(code):not(:where(pre code, [class~="not-prose"] *))::after {
  content: none;
}

.admin-root .content-editor-prose :where(pre):not(:where([class~="not-prose"] *)) {
  @apply my-4 rounded border border-border px-4 py-3.5 leading-prose;
  font-size: 0.875em;
}

.admin-root .content-editor-prose :where(pre code):not(:where([class~="not-prose"] *)) {
  @apply rounded border-0 bg-transparent p-0;
  font-size: inherit;
}

.admin-root .content-editor-prose :where(kbd):not(:where([class~="not-prose"] *)) {
  @apply rounded;
}

.admin-root .content-editor-prose>* {
  @apply relative;
}

.admin-root .content-editor-prose:not(.readonly):not(.ProseMirror-hideselection) ::selection {
  @apply bg-primary/20;
}

.admin-root .content-editor-prose .selection {
  @apply inline bg-primary/20;
}

.admin-root .content-editor-prose .ProseMirror-selectednode:not(img):not(pre):not(.react-renderer) {
  @apply rounded bg-primary/12;
}

.admin-root .content-editor-prose.ProseMirror-hideselection {
  @apply caret-transparent;
}

.admin-root .content-editor-prose.resize-cursor {
  @apply cursor-col-resize;
}

.admin-root .content-editor-prose a span,
.admin-root .content-editor-prose u span {
  @apply underline;
}

.admin-root .content-editor-prose s span {
  @apply line-through;
}

.admin-root .content-editor-prose .is-empty:not(.with-slash)[data-placeholder]:has(> .ProseMirror-trailingBreak:only-child)::before {
  content: attr(data-placeholder);
}

.admin-root .content-editor-prose .is-empty.with-slash[data-placeholder]:has(> .ProseMirror-trailingBreak:only-child)::before {
  content: "Write, type '/' for commands...";
  @apply italic;
}

/* The empty-line placeholder runs at the base size, smaller than the text, and is centered on the
   line box so the caret (which spans the full line) lines up with it. */
.admin-root .content-editor-prose .is-empty[data-placeholder]:has(> .ProseMirror-trailingBreak) {
  position: relative;
}

.admin-root .content-editor-prose .is-empty[data-placeholder]:has(> .ProseMirror-trailingBreak)::before {
  @apply pointer-events-none absolute inset-0 flex items-center text-placeholder;
  font-size: var(--text-base);
  text-align: inherit;
}

.admin-root .content-editor-prose ul[data-type="taskList"] {
  @apply list-none pl-0;
}

.admin-root .content-editor-prose ul[data-type="taskList"]>li {
  @apply flex list-none items-start gap-2 pl-0;
}

/* The checkbox sits in a holder exactly one line tall (`1lh`, the item's own line height) and
   centered in it, so it lines up with the first line at any text size and stays on that line when
   the task wraps. The item text keeps its full line box (`text-box: normal`): the global trim cut
   it to the glyphs, which left a fixed `mt-1.5` checkbox sitting low (iPhone report 2026-11-12). */
.admin-root .content-editor-prose ul[data-type="taskList"]>li>.content-editor-task-item-checkbox {
  @apply flex flex-none items-center;
  height: 1lh;
  /* Up to the text's cap-height middle, which sits ~0.15em above the line box's middle. */
  translate: 0 -0.15em;
}

.admin-root .content-editor-prose ul[data-type="taskList"]>li>div>* {
  @apply m-0;
  text-box: normal;
}

.admin-root .content-editor-prose ul[data-type="taskList"]>li>div {
  @apply min-w-0 flex-1;
}

.admin-root .content-editor-prose li[data-checked="true"]>div>p {
  @apply text-muted-foreground line-through;
}

.admin-root .content-editor-prose :where(table):not(:where([class~="not-prose"] *)) {
  @apply my-4 w-full table-fixed border-collapse;
  font-size: 0.875rem;
}

.admin-root .content-editor-prose .tableWrapper table {
  @apply my-0 w-full;
}

.admin-root .content-editor-prose :where(th, td):not(:where([class~="not-prose"] *)) {
  @apply min-w-24 border border-border p-2 align-top leading-base;
}

.admin-root .content-editor-prose :where(th, td):not(:where([class~="not-prose"] *))> :where(p):not(:where([class~="not-prose"] *)) {
  @apply my-0 leading-base;
}

.admin-root .content-editor-prose :where(th):not(:where([class~="not-prose"] *)) {
  @apply bg-muted/50 text-left font-medium;
}

.admin-root .content-editor-prose :where(th, td).selectedCell,
.admin-root .content-editor-prose :where(th, td).content-editor-active-table-cell,
.admin-root .content-editor-prose :where(th, td):focus-within {
  @apply relative ring-1 ring-border ring-inset;
}

.admin-root .content-editor-prose :where(th, td).content-editor-table-remove-preview {
  @apply bg-muted/70;
}

.admin-root .content-editor-prose :where(th, td).selectedCell::after {
  @apply pointer-events-none absolute inset-0 bg-primary/12;
  content: "";
}

.admin-root .content-editor-prose .column-resize-handle {
  @apply pointer-events-none absolute bottom-0 right-0 top-0 w-1 bg-primary/60;
}

.admin-root .content-editor-prose .tableWrapper {
  @apply relative mt-4 mb-8 box-border overflow-visible pr-4 pb-4;
}

.admin-root .content-editor-prose [data-type="horizontalRule"] {
  @apply my-4 py-0.5;
}

.admin-root .content-editor-prose [data-type="horizontalRule"] hr {
  @apply my-0;
}

.admin-root .content-editor-prose img {
  @apply my-4 block h-auto max-w-full;
}

.admin-root .content-editor-prose p>img {
  @apply my-0 inline-block;
}

.admin-root .content-editor-prose img.ProseMirror-selectednode {
  @apply outline-2 outline-ring;
}

.admin-root .content-editor-prose [data-content-editor-image-node]:hover [data-content-editor-image-controls-overlay],
.admin-root .content-editor-prose [data-content-editor-image-node]:focus-within [data-content-editor-image-controls-overlay] {
  @apply opacity-100;
}

/* Base UI stacks a nested drawer at viewport level and pushes its parent back with
   --peek and --stack-step, and fades the parent's content out. A drawer that portals its
   nested drawer inside its own popup has to opt out of both, and has to stop its own
   drawer variables from cascading into the nested popup: each popup only declares the
   axis and direction variables it uses, so the rest resolve against the parent instead
   of their own fallbacks. The nested backdrop is also clipped to the parent's padding
   box, so the parent's own border keeps its full surface color unless it is painted
   through: it drops to a hairline of that color over the dimmed sheet. */
/* Phone focus view (Paper `Posts / New · Writing / Mobile`, `Block · Paragraph (cursor, flat
   fill)`): the block holding the cursor (Tiptap `Focus`, shallowest) sits on a flat muted plate
   painted behind it 6px out on every side, so its text does not move (`::after`: the empty-line
   placeholder owns `::before`, and the two collided on a focused empty line, iPhone report
   2026-11-12)
   and the plate keeps the 6px radius (a box-shadow spread grew the corners past it). */
/* Phone focus view lists start their bullet on the 12px text column with the item text indented
   past it (Paper `Posts / New · Writing`); the old 0.75rem hung the bullet into the edge once the
   left gutter went away. */
.admin-root [data-content-editor-focus] .content-editor-prose> :where(ul:not([data-type="taskList"]), ol) {
  padding-left: 1.375rem;
}

/* Phone markdown view (Paper `Posts / New · Writing · Markdown / Mobile`): untrimmed lines on the
   body leading (the global text-box trim pulled them to 21px) and muted line numbers, the active
   one foreground. */
.admin-root [data-content-editor-focus] :is(.cm-line, .cm-gutterElement) {
  text-box: normal;
  line-height: var(--leading-base);
}

.admin-root [data-content-editor-focus] .cm-lineNumbers .cm-gutterElement:not(.cm-activeLineGutter) {
  color: var(--muted-foreground);
}

.admin-root [data-content-editor-focus] .content-editor-prose>.has-focus {
  position: relative;
  isolation: isolate;
}

.admin-root [data-content-editor-focus] .content-editor-prose>.has-focus::after {
  content: '';
  position: absolute;
  inset: -0.375rem;
  z-index: -1;
  border-radius: var(--radius);
  background-color: var(--muted);
}

@utility no-scrollbar {
  scrollbar-width: none;

  &::-webkit-scrollbar {
    display: none;
  }
}

/* The auth card heading is the one step outside the two-step text scale: 18px on
   desktop, 16px on phones. */
@utility auth-title {
  font-size: 1.125rem;

  @media (width < theme(--breakpoint-md)) {
    font-size: 1rem;
  }
}

/* Empty-state titles sit one step above body text at every width (Paper comments on the
   Messages and Navigations desktop artboards, 2026-11-09). */
@utility empty-title {
  font-size: 1rem;
}

/* A drawer's own heading sits one step above body text, like an empty-state title (Paper
   `Audit Log / Log explorer · Detail drawer`, 2026-11-09). */
@utility drawer-title {
  font-size: 1rem;
}

/* The phone text-style sheet previews each heading level in its own size (Paper
   `Posts / New · Writing · Text style / Mobile`): Heading 1 at 18px and Heading 2 at 16px;
   Heading 3 stays on the 14px body step. */
@utility heading-1-sample {
  font-size: 1.125rem;
}

@utility heading-2-sample {
  font-size: 1rem;
}

/* The audit log activity card's event total is the one stat-sized number in the admin
   (Paper `Audit Log / Default`, 2026-11-09): 18px at every width on the body leading. */
@utility audit-total {
  font-size: 1.125rem;
  line-height: var(--leading-base);
}

/* Phone header and toolbar rows collapse labelled buttons to their icon. The entity form's
   action bar sits in the page header but leaves it on phones (fixed to the bottom, full labels). */
@utility phone-icon-buttons {
  @media (width < theme(--breakpoint-md)) {
    & :is(a, button):has(svg):not([data-slot='form-action-bar'] *) > span:not([data-slot='badge']) {
      @apply sr-only;
    }
  }
}

@utility drawer-contains-nested {
  &[data-slot='drawer-popup'] {
    --peek: 0px;
    --stack-step: 0;
  }

  &[data-nested-drawer-open] {
    background-clip: padding-box;
    border-color: color-mix(in srgb, var(--popover) 15%, transparent);

    & [data-slot='drawer-content'] {
      opacity: 1;
    }
  }

  &>[data-slot='drawer-portal'] {
    --drawer-content-width: auto;
    --drawer-content-max-height: none;
    --drawer-height: auto;
    --translate-x: 0px;
    --translate-y: 0px;
  }
}
