@layer reset, base, components, modules, utilities, native, platform;
@layer reset, base, components, modules, utilities, native, platform;

:root {
  /* Insets - The mobile apps may inject their own custom insets based on native elements on screen, like a floating navigation */
  --custom-safe-inset-top: var(--injected-safe-inset-top, env(safe-area-inset-top, 0px));
  --custom-safe-inset-right: var(--injected-safe-inset-right, env(safe-area-inset-right, 0px));
  --custom-safe-inset-bottom: var(--injected-safe-inset-bottom, env(safe-area-inset-bottom, 0px));
  --custom-safe-inset-left: var(--injected-safe-inset-left, env(safe-area-inset-left, 0px));

  /* Spacing */
  --inline-space: 1ch;
  --inline-space-half: calc(var(--inline-space) / 2);
  --inline-space-double: calc(var(--inline-space) * 2);
  --block-space: 1rem;
  --block-space-half: calc(var(--block-space) / 2);
  --block-space-double: calc(var(--block-space) * 2);

  /* Text */
  --font-sans: "Adwaita Sans", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Fizzy", "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-serif: ui-serif, serif;
  --font-mono: ui-monospace, monospace;

  --text-xx-small: 0.55rem;
  --text-x-small: 0.75rem;
  --text-small: 0.85rem;
  --text-normal: 1rem;
  --text-medium: 1.1rem;
  --text-large: 1.5rem;
  --text-x-large: 1.8rem;
  --text-xx-large: 2.5rem;

  @media (max-width: 639px) {
    --text-xx-small: 0.65rem;
    --text-x-small: 0.85rem;
    --text-small: 0.95rem;
    --text-normal: 1.1rem;
    --text-medium: 1.2rem;
    --text-large: 1.5rem;
    --text-x-large: 1.8rem;
    --text-xx-large: 2.5rem;
  }

  /* Borders */
  --border: 1px solid var(--color-ink-lighter);

  /* Shadows */
  --shadow: 0 0 0 1px oklch(var(--lch-black) / 5%),
            0 0.2em 0.2em oklch(var(--lch-black) / 5%),
            0 0.4em 0.4em oklch(var(--lch-black) / 5%),
            0 0.8em 0.8em oklch(var(--lch-black) / 5%);

  /* Components */
  --btn-size: 2.65em;
  --footer-height: 2.65rem;
  --tray-size: clamp(12rem, 25dvw, 24rem);

  /* Focus rings for keyboard navigation */
  --focus-ring-color: var(--color-link);
  --focus-ring-offset: 1px;
  --focus-ring-size: 2px;
  --focus-ring: var(--focus-ring-size) solid var(--focus-ring-color);

  /* Dialogs */
  --dialog-duration: 150ms;

  /* Easing functions from https://easingwizard.com/ */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-overshoot: cubic-bezier(0.25, 1.75, 0.5, 1);
  --ease-out-overshoot-subtle: cubic-bezier(0.25, 1.25, 0.5, 1);

  @media (max-width: 799px) {
    --tray-size: var(--footer-height);
  }

  /* Layout */
  --main-padding: clamp(var(--inline-space), 3vw, calc(var(--inline-space) * 3));
  --main-width: 1400px;

  /* Z-index */
  --z-events-column-header: 1;
  --z-events-day-header: 3;
  --z-popup: 10;
  --z-nav: 20;
  --z-flash: 30;
  --z-tooltip: 40;
  --z-bar: 50;
  --z-tray: 51;
  --z-welcome: 52;
  --z-nav-open: 100;

  /* OKLCH colors: Fixed */
  --lch-black: 0% 0 0;
  --lch-white: 100% 0 0;

  /* OKLCH colors: Light mode */
  --lch-canvas: var(--lch-white);
  --lch-ink-inverted: var(--lch-white);

  --lch-ink-darkest: 26% 0.05 264;
  --lch-ink-darker: 40% 0.026 262;
  --lch-ink-dark: 56% 0.014 260;
  --lch-ink-medium: 66% 0.008 258;
  --lch-ink-light: 84% 0.005 256;
  --lch-ink-lighter: 92% 0.003 254;
  --lch-ink-lightest: 96% 0.002 252;

  --lch-uncolor-darkest: 26% 0.018 40;
  --lch-uncolor-darker: 40.04% 0.0376 50.06;
  --lch-uncolor-dark: 57.09% 0.0676 60.5;
  --lch-uncolor-medium: 66% 0.0944 71.46;
  --lch-uncolor-light: 83.97% 0.0457 80.84;
  --lch-uncolor-lighter: 92% 0.014 90;
  --lch-uncolor-lightest: 96% 0.012 100;

  --lch-red-darkest: 26% 0.105 34;
  --lch-red-darker: 40% 0.154 36;
  --lch-red-dark: 59% 0.19 38;
  --lch-red-medium: 66% 0.204 40;
  --lch-red-light: 84.08% 0.0837 41.96;
  --lch-red-lighter: 92% 0.03 44;
  --lch-red-lightest: 96% 0.013 46;

  --lch-yellow-darkest: 26% 0.0729 40;
  --lch-yellow-darker: 40% 0.12 50;
  --lch-yellow-dark: 58% 0.156 60;
  --lch-yellow-medium: 74% 0.184 70;
  --lch-yellow-light: 84% 0.12 80;
  --lch-yellow-lighter: 92% 0.076 90;
  --lch-yellow-lightest: 96% 0.034 100;

  --lch-lime-darkest: 26% 0.064 109;
  --lch-lime-darker: 40% 0.101 110;
  --lch-lime-dark: 56.5% 0.142 111;
  --lch-lime-medium: 68% 0.176 113.11;
  --lch-lime-light: 83.92% 0.0927 113.6;
  --lch-lime-lighter: 92% 0.046 114;
  --lch-lime-lightest: 96% 0.034 115;

  --lch-green-darkest: 26% 0.071 149;
  --lch-green-darker: 40% 0.12 148;
  --lch-green-dark: 55% 0.162 147;
  --lch-green-medium: 66% 0.208 146;
  --lch-green-light: 83.92% 0.0772 145.06;
  --lch-green-lighter: 92% 0.044 144;
  --lch-green-lightest: 96% 0.022 143;

  --lch-aqua-darkest: 26% 0.059 214;
  --lch-aqua-darker: 40% 0.093 212;
  --lch-aqua-dark: 55.5% 0.122 210;
  --lch-aqua-medium: 66% 0.152 208;
  --lch-aqua-light: 83.88% 0.0555 206.02;
  --lch-aqua-lighter: 92% 0.02 204;
  --lch-aqua-lightest: 96% 0.012 202;

  --lch-blue-darkest: 26% 0.126 264;
  --lch-blue-darker: 40% 0.166 262;
  --lch-blue-dark: 57.02% 0.1895 260.46;
  --lch-blue-medium: 66% 0.196 257.82;
  --lch-blue-light: 84.04% 0.0719 255.29;
  --lch-blue-lighter: 92% 0.026 254;
  --lch-blue-lightest: 96% 0.016 252;

  --lch-violet-darkest: 26% 0.148 292;
  --lch-violet-darker: 40% 0.2 290;
  --lch-violet-dark: 58% 0.216 287.6;
  --lch-violet-medium: 66% 0.206 285.52;
  --lch-violet-light: 84.08% 0.0791 283.47;
  --lch-violet-lighter: 92% 0.03 282;
  --lch-violet-lightest: 96% 0.015 280;

  --lch-purple-darkest: 26% 0.131 314;
  --lch-purple-darker: 40% 0.178 312;
  --lch-purple-dark: 58% 0.21 310;
  --lch-purple-medium: 66% 0.258 308;
  --lch-purple-light: 84.09% 0.0778 305.77;
  --lch-purple-lighter: 92% 0.03 304;
  --lch-purple-lightest: 96% 0.019 302;

  --lch-pink-darkest: 26% 0.12 348;
  --lch-pink-darker: 40% 0.16 346;
  --lch-pink-dark: 59% 0.188 344;
  --lch-pink-medium: 71.8% 0.2008 342;
  --lch-pink-light: 84.04% 0.0737 340;
  --lch-pink-lighter: 92% 0.03 338;
  --lch-pink-lightest: 96% 0.02 336;

  /* Colors: Named */
  --color-black: oklch(var(--lch-black));
  --color-white: oklch(var(--lch-white));

  --color-ink: oklch(var(--lch-ink-darkest));
  --color-ink-darkest: oklch(var(--lch-ink-darkest));
  --color-ink-darker: oklch(var(--lch-ink-darker));
  --color-ink-dark: oklch(var(--lch-ink-dark));
  --color-ink-medium: oklch(var(--lch-ink-medium));
  --color-ink-light: oklch(var(--lch-ink-light));
  --color-ink-lighter: oklch(var(--lch-ink-lighter));
  --color-ink-lightest: oklch(var(--lch-ink-lightest));

  --color-ink-inverted: oklch(var(--lch-ink-inverted));

  /* Colors: Abstractions */
  --color-canvas: oklch(var(--lch-canvas));
  --color-negative: oklch(var(--lch-red-dark));
  --color-positive: oklch(var(--lch-green-dark));
  --color-link: oklch(var(--lch-blue-dark));
  --color-selected-light: oklch(var(--lch-blue-lightest));
  --color-selected: oklch(var(--lch-blue-lighter));
  --color-selected-dark: oklch(var(--lch-blue-light));
  --color-highlight: oklch(var(--lch-yellow-lighter));
  --color-marker: oklch(var(--lch-red-medium));
  --color-terminal-bg: oklch(98% 0.002 252);
  --color-terminal-text: var(--color-ink);
  --color-terminal-text-light: var(--color-ink-lighter);
  --color-golden: oklch(89.1% 0.178 95.7);
  --color-maybe: oklch(var(--lch-blue-medium));

  /* Colors: Cards */
  --color-card-default: oklch(var(--lch-blue-dark));
  --color-card-complete: var(--color-ink-darker);
  --color-card-1: oklch(var(--lch-ink-medium));
  --color-card-2: oklch(var(--lch-uncolor-medium));
  --color-card-3: oklch(var(--lch-yellow-medium));
  --color-card-4: oklch(var(--lch-lime-medium));
  --color-card-5: oklch(var(--lch-aqua-medium));
  --color-card-6: oklch(var(--lch-violet-medium));
  --color-card-7: oklch(var(--lch-purple-medium));
  --color-card-8: oklch(var(--lch-pink-medium));

  /* Colors: Highlighter */
  --highlight-1: rgb(136, 118, 38);
  --highlight-2: rgb(185, 94, 6);
  --highlight-3: rgb(207, 0, 0);
  --highlight-4: rgb(216, 28, 170);
  --highlight-5: rgb(144, 19, 254);
  --highlight-6: rgb(5, 98, 185);
  --highlight-7: rgb(17, 138, 15);
  --highlight-8: rgb(148, 82, 22);
  --highlight-9: rgb(102, 102, 102);

  --highlight-bg-1: rgba(229, 223, 6, 0.3);
  --highlight-bg-2: rgba(255, 185, 87, 0.3);
  --highlight-bg-3: rgba(255, 118, 118, 0.3);
  --highlight-bg-4: rgba(248, 137, 216, 0.3);
  --highlight-bg-5: rgba(190, 165, 255, 0.3);
  --highlight-bg-6: rgba(124, 192, 252, 0.3);
  --highlight-bg-7: rgba(140, 255, 129, 0.3);
  --highlight-bg-8: rgba(221, 170, 123, 0.3);
  --highlight-bg-9: rgba(200, 200, 200, 0.3);

  /* Colors: Syntax highlighting */
  --color-code-token__att: oklch(var(--lch-blue-dark));
  --color-code-token__comment: oklch(var(--lch-ink-medium));
  --color-code-token__function: oklch(var(--lch-purple-dark));
  --color-code-token__operator: oklch(var(--lch-red-dark));
  --color-code-token__property: oklch(var(--lch-purple-dark));
  --color-code-token__punctuation: oklch(var(--lch-ink-dark));
  --color-code-token__selector: oklch(var(--lch-green-dark));
  --color-code-token__variable: oklch(var(--lch-red-dark));

  /* Colors: Generating gradient */
  --color-gradient-1: oklch(var(--lch-violet-lighter));
  --color-gradient-2: oklch(var(--lch-pink-lighter));
  --color-gradient-3: oklch(var(--lch-purple-lighter));
  --color-gradient-4: var(--color-canvas);
}

/* Dark mode - explicit theme choice overrides system preference */
html[data-theme="dark"] {
  --lch-canvas: 20% 0.0195 232.58;
  --lch-ink-inverted: var(--lch-black);

  --lch-ink-darkest: 96.02% 0.0034 260;
  --lch-ink-darker: 86% 0.0061 260;
  --lch-ink-dark: 73.97% 0.009 260;
  --lch-ink-medium: 62% 0.0122 260;
  --lch-ink-light: 40% 0.0148 260;
  --lch-ink-lighter: 30% 0.0178 260;
  --lch-ink-lightest: 25% 0.0204 260;

  --lch-uncolor-darkest: 96.09% 0.0076 100;
  --lch-uncolor-darker: 86% 0.021 90;
  --lch-uncolor-dark: 73.93% 0.041 80;
  --lch-uncolor-medium: 62% 0.0552 70;
  --lch-uncolor-light: 40% 0.0387 60;
  --lch-uncolor-lighter: 30% 0.012 50;
  --lch-uncolor-lightest: 25% 0.0017 40;

  --lch-red-darkest: 95.85% 0.0218 46;
  --lch-red-darker: 86% 0.086 44;
  --lch-red-dark: 73.95% 0.139 42;
  --lch-red-medium: 62% 0.154 40;
  --lch-red-light: 40% 0.088 38;
  --lch-red-lighter: 30% 0.032 36;
  --lch-red-lightest: 25% 0.011 34;

  --lch-yellow-darkest: 96% 0.056 100;
  --lch-yellow-darker: 86% 0.103 90;
  --lch-yellow-dark: 74.06% 0.136 80;
  --lch-yellow-medium: 62.1% 0.146 70;
  --lch-yellow-light: 40% 0.0736 60;
  --lch-yellow-lighter: 30% 0.026 50;
  --lch-yellow-lightest: 25% 0.01 40;

  --lch-lime-darkest: 96.04% 0.066 115;
  --lch-lime-darker: 86% 0.098 114;
  --lch-lime-dark: 73.97% 0.121 113;
  --lch-lime-medium: 62% 0.128 112;
  --lch-lime-light: 40% 0.0637 111;
  --lch-lime-lighter: 30% 0.024 110;
  --lch-lime-lightest: 25% 0.012 109;

  --lch-green-darkest: 96.12% 0.035 143;
  --lch-green-darker: 86% 0.082 144;
  --lch-green-dark: 73.99% 0.117 145;
  --lch-green-medium: 62% 0.1261 146;
  --lch-green-light: 40% 0.065 147;
  --lch-green-lighter: 30% 0.03 148;
  --lch-green-lightest: 25% 0.018 149;

  --lch-aqua-darkest: 96.15% 0.0244 202;
  --lch-aqua-darker: 86% 0.06 204;
  --lch-aqua-dark: 73.92% 0.095 206;
  --lch-aqua-medium: 62% 0.106 208;
  --lch-aqua-light: 40% 0.0594 210;
  --lch-aqua-lighter: 30% 0.028 212;
  --lch-aqua-lightest: 25% 0.017 214;

  --lch-blue-darkest: 95.93% 0.0217 252;
  --lch-blue-darker: 86% 0.068 254;
  --lch-blue-dark: 74% 0.1293 256;
  --lch-blue-medium: 62% 0.159 258;
  --lch-blue-light: 40% 0.094 260;
  --lch-blue-lighter: 30% 0.0452 262;
  --lch-blue-lightest: 25% 0.0318 264;

  --lch-violet-darkest: 95.97% 0.019 280;
  --lch-violet-darker: 86% 0.068 282;
  --lch-violet-dark: 74.08% 0.142 284;
  --lch-violet-medium: 62% 0.184 286;
  --lch-violet-light: 40% 0.108 288;
  --lch-violet-lighter: 30% 0.048 290;
  --lch-violet-lightest: 25% 0.025 292;

  --lch-purple-darkest: 95.99% 0.0217 302;
  --lch-purple-darker: 86% 0.068 304;
  --lch-purple-dark: 73.98% 0.141 306;
  --lch-purple-medium: 62% 0.177 308;
  --lch-purple-light: 40% 0.099 310;
  --lch-purple-lighter: 30% 0.04 312;
  --lch-purple-lightest: 25% 0.017 314;

  --lch-pink-darkest: 95.84% 0.0308 336;
  --lch-pink-darker: 86% 0.074 338;
  --lch-pink-dark: 74.04% 0.1294 340;
  --lch-pink-medium: 62% 0.166 342;
  --lch-pink-light: 40% 0.085 344;
  --lch-pink-lighter: 30% 0.03 346;
  --lch-pink-lightest: 25% 0.011 348;

  --color-terminal-bg: var(--color-canvas);
  --color-terminal-text-light: oklch(var(--lch-green-dark));
  --color-golden: oklch(var(--lch-blue-medium));
  --color-highlight: oklch(var(--lch-blue-lighter));

  --shadow: 0 0 0 1px oklch(var(--lch-black) / 0.42),
    0 0.2em 1.6em -0.8em oklch(var(--lch-black) / 0.6),
    0 0.4em 2.4em -1em oklch(var(--lch-black) / 0.7),
    0 0.4em 0.8em -1.2em oklch(var(--lch-black) / 0.8),
    0 0.8em 1.2em -1.6em oklch(var(--lch-black) / 0.9),
    0 1.2em 1.6em -2em oklch(var(--lch-black) / 1);
}

/* Fallback to system preference when no explicit theme is set */
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --lch-canvas: 20% 0.0195 232.58;
    --lch-ink-inverted: var(--lch-black);

    --lch-ink-darkest: 96.02% 0.0034 260;
    --lch-ink-darker: 86% 0.0061 260;
    --lch-ink-dark: 73.97% 0.009 260;
    --lch-ink-medium: 62% 0.0122 260;
    --lch-ink-light: 40% 0.0148 260;
    --lch-ink-lighter: 30% 0.0178 260;
    --lch-ink-lightest: 25% 0.0204 260;

    --lch-uncolor-darkest: 96.09% 0.0076 100;
    --lch-uncolor-darker: 86% 0.021 90;
    --lch-uncolor-dark: 73.93% 0.041 80;
    --lch-uncolor-medium: 62% 0.0552 70;
    --lch-uncolor-light: 40% 0.0387 60;
    --lch-uncolor-lighter: 30% 0.012 50;
    --lch-uncolor-lightest: 25% 0.0017 40;

    --lch-red-darkest: 95.85% 0.0218 46;
    --lch-red-darker: 86% 0.086 44;
    --lch-red-dark: 73.95% 0.139 42;
    --lch-red-medium: 62% 0.154 40;
    --lch-red-light: 40% 0.088 38;
    --lch-red-lighter: 30% 0.032 36;
    --lch-red-lightest: 25% 0.011 34;

    --lch-yellow-darkest: 96% 0.056 100;
    --lch-yellow-darker: 86% 0.103 90;
    --lch-yellow-dark: 74.06% 0.136 80;
    --lch-yellow-medium: 62.1% 0.146 70;
    --lch-yellow-light: 40% 0.0736 60;
    --lch-yellow-lighter: 30% 0.026 50;
    --lch-yellow-lightest: 25% 0.01 40;

    --lch-lime-darkest: 96.04% 0.066 115;
    --lch-lime-darker: 86% 0.098 114;
    --lch-lime-dark: 73.97% 0.121 113;
    --lch-lime-medium: 62% 0.128 112;
    --lch-lime-light: 40% 0.0637 111;
    --lch-lime-lighter: 30% 0.024 110;
    --lch-lime-lightest: 25% 0.012 109;

    --lch-green-darkest: 96.12% 0.035 143;
    --lch-green-darker: 86% 0.082 144;
    --lch-green-dark: 73.99% 0.117 145;
    --lch-green-medium: 62% 0.1261 146;
    --lch-green-light: 40% 0.065 147;
    --lch-green-lighter: 30% 0.03 148;
    --lch-green-lightest: 25% 0.018 149;

    --lch-aqua-darkest: 96.15% 0.0244 202;
    --lch-aqua-darker: 86% 0.06 204;
    --lch-aqua-dark: 73.92% 0.095 206;
    --lch-aqua-medium: 62% 0.106 208;
    --lch-aqua-light: 40% 0.0594 210;
    --lch-aqua-lighter: 30% 0.028 212;
    --lch-aqua-lightest: 25% 0.017 214;

    --lch-blue-darkest: 95.93% 0.0217 252;
    --lch-blue-darker: 86% 0.068 254;
    --lch-blue-dark: 74% 0.1293 256;
    --lch-blue-medium: 62% 0.159 258;
    --lch-blue-light: 40% 0.094 260;
    --lch-blue-lighter: 30% 0.0452 262;
    --lch-blue-lightest: 25% 0.0318 264;

    --lch-violet-darkest: 95.97% 0.019 280;
    --lch-violet-darker: 86% 0.068 282;
    --lch-violet-dark: 74.08% 0.142 284;
    --lch-violet-medium: 62% 0.184 286;
    --lch-violet-light: 40% 0.108 288;
    --lch-violet-lighter: 30% 0.048 290;
    --lch-violet-lightest: 25% 0.025 292;

    --lch-purple-darkest: 95.99% 0.0217 302;
    --lch-purple-darker: 86% 0.068 304;
    --lch-purple-dark: 73.98% 0.141 306;
    --lch-purple-medium: 62% 0.177 308;
    --lch-purple-light: 40% 0.099 310;
    --lch-purple-lighter: 30% 0.04 312;
    --lch-purple-lightest: 25% 0.017 314;

    --lch-pink-darkest: 95.84% 0.0308 336;
    --lch-pink-darker: 86% 0.074 338;
    --lch-pink-dark: 74.04% 0.1294 340;
    --lch-pink-medium: 62% 0.166 342;
    --lch-pink-light: 40% 0.085 344;
    --lch-pink-lighter: 30% 0.03 346;
    --lch-pink-lightest: 25% 0.011 348;

    --color-terminal-bg: var(--color-canvas);
    --color-terminal-text-light: oklch(var(--lch-green-dark));
    --color-golden: oklch(var(--lch-blue-medium));
    --color-highlight: oklch(var(--lch-blue-lighter));

    --shadow: 0 0 0 1px oklch(var(--lch-black) / 0.42),
              0 .2em 1.6em -0.8em oklch(var(--lch-black) / 0.6),
              0 .4em 2.4em -1em oklch(var(--lch-black) / 0.7),
              0 .4em .8em -1.2em oklch(var(--lch-black) / 0.8),
              0 .8em 1.2em -1.6em oklch(var(--lch-black) / 0.9),
              0 1.2em 1.6em -2em oklch(var(--lch-black) / 1);
  }
}

:root {
  --color-page: oklch(96.7% 0.003 264.5);
  --color-ink-light: oklch(26% 0.05 264 / 12%);

  --color-body: var(--color-page);
  --color-text-subtle: var(--color-ink-dark);
  --color-text-placeholder: var(--color-ink-medium);

  /* Read by Fizzy's verbatim files under these names. */
  --color-text: var(--color-ink);
  --color-ink-ligher: var(--color-ink-lighter);
  --card-bg-color: var(--color-canvas);
  --color-always-black: var(--color-black);
  --color-border-darker: var(--color-ink-light);
  --font-size-medium: var(--text-medium);

  --tint-ink-2: color-mix(in oklch, var(--color-ink) 2%, transparent);
  --tint-ink-3: color-mix(in oklch, var(--color-ink) 3%, transparent);
  --tint-ink-5: color-mix(in oklch, var(--color-ink) 5%, transparent);
  --tint-ink-10: color-mix(in oklch, var(--color-ink) 10%, transparent);
  --tint-ink-15: color-mix(in oklch, var(--color-ink) 15%, transparent);
  --tint-ink-20: color-mix(in oklch, var(--color-ink) 20%, transparent);
  --tint-ink-25: color-mix(in oklch, var(--color-ink) 25%, transparent);
  --tint-ink-35: color-mix(in oklch, var(--color-ink) 35%, transparent);
  --tint-ink-50: color-mix(in oklch, var(--color-ink) 50%, transparent);
  --tint-ink-75: color-mix(in oklch, var(--color-ink) 75%, transparent);

  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  --leading-snug: 1.35;

  /* What the strip takes: its buttons, the padding around them and the hairline. The scroll padding reads it too. */
  --strip-height: calc(3rem + 1px);

  @media (width >= 640px) {
    --strip-height: calc(2.75rem + 1px);
  }

  --shadow-card: 0 0 0 1px var(--tint-ink-5),
                 0 1px 2px oklch(var(--lch-black) / 5%),
                 0 4px 12px oklch(var(--lch-black) / 5%);
  --shadow-modal: 0 0 0 1px var(--tint-ink-5),
                  0 8px 24px oklch(var(--lch-black) / 10%),
                  0 24px 64px oklch(var(--lch-black) / 15%);

  --duration-fast: 75ms;
  --duration-medium: 150ms;
  --duration-slow: 300ms;
  --duration-slower: 400ms;
}

html[data-theme="dark"] {
  --color-page: oklch(14% 0.02 232);
  --color-ink-light: oklch(96% 0.0034 260 / 16%);

  --shadow-card: 0 0 0 1px var(--tint-ink-5),
                 0 1px 2px oklch(var(--lch-black) / 40%),
                 0 4px 12px oklch(var(--lch-black) / 50%);
  --shadow-modal: 0 0 0 1px var(--tint-ink-10),
                  0 8px 24px oklch(var(--lch-black) / 50%),
                  0 24px 64px oklch(var(--lch-black) / 70%);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --color-page: oklch(14% 0.02 232);
    --color-ink-light: oklch(96% 0.0034 260 / 16%);

    --shadow-card: 0 0 0 1px var(--tint-ink-5),
                   0 1px 2px oklch(var(--lch-black) / 40%),
                   0 4px 12px oklch(var(--lch-black) / 50%);
    --shadow-modal: 0 0 0 1px var(--tint-ink-10),
                    0 8px 24px oklch(var(--lch-black) / 50%),
                    0 24px 64px oklch(var(--lch-black) / 70%);
  }
}

@layer reset {
  /*
  * Modern CSS Reset
  * @link https://github.com/hankchizljaw/modern-css-reset
  */

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

  /* Remove default margin */
  body,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    margin: 0;
  }

  p,
  li,
  h1,
  h2,
  h3,
  h4 {
    /* Help prevent overflow of long words/names/URLs */
    word-break: break-word;

    /* Optional, not supported for all languages */
    /* hyphens: auto; */
  }

  html,
  body {
    overflow-x: clip;
  }

  html {
    /* scroll-behavior: smooth; */
  }

  /* Set core body defaults */
  body {
    min-height: 100dvh;
    font-family: sans-serif;
    font-size: 100%;
    line-height: 1.5;
    text-rendering: optimizeSpeed;
  }

  /* Make images easier to work with */
  img {
    display: block;
    max-inline-size: 100%;
  }

  /* Inherit fonts for inputs and buttons */
  input,
  button,
  textarea,
  select {
    font: inherit;
  }

  button {
    cursor: pointer;
  }

  summary {
    &::-webkit-details-marker {
      display: none;
    }

    &::marker {
      content: "";
    }
  }

  /* Remove all animations and transitions for people that prefer not to see them */


  dialog {
    border: 0;
    padding: 0;

    &:where(:focus-visible):focus,
    &:where(:focus-visible):active {
      outline: 0;
    }
  }
}

@layer components {
  .icon {
    -webkit-touch-callout: none;
    background-color: currentColor;
    block-size: var(--icon-size, 1em);
    display: inline-block;
    flex-shrink: 0;
    inline-size: var(--icon-size, 1em);
    mask-image: var(--svg);
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: var(--icon-size, 1em);
    pointer-events: none;
    position: relative;
    user-select: none;
  }

  img.icon {
    background: none;
  }

  .icon--37signals {
    --svg: url("37signals.svg");
    top: -0.1em;
    margin-right: 0.1375em;
  }
  .icon--add { --svg: url("data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2032%2032%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22m4%2016c0%20.8.7%201.5%201.5%201.5h8.8c.1%200%20.2.1.2.2v8.8c0%20.8.7%201.5%201.5%201.5s1.5-.7%201.5-1.5v-8.8c0-.1.1-.2.2-.2h8.8c.8%200%201.5-.7%201.5-1.5s-.7-1.5-1.5-1.5h-8.8c-.1%200-.2-.1-.2-.2v-8.8c0-.8-.7-1.5-1.5-1.5s-1.5.7-1.5%201.5v8.8c0%20.1-.1.2-.2.2h-8.8c-.8%200-1.5.7-1.5%201.5z%22%2F%3E%3C%2Fsvg%3E"); }
  .icon--add--meta { --svg: url("add--meta.svg "); }
  .icon--arrow-left { --svg: url("arrow-left.svg "); }
  .icon--arrow-right { --svg: url("arrow-right.svg "); }
  .icon--arrow-up { --svg: url("arrow-up.svg "); }
  .icon--art { --svg: url("art.svg "); }
  .icon--assigned { --svg: url("assigned.svg "); }
  .icon--attachment { --svg: url("attachment.svg "); }
  .icon--authentication { --svg: url("authentication.svg "); }
  .icon--basecamp {
    --svg: url("basecamp.svg");
    inline-size: 1.14em;
    mask-size: 1.14em var(--icon-size, 1em);
    top: -0.1em;
    margin-right: 0.1375em;
  }
  .icon--bell-alert { --svg: url("data:image/svg+xml,%3Csvg%20enable-background%3D%22new%200%200%2024%2024%22%20viewBox%3D%220%200%2024%2024%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22m17%2020.5c0%20.2%200%20.3-.1.5.1-.1.1-.3.1-.5z%22%2F%3E%3Cpath%20d%3D%22m14.1%209.1c.1-.2.2-.3.3-.4-.1.1-.2.2-.3.4l-2.2%204.2z%22%2F%3E%3Cpath%20d%3D%22m14%206.6c.6-.3%201.2-.4%201.8-.4h.2c-1.2-1.6-3-2.7-5-3.1v-2.1c0-.6-.4-1-1-1s-1%20.4-1%201v2.1c-3.9.7-6.6%204.1-6.5%208.1v4.8c0%20.8-.7%201.5-1.5%201.5-.6%200-1%20.4-1%201s.4%201%201%201h5.4l5.9-11.3c.4-.7%201-1.3%201.7-1.6z%22%2F%3E%3Cpath%20d%3D%22m23.8%2021.3-6.4-12.2c0-.1-.1-.1-.1-.2s-.1-.1-.2-.2c0%200-.1-.1-.1-.1s-.1-.1-.1-.1c-.1%200-.1-.1-.2-.1%200%200-.1%200-.1-.1-.1-.1-.3-.1-.4-.2h-.1-.1c-.1%200-.2%200-.3%200s0%200-.1%200c0%200%200%200-.1%200h-.1c-.1%200-.1%200-.2%200h-.1c-.1%200-.3.1-.4.1-.3.2-.6.4-.8.8l-5.2%2010.5-.8%201.5-.2.3c-.1.2-.1.4-.2.5-.1.4%200%20.9.2%201.3.4.6%201%20.9%201.6.9h.7%2012.2c.6%200%201.2-.3%201.6-.9.3-.5.3-1.2%200-1.8zm-8.7-3.6c-.1-.1-.2-.2-.2-.3v-.1c0-.1-.1-.2-.1-.3v-3.2c0-.1%200-.2.1-.3v-.1c0-.1.1-.1.1-.2%200%200%200%200%20.1-.1.2-.2.4-.3.6-.3.5%200%201%20.4%201%201v3.2c0%20.5-.4%201-1%201-.2%200-.4-.1-.6-.3zm.7%204.1c.4%200%20.7-.1.9-.4-.3.2-.6.4-.9.4-.7%200-1.3-.6-1.3-1.3%200-.1%200-.3.1-.4%200-.1%200-.1.1-.1%200-.1.1-.1.1-.1.1-.1.2-.2.3-.3s.2-.1.3-.2c.1%200%20.3-.1.4-.1.3%200%20.5.1.7.3.3.2.5.6.5%201%200%20.6-.5%201.2-1.2%201.2z%22%2F%3E%3C%2Fsvg%3E"); }
  .icon--bell-off { --svg: url("bell-off.svg "); }
  .icon--bell { --svg: url("data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2024%2024%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22m21%2017.5a1.5%201.5%200%200%201%20-1.5-1.5v-4.862a7.957%207.957%200%200%200%20-6.5-8.065v-2.073a1%201%200%200%200%20-2%200v2.073a7.957%207.957%200%200%200%20-6.5%208.065v4.862a1.5%201.5%200%200%201%20-1.5%201.5%201%201%200%200%200%200%202h18a1%201%200%200%200%200-2z%22%2F%3E%3Cpath%20d%3D%22m14.236%2021h-4.472a.25.25%200%200%200%20-.248.222%202.319%202.319%200%200%200%20-.016.278%202.5%202.5%200%201%200%205%200%202.319%202.319%200%200%200%20-.016-.278.248.248%200%200%200%20-.248-.222z%22%2F%3E%3C%2Fsvg%3E"); }
  .icon--bolt { --svg: url("bolt.svg "); }
  .icon--bookmark-outline { --svg: url("bookmark-outline.svg "); }
  .icon--bookmark { --svg: url("bookmark.svg "); }
  .icon--boost { --svg: url("boost.svg "); }
  .icon--camera { --svg: url("camera.svg "); }
  .icon--caret-down { --svg: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M4%208l8%208%208-8%22%20stroke%3D%22%23000%22%20stroke-width%3D%224%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E"); }
  .icon--check { --svg: url("check.svg "); }
  .icon--check-circle { --svg: url("check-circle.svg "); }
  .icon--check-all { --svg: url("check-all.svg "); }
  .icon--clipboard { --svg: url("clipboard.svg "); }
  .icon--close { --svg: url("close.svg "); }
  .icon--close-circle { --svg: url("close-circle.svg "); }
  .icon--collapse { --svg: url("collapse.svg "); }
  .icon--board { --svg: url("board.svg "); }
  .icon--board-add { --svg: url("board-add.svg "); }
  .icon--column-left { --svg: url("column-left.svg "); }
  .icon--column-right { --svg: url("column-right.svg "); }
  .icon--comment { --svg: url("data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2024%2024%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3CclipPath%20id%3D%22a%22%3E%3Cpath%20d%3D%22m.2.5h24v24h-24z%22%2F%3E%3C%2FclipPath%3E%3Cg%20clip-path%3D%22url%28%23a%29%22%3E%3Cpath%20d%3D%22m1.2%207c0-2.8%202.3-5%205-5h12c2.8%200%205%202.2%205%205v6c0%202.8-2.2%205-5%205h-5.6l-4.7%204.7c-.4.4-1%20.4-1.4%200-.2-.2-.3-.4-.3-.7v-4c-2.8%200-5-2.2-5-5zm5-.8c-.4%200-.8.3-.8.8s.3.8.8.8h12c.4%200%20.8-.3.8-.8s-.3-.8-.8-.8zm0%203c-.4%200-.8.3-.8.8s.3.8.8.8h12c.4%200%20.8-.3.8-.8s-.3-.8-.8-.8zm-.7%203.8c0-.4.3-.8.8-.8h8c.4%200%20.8.3.8.8s-.3.8-.8.8h-8.1c-.4%200-.8-.3-.8-.8z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); }
  .icon--copy-paste { --svg: url("data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2024%2024%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22m13.4%204.727a.251.251%200%200%200%20.2.265%201.089%201.089%200%200%201%20.824%201.108v1.4a1.244%201.244%200%200%200%201.244%201.244%201.244%201.244%200%200%200%201.245-1.244v-3.525a1.494%201.494%200%200%200%20-1.5-1.494h-1.724a.246.246%200%200%200%20-.177.074.249.249%200%200%200%20-.073.177c.002.473.001%201.492-.039%201.995z%22%2F%3E%3Cpath%20d%3D%22m8.954%2021.262a1.244%201.244%200%200%200%20-1.244-1.244h-4.226a1.073%201.073%200%200%201%20-1-1.136v-12.782a1.086%201.086%200%200%201%20.842-1.115.25.25%200%200%200%20.2-.258c-.039-.766-.051-1.6-.055-2a.25.25%200%200%200%20-.25-.247h-1.721a1.494%201.494%200%200%200%20-1.5%201.495v17.037a1.493%201.493%200%200%200%201.494%201.493h6.216a1.244%201.244%200%200%200%201.244-1.243z%22%2F%3E%3Cpath%20d%3D%22m11.937%204.472v-1.988a.5.5%200%200%200%20-.5-.5h-.758a.251.251%200%200%201%20-.249-.222%201.989%201.989%200%200%200%20-3.953%200%20.249.249%200%200%201%20-.249.222h-.755a.5.5%200%200%200%20-.5.5v1.988a.5.5%200%200%200%20.5.5h5.967a.5.5%200%200%200%20.497-.5z%22%2F%3E%3Cpath%20d%3D%22m19.02%2017.269h-3.979a.75.75%200%201%200%200%201.5h3.979a.75.75%200%201%200%200-1.5z%22%2F%3E%3Cpath%20d%3D%22m14.291%2014.54a.75.75%200%200%200%20.75.749h2.486a.75.75%200%201%200%200-1.5h-2.486a.75.75%200%200%200%20-.75.751z%22%2F%3E%3Cpath%20d%3D%22m23.5%2013.46a1.991%201.991%200%200%200%20-.584-1.409l-1.406-1.4a1.994%201.994%200%200%200%20-1.41-.584h-7.606a1.993%201.993%200%200%200%20-1.994%201.988v9.945a2%202%200%200%200%202%202h9a2%202%200%200%200%202-2zm-11-.4a1%201%200%200%201%201-1h6.187a1%201%200%200%201%20.707.292l.818.816a1%201%200%200%201%20.293.708v7.124a1%201%200%200%201%20-1%201h-7a1%201%200%200%201%20-1-1z%22%2F%3E%3C%2Fsvg%3E"); }
  .icon--crown { --svg: url("crown.svg "); }
  .icon--email { --svg: url("email.svg "); }
  .icon--everyone { --svg: url("everyone.svg "); }
  .icon--expand { --svg: url("expand.svg "); }
  .icon--gear { --svg: url("gear.svg "); }
  .icon--grid { --svg: url("grid.svg "); }
  .icon--filter { --svg: url("filter.svg "); }
  .icon--fizzy {
    --svg: url("fizzy.svg");
    top: -0.1em;
    margin-right: 0.1375em;
  }
  .icon--globe { --svg: url("globe.svg "); }
  .icon--golden-ticket { --svg: url("golden-ticket.svg "); }
  .icon--hey {
    --svg: url("hey.svg");
    block-size: 1.06em;
    mask-size: var(--icon-size, 1em) 1.06em;
    top: -0.1em;
    margin-right: 0.1375em;
  }
  .icon--history { --svg: url("history.svg "); }
  .icon--home { --svg: url("data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2024%2024%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22m12%203%208%206v12h-5v-7h-6v7h-5v-12z%22%2F%3E%3C%2Fsvg%3E"); }
  .icon--install-edge { --svg: url("install-edge.svg "); }
  .icon--lifebuoy { --svg: url("lifebuoy.svg "); }
  .icon--lock { --svg: url("lock.svg "); }
  .icon--logout { --svg: url("logout.svg "); }
  .icon--marker { --svg: url("marker.svg "); }
  .icon--maximize { --svg: url("maximize.svg "); }
  .icon--menu { --svg: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Crect%20width%3D%2223%22%20height%3D%223%22%20x%3D%22.5%22%20y%3D%222.5%22%20rx%3D%221%22%2F%3E%3Crect%20width%3D%2223%22%20height%3D%223%22%20x%3D%22.5%22%20y%3D%2210.5%22%20rx%3D%221%22%2F%3E%3Crect%20width%3D%2223%22%20height%3D%223%22%20x%3D%22.5%22%20y%3D%2218.5%22%20rx%3D%221%22%2F%3E%3C%2Fsvg%3E"); }
  .icon--menu-dots-horizontal { --svg: url("menu-dots-horizontal.svg "); }
  .icon--menu-dots-vertical { --svg: url("menu-dots-vertical.svg "); }
  .icon--minus { --svg: url("minus.svg "); }
  .icon--monitor { --svg: url("monitor.svg "); }
  .icon--moon { --svg: url("moon.svg "); }
  .icon--move { --svg: url("move.svg "); }
  .icon--notification-bell-access-only { --svg: url("data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2024%2024%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22m21%2017.5a1.5%201.5%200%200%201%20-1.5-1.5v-4.862a7.957%207.957%200%200%200%20-6.5-8.065v-2.073a1%201%200%200%200%20-2%200v2.073a7.957%207.957%200%200%200%20-6.5%208.065v4.862a1.5%201.5%200%200%201%20-1.5%201.5%201%201%200%200%200%200%202h18a1%201%200%200%200%200-2z%22%2F%3E%3Cpath%20d%3D%22m14.236%2021h-4.472a.25.25%200%200%200%20-.248.222%202.319%202.319%200%200%200%20-.016.278%202.5%202.5%200%201%200%205%200%202.319%202.319%200%200%200%20-.016-.278.248.248%200%200%200%20-.248-.222z%22%2F%3E%3C%2Fsvg%3E"); }
  .icon--notification-bell-watching { --svg: url("bell-off.svg "); }
  .icon--notification-bell-reverse-access-only { --svg: url("bell-off.svg "); }
  .icon--notification-bell-reverse-watching { --svg: url("data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2024%2024%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22m21%2017.5a1.5%201.5%200%200%201%20-1.5-1.5v-4.862a7.957%207.957%200%200%200%20-6.5-8.065v-2.073a1%201%200%200%200%20-2%200v2.073a7.957%207.957%200%200%200%20-6.5%208.065v4.862a1.5%201.5%200%200%201%20-1.5%201.5%201%201%200%200%200%200%202h18a1%201%200%200%200%200-2z%22%2F%3E%3Cpath%20d%3D%22m14.236%2021h-4.472a.25.25%200%200%200%20-.248.222%202.319%202.319%200%200%200%20-.016.278%202.5%202.5%200%201%200%205%200%202.319%202.319%200%200%200%20-.016-.278.248.248%200%200%200%20-.248-.222z%22%2F%3E%3C%2Fsvg%3E"); }
  .icon--password { --svg: url("password.svg "); }
  .icon--pencil { --svg: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M2.649%2016.4a.5.5%200%200%200-.841.245L.394%2023.01a.5.5%200%200%200%20.134.462.51.51%200%200%200%20.462.135l6.364-1.414a.5.5%200%200%200%20.245-.842zM17.852%207.208l-10.96%2010.96a.25.25%200%200%200%200%20.354L8.66%2020.29a.507.507%200%200%200%20.707%200L19.974%209.683a.5.5%200%200%200%200-.707l-1.768-1.768a.25.25%200%200%200-.354%200M16.792%205.794l-1.768-1.767a.5.5%200%200%200-.707%200L3.71%2014.633a.5.5%200%200%200%200%20.707l1.768%201.768a.25.25%200%200%200%20.354%200l10.96-10.96a.25.25%200%200%200%200-.354M22.449%201.552a4.005%204.005%200%200%200-5.658%200l-.707.707a.5.5%200%200%200%200%20.707l4.95%204.949a.513.513%200%200%200%20.707%200l.708-.707a4%204%200%200%200%200-5.656%22%2F%3E%3C%2Fsvg%3E"); }
  .icon--person { --svg: url("person.svg "); }
  .icon--person-add { --svg: url("person-add.svg "); }
  .icon--picture-add { --svg: url("picture-add.svg "); }
  .icon--picture-double { --svg: url("picture-double.svg "); }
  .icon--picture-remove { --svg: url("picture-remove.svg "); }
  .icon--picture-zoom { --svg: url("picture-zoom.svg "); }
  .icon--pinned { --svg: url("pinned.svg "); }
  .icon--qr-code { --svg: url("data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2024%2024%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22m4%204h6v6h-6zm16%200v6h-6v-6zm-6%2011h2v-2h-2v-2h2v2h2v-2h2v2h-2v2h2v3h-2v2h-2v-2h-3v2h-2v-4h3zm2%200v3h2v-3zm-12%205v-6h6v6zm2-14v2h2v-2zm10%200v2h2v-2zm-10%2010v2h2v-2zm-2-5h2v2h-2zm5%200h4v4h-2v-2h-2zm2-5h2v4h-2zm-9-4v4h-2v-4a2%202%200%200%201%202-2h4v2zm20-2a2%202%200%200%201%202%202v4h-2v-4h-4v-2zm-20%2018v4h4v2h-4a2%202%200%200%201%20-2-2v-4zm20%204v-4h2v4a2%202%200%200%201%20-2%202h-4v-2z%22%2F%3E%3C%2Fsvg%3E"); }
  .icon--reaction { --svg: url("reaction.svg "); }
  .icon--refresh { --svg: url("refresh.svg "); }
  .icon--refresh--meta { --svg: url("refresh--meta.svg "); }
  .icon--remove { --svg: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M22.664%205.578a1.5%201.5%200%200%200%200-2.121l-2.121-2.121a1.5%201.5%200%200%200-2.122%200l-6.244%206.245a.25.25%200%200%201-.354%200L5.579%201.336a1.5%201.5%200%200%200-2.122%200L1.336%203.457a1.5%201.5%200%200%200%200%202.121l6.245%206.245a.25.25%200%200%201%200%20.354l-6.245%206.245a1.5%201.5%200%200%200%200%202.121l2.121%202.121a1.5%201.5%200%200%200%202.122%200l6.244-6.245a.25.25%200%200%201%20.354%200l6.244%206.245a1.5%201.5%200%200%200%202.122%200l2.121-2.121a1.5%201.5%200%200%200%200-2.121l-6.245-6.245a.25.25%200%200%201%200-.354z%22%2F%3E%3C%2Fsvg%3E"); }
  .icon--rename { --svg: url("rename.svg "); }
  .icon--search { --svg: url("data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2024%2024%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22m23.414%2020.591-4.645-4.645a10.256%2010.256%200%201%200%20-2.828%202.829l4.645%204.644a2.025%202.025%200%200%200%202.828%200%202%202%200%200%200%200-2.828zm-13.164-17.586a7.25%207.25%200%201%201%20-7.25%207.25%207.258%207.258%200%200%201%207.25-7.25z%22%2F%3E%3C%2Fsvg%3E"); }
  .icon--settings { --svg: url("settings.svg "); }
  .icon--share { --svg: url("share.svg "); }
  .icon--sliders { --svg: url("sliders.svg "); }
  .icon--sun { --svg: url("sun.svg "); }
  .icon--switch { --svg: url("switch.svg "); }
  .icon--tag { --svg: url("tag.svg "); }
  .icon--tag-outline { --svg: url("tag-outline.svg "); }
  .icon--thumb-up { --svg: url("thumb-up.svg "); }
  .icon--trash { --svg: url("data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2024%2024%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%3E%3Cpath%20d%3D%22m1.5%204.5h21%22%2F%3E%3Cpath%20d%3D%22m14.25%201.5h-4.5-.00000007c-.828427.00000004-1.5.671573-1.5%201.5v1.5h7.5v-1.5c0-.828427-.671573-1.5-1.5-1.5z%22%2F%3E%3Cpath%20d%3D%22m9.75%2017.25v-7.5%22%2F%3E%3Cpath%20d%3D%22m14.25%2017.25v-7.5%22%2F%3E%3Cpath%20d%3D%22m18.865%2021.124.00000001-.00000017c-.0645133.777732-.714596%201.37607-1.495%201.376h-10.739-.00000007c-.780403.00006974-1.43049-.598268-1.495-1.376l-1.386-16.624h16.5z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); }
  .icon--unpinned { --svg: url("unpinned.svg"); }
  .icon--unseen { --svg: url("unseen.svg"); }
  .icon--world { --svg: url("world.svg"); }
  .icon--youtube { --svg: url("youtube.svg"); }
}

@layer components {
  .btn {
    --icon-size: var(--btn-icon-size, 1.3em);
    --btn-border-radius: 99rem;
    --btn-hover-brightness: 0.9;

    align-items: center;
    background-color: var(--btn-background, var(--color-canvas));
    border-radius: var(--btn-border-radius);
    border: var(--btn-border-size, 1px) solid var(--btn-border-color, var(--color-ink-light));
    color: var(--btn-color, var(--color-ink));
    cursor: pointer;
    display: inline-flex;
    font-size: 1em;
    font-weight: var(--btn-font-weight, 600);
    gap: var(--btn-gap, 0.5em);
    justify-content: center;
    padding: var(--btn-padding, 0.5em 1.1em);
    pointer-events: auto;
    position: relative;
    text-decoration: none;
    transition: 100ms ease-out;
    transition-property: background-color, border, box-shadow, color, opacity, scale;

    @media (any-hover: hover) {
      &:hover {
        filter: brightness(var(--btn-hover-brightness));
      }
    }

    html[data-theme="dark"] & {
      --btn-hover-brightness: 1.25;
    }

    @media (prefers-color-scheme: dark) {
      html:not([data-theme]) & {
        --btn-hover-brightness: 1.25;
      }
    }

    &[disabled],
    &:has([disabled]),
    [disabled] &[type=submit],
    &[type=submit]:disabled {
      cursor: not-allowed;
      opacity: 0.3;
      pointer-events: none;
    }

    form[aria-busy] &:disabled {
      position: relative;

      > * {
        visibility: hidden;
      }

      &::after {
        --mask: no-repeat radial-gradient(#000 68%,#0000 71%);
        --size: 1.25em;

        -webkit-mask: var(--mask), var(--mask), var(--mask);
        -webkit-mask-size: 28% 45%;
        animation: submitting 1s infinite linear;
        aspect-ratio: 8/5;
        background: currentColor;
        content: "";
        inline-size: var(--size);
        inset: 50%;
        margin-block: calc((var(--size) / 3) * -1);
        margin-inline: calc((var(--size) / 2) * -1);
        position: absolute;
      }
    }
  }

  /* Variants
  /* ------------------------------------------------------------------------ */

  .btn--plain {
    --btn-background: transparent;
    --btn-border-radius: 0;
    --btn-border-size: 0;
    --btn-color: inherit;
    --btn-icon-size: 100%;
    --btn-padding: 0;
  }

  .btn--link {
    --btn-background: var(--color-link);
    --btn-border-color: var(--color-canvas);
    --btn-color: var(--color-ink-inverted);
    --focus-ring-color: var(--color-link);
  }

  .btn--circle,
  .btn[aria-label]:where(:has(.icon)),
  .btn:where(:has(.for-screen-reader):has(.icon)) {
    --btn-padding: 0;
    --icon-size: 75%;

    aspect-ratio: 1;
    block-size: var(--btn-size);
    display: grid;
    inline-size: var(--btn-size);
    justify-content: normal; /* FF fix */
    place-items: center;

    > * {
      grid-area: 1/1;
    }
  }

  /* Make a normal button circular on mobile */
  @media (max-width: 639px) {
    .btn--circle-mobile {
      --btn-size: 3em;
      --btn-padding: 0;
      --icon-size: 75%;

      aspect-ratio: 1;
      inline-size: var(--btn-size);

      kbd,
      span:last-of-type:not(.icon) {
        display: none;
      }
    }
  }

  @media (min-width: 640px) {
    .btn .icon--mobile-only {
      display: none !important;
    }
  }

  .btn--negative {
    --btn-background: var(--color-negative);
    --btn-border-color: var(--color-negative);
    --btn-color: var(--color-ink-inverted);
    --focus-ring-color: var(--color-negative);
  }

  .btn--positive {
    --btn-background: var(--color-positive);
    --btn-border-color: var(--color-canvas);
    --btn-color: var(--color-ink-inverted);
    --focus-ring-color: var(--color-positive);
  }

  .btn--success {
    --success-timing-function: cubic-bezier(0.25, 1.25, 0.5, 1);
    animation: success 1s var(--success-timing-function);

    .icon {
      animation: zoom-fade 500ms var(--success-timing-function);
    }
  }

  /* Fake button used to help space things out */
  .btn--placeholder {
    pointer-events: none;
    visibility: hidden;
  }

  .btn--remove {
    --btn-icon-size: 0.7em;
  }

  .btn--reversed {
    --btn-background: var(--color-ink);
    --btn-border-color: var(--color-canvas);
    --btn-color: var(--color-canvas);
    --focus-ring-color: var(--color-ink);
  }

  /* Toggleable buttons
  /* ------------------------------------------------------------------------ */

  .btn {
    &:has(input[type=radio], input[type=checkbox]) {
      position: relative;

      :is(input[type=radio], input[type=checkbox]) {
        appearance: none;
        border-radius: var(--btn-border-radius);
        cursor: pointer;
        display: flex;
        inset: 0;
        margin: 0;
        padding: 0;
        position: absolute;

        &:focus-visible {
          outline: none;
        }
      }

      .checked {
        display: none;
      }
    }

    &:has(input:checked)  {
      --btn-background: var(--color-ink);
      --btn-border-color: var(--color-ink);
      --btn-color: var(--color-ink-inverted);
      --focus-ring-color: var(--color-ink);

      .checked {
        display: block;
      }
    }

    &:has(input:focus-visible)  {
      outline: var(--focus-ring-size) solid var(--focus-ring-color);
      outline-offset: var(--focus-ring-offset);
    }
  }

  .btn--back {
    --btn-border-size: 0;

    @media (max-width: 639px) {
      strong, kbd {
        display: none;
      }
    }

    @media (min-width: 640px) {
      font-size: var(--text-medium);

      .icon--arrow-left {
        display: none;
      }
    }
  }


  /* Button groups
  /* ------------------------------------------------------------------------ */

  .btn__group {
    .btn {
      --btn-border-radius: 0;
      --radius: 0.3em;

      flex: 1 0 33%;
      inline-size: 100%;
      justify-content: center;
      white-space: nowrap;
    }

    form {
      flex: 1 1 0%;
    }

    :first-of-type .btn {
      border-end-start-radius: var(--radius);
      border-inline-end: 0;
      border-start-start-radius: var(--radius);
      padding-inline-end: 0.8em;
    }

    :last-of-type .btn {
      border-end-end-radius: var(--radius);
      border-inline-start: 0;
      border-start-end-radius: var(--radius);
      padding-inline-start: 0.8em;
    }

    span {
      inline-size: 100%;
    }
  }

  /* Button utilities
  /* ------------------------------------------------------------------------ */

  :is([data-platform~=mobile], [data-platform~=native]) {
    .btn--ensure-tap-target-size {
      --tap-target-z-index: 1;
      --tap-target-min-size: 44px;

      z-index: var(--tap-target-z-index);

      &::before {
        content: "";
        display: block;
        block-size: var(--tap-target-min-size);
        inline-size: var(--tap-target-min-size);
        inset: calc(50% - var(--tap-target-min-size) / 2) auto auto calc(50% - var(--tap-target-min-size) / 2);
        opacity: 0;
        position: absolute;
      }
    }
  }
}

@layer components {
  /* Text inputs */
  .input {
    accent-color: var(--input-accent-color, var(--color-ink));
    background-color: var(--input-background, transparent);
    border-radius: var(--input-border-radius, 0.5em);
    border: var(--input-border-size, 1px) solid var(--input-border-color, var(--color-ink-medium));
    color: var(--input-color, var(--color-ink));
    font-size: max(16px, 1em);
    inline-size: 100%;
    line-height: inherit;
    max-inline-size: 100%;
    padding: var(--input-padding, 0.5em 0.8em);
    resize: none;

    &:autofill,
    &:-webkit-autofill,
    &:-webkit-autofill:hover,
    &:-webkit-autofill:focus {
      -webkit-text-fill-color: var(--color-ink);
      -webkit-box-shadow: 0 0 0px 1000px var(--color-selected) inset;
    }

    &:where(:focus) {
      --focus-ring-offset: -1px;
    }

    &[readonly] {
      --focus-ring-size: 0;
    }

    &[autocomplete='one-time-code'] {
      --input-spacing: 0.5em;

      font-family: var(--font-mono);
      font-size: var(--text-large);
      font-weight: 900;
      inline-size: 18ch;
      letter-spacing: 1ch;
      min-inline-size: 18ch;
      text-align: center;
    }

    &[type='number'] {
      &::-webkit-outer-spin-button,
      &::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
      }
    }

    /* Target mobile Safari only */
    @supports (hanging-punctuation: first) and (font: -apple-system-body) and (-webkit-appearance: none) {
      @media (hover: none) {
        font-size: max(16px, 1em) !important;
      }
    }
  }

  .input--file,
  .input--upload {
    cursor: pointer;

    &:has(input[type="file"]:focus-visible) {
      outline: 0.15rem solid var(--color-selected-dark);
    }

    input[type="file"] {
      --hover-size: 0;
      --input-border-color: transparent;
      --input-border-radius: 8px;

      block-size: 100%;
      cursor: pointer;
      font-size: 0;
      inline-size: 100%;
      overflow: clip;

      &::file-selector-button {
        appearance: none;
        cursor: pointer;
        opacity: 0;
      }
    }
  }

  .input--file {
    display: grid;
    inline-size: auto;
    place-items: center;

    > * {
      grid-area: 1 / 1;
    }

    img {
      border-radius: 0.4em;
    }

    &:is(.avatar) {
      input[type="file"] {
        border-radius: 50%;
      }
    }
  }

  .input--upload {
    --btn-border-color: var(--color-ink);
    --btn-border-radius: 1ch;

    border-style: dashed;
    position: relative;

    input[type="file"] {
      inset: 0;
      outline: none;
      position: absolute;
    }

    &:has([data-upload-preview-target="fileName"]:not([hidden])) {
      --btn-border-color: var(--color-positive);
      --btn-color: var(--color-positive);
    }
  }

  .input--select {
    --input-border-radius: 2em;
    --input-padding: 0.5em 1.8em 0.5em 1.2em;
    --caret-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12 19.5c-.7 0-1.3-.3-1.7-.8l-9.8-11.1c-.7-.8-.6-1.9.2-2.6.8-.6 1.9-.6 2.5.2l8.6 9.8c0 .1.2.1.4 0l8.6-9.8c.7-.8 1.8-.9 2.6-.2s.9 1.8.2 2.6l-9.8 11.1c-.4.5-1.1.8-1.7.8z' fill='%23000'/%3E%3C/svg%3E");
    --caret-icon-dark: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12 19.5c-.7 0-1.3-.3-1.7-.8l-9.8-11.1c-.7-.8-.6-1.9.2-2.6.8-.6 1.9-.6 2.5.2l8.6 9.8c0 .1.2.1.4 0l8.6-9.8c.7-.8 1.8-.9 2.6-.2s.9 1.8.2 2.6l-9.8 11.1c-.4.5-1.1.8-1.7.8z' fill='%23fff'/%3E%3C/svg%3E");

    -webkit-appearance: none;
    appearance: none;
    background-image: var(--caret-icon);
    background-size: 0.5em;
    background-position: center right 0.9em;
    background-repeat: no-repeat;
    text-align: start;

    html[data-theme="dark"] & {
      --caret-icon: var(--caret-icon-dark);
    }

    @media (prefers-color-scheme: dark) {
      html:not([data-theme]) & {
        --caret-icon: var(--caret-icon-dark);
      }
    }

    option {
      background-color: var(--color-canvas);
      color: var(--color-ink);
    }
  }

  .input--blank {
    --input-border-color: var(--color-ink-dark);
    --input-border-radius: 0;
    --input-padding: 0 0.25em;

    border-style: dotted;
    border-width: 0 0 var(--input-border-size, 1px);
    inline-size: auto;
    line-height: 1.2;
    vertical-align: baseline;

    &.input--select {
      --input-padding: 0 1.4em 0 0.25em;

      background-position: center right 0.25em;
    }
  }

  .input--textarea {
    --input-padding: 0;

    line-height: inherit;
    min-block-size: calc(3lh + (2 * var(--input-padding)));
    min-inline-size: 100%;
    padding-block: var(--input-padding);
    padding-inline: calc(var(--input-padding) + calc((1lh - 1ex) / 2));

    @supports (field-sizing: content) {
      field-sizing: content;
      max-block-size: calc(3lh + (2 * var(--input-padding)));
      min-block-size: calc(1lh + (2 * var(--input-padding)));
    }
  }

  .input--invisible {
    background-color: transparent;
    block-size: 5px;
    border: none;
    inline-size: 5px;
    opacity: 0.1;

    &:focus {
      outline: none;
    }
  }

  /* Switches */
  .switch {
    --switch-color: var(--color-ink-medium);
    --switch-hover-brightness: 0.9;

    block-size: 1.75em;
    border-radius: 2em;
    display: inline-flex;
    inline-size: 3em;
    position: relative;

    &:has(:focus-visible) {
      .switch__btn {
        outline: var(--focus-ring-size) solid var(--focus-ring-color);
      }
    }
  }

  .switch__input {
    block-size: 0;
    inline-size: 0;
    opacity: 0.1;
  }

  .switch__btn {
    background-color: var(--switch-color);
    border-radius: 2em;
    cursor: pointer;
    inset: 0;
    outline-offset: var(--focus-ring-offset);
    position: absolute;
    transition: 150ms ease;

    &::before {
      background-color: var(--color-ink-inverted);
      block-size: 1.35em;
      border-radius: 50%;
      content: "";
      inline-size: 1.35em;
      inset-block-end: 0.2em;
      inset-inline-start: 0.2em;
      position: absolute;
      transition: 150ms ease;
    }

    @media (any-hover: hover) {
      &:hover {
        background-color: color-mix(in srgb, var(--switch-color) 80%, var(--color-ink));
      }
    }

    .switch__input:checked + & {
      --switch-color: var(--color-link);

      &::before {
        transform: translateX(1.2em);
      }
    }

    .switch__input:disabled + & {
      --switch-color: var(--color-ink-medium);

      cursor: not-allowed;
      opacity: 0.5;
    }
  }

  /* Containers that act like (and contain) inputs */
  .input--actor {
    outline-offset: -1px;
    transition: box-shadow 150ms ease, outline-offset 150ms ease;

    &:focus-within {
      --input-border-color: var(--color-selected-dark);

      outline: var(--focus-ring-size) solid var(--focus-ring-color);
    }

    .input {
      --input-padding: 0;
      --input-border-radius: 0;
      --input-background: transparent;
      --input-border-size: 0;

      inline-size: 100%;
      outline: 0;
    }

    &:has(.input:is(
      :autofill,
      :-webkit-autofill,
      :-webkit-autofill:hover,
      :-webkit-autofill:focus)) {
        -webkit-text-fill-color: var(--color-text);
        -webkit-box-shadow: 0 0 0px 1000px var(--color-selected) inset;
    }
  }

  .input--hidden {
    block-size: 0;
    inline-size: 0;
    opacity: 0;
    padding: 0;
  }

  .input.boost__input {
    --input-border-radius: 0;
    --input-border-size: 0;
    --input-padding: 0;

    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    inline-size: min-content;
    max-inline-size: 3ch;
    min-inline-size: 1ch;
    outline: none;

    @supports (field-sizing: content) {
      field-sizing: content;
      max-inline-size: unset;
    }

    &:focus {
      background-color: var(--color-highlight);
    }

    &::-webkit-outer-spin-button,
    &::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }
  }

  /* Checkboxes */
  .checkbox {
    appearance: none;
    background-color: var(--color-canvas);
    block-size: 1.1em;
    border: 1px solid currentColor;
    border-radius: 0.15em;
    color: currentColor;
    display: grid;
    font: inherit;
    inline-size: 1.1em;
    margin: 0;
    place-content: center;
    transform: translateY(0.1em);

    &::before {
      background-color: CanvasText;
      block-size: 0.65em;
      box-shadow: inset 1em 1em currentColor;
      clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
      content: "";
      inline-size: 0.65em;
      transform: scale(0);
      transform-origin: center;
      transition: 150ms transform ease-in-out;
    }

    &:checked::before {
      transform: scale(1) rotate(10deg);
    }

    &:where([disabled]):not(:hover):not(:active) {
      filter: none;
      opacity: 0.5;
    }
  }
}

@layer components {
  :root {
    --color-success: oklch(var(--lch-green-dark));
    --color-info: oklch(var(--lch-blue-dark));
    --color-warning: oklch(var(--lch-yellow-dark));
    --color-error: oklch(var(--lch-red-dark));

    --color-success-text: oklch(var(--lch-green-darker));
    --color-info-text: oklch(var(--lch-blue-darker));
    --color-warning-text: oklch(var(--lch-yellow-darker));
    --color-error-text: oklch(var(--lch-red-darker));

    --color-success-button: oklch(var(--lch-green-dark));
    --color-error-button: oklch(var(--lch-red-dark));

    /* A warning as a ground, a step darker than the scale's so white on it reads at 4.5:1. Dark mode's sits under dark ink and already does. */
    --color-warning-filled: oklch(57% 0.156 60);
  }

  html[data-theme="dark"] {
    --color-warning-filled: var(--color-warning);
  }

  @media (prefers-color-scheme: dark) {
    html:not([data-theme]) {
      --color-warning-filled: var(--color-warning);
    }
  }

  .status {
    --status-color: var(--color-ink-dark);
    --status-text: var(--color-ink-dark);
    font-size: var(--text-small);
    color: var(--status-text);
    font-weight: 600;
    white-space: nowrap;
  }

  .status--success {
    --status-color: var(--color-success);
    --status-text: var(--color-success-text);
  }

  .status--info {
    --status-color: var(--color-info);
    --status-text: var(--color-info-text);
  }

  .status--warning {
    --status-color: var(--color-warning);
    --status-text: var(--color-warning-text);
  }

  .status--error {
    --status-color: var(--color-error);
    --status-text: var(--color-error-text);
  }

  .status--neutral {
    --status-color: var(--color-ink-dark);
    --status-text: var(--color-ink-dark);
  }

  .status--badge {
    padding: 0.25em 0.7em;
    border-radius: var(--radius-md);
    font-size: var(--text-small);
    background-color: color-mix(in oklch, var(--status-color) 14%, transparent);
  }

  /* The quiet ink on a tint of itself falls under 4.5:1. As a plain word it stays as quiet as its neighbours. */
  .status--badge.status--neutral,
  .status--badge.status--muted {
    --status-text: var(--color-ink-darker);
  }

  /* A verdict that has to be read at a glance: the status colour becomes the ground, and the
     only status still said in capitals. */
  .status--filled {
    padding: 0.35em 0.8em;
    border-radius: var(--radius-lg);
    font-size: var(--text-small);
    font-weight: 800;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: var(--color-ink-inverted);
    background-color: var(--status-color);
  }

  .status--filled.status--warning {
    --status-color: var(--color-warning-filled);
  }

  /* As the filled warning's ground: a step darker in light mode only. */
  .status--filled.status--error {
    --status-color: oklch(57% 0.19 38);

    html[data-theme="dark"] & {
      --status-color: var(--color-error);
    }

    @media (prefers-color-scheme: dark) {
      html:not([data-theme]) & {
        --status-color: var(--color-error);
      }
    }
  }

  /* White on the badge's quieter grey would not read. */
  .status--filled.status--muted {
    --status-color: var(--color-ink-dark);
  }

  .status--stamp {
    display: inline-block;
    rotate: -1.5deg;
  }

  /* A state that is off, said in a quieter colour. Never struck through: a line through
     "Unblocked" reads as the negation of the word, which is the opposite of what it says. */
  .status--muted {
    --status-color: var(--color-ink-medium);
    --status-text: var(--color-ink-dark);
  }

  /* A date on a page, said quietly. Never a status: it has no colour of its own. */
  .chip {
    --icon-size: 1em;

    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.15em 0.6em;
    border-radius: var(--radius-md);
    background-color: var(--tint-ink-5);
    color: var(--color-ink-darker);
    font-size: var(--text-small);
    font-weight: 400;
    line-height: 1.3;
    white-space: nowrap;
  }

  /* A chip that opens the field it prints, with that field focused. */
  .chip--link {
    color: var(--color-ink);
    text-decoration: none;
    transition: background-color var(--duration-medium) var(--ease-out-expo);

    @media (any-hover: hover) {
      &:hover {
        background-color: var(--tint-ink-10);
      }
    }
  }
}

@layer utilities {
  .txt-warning { color: color-mix(in oklch, var(--color-warning), var(--color-ink) 25%); }
}

@layer components {
  /* On the page a list is a card of its own. Inside a surface that already is one, it is ruled lines. */
  :is(.panel, .record, .project__sheet, .tool__panel, .paper__section, .suggestions__list, .messages-sidebar__pane),
  .rows .rows {
    --rows-border-radius: 0;
    --rows-shadow: none;
    --rows-side-size: 0;
  }

  .rows {
    --row-padding-inline: calc(var(--inline-space) * 1.5);
    --rows-corner: max(0px, calc(var(--rows-border-radius, 1em) - var(--rows-border-size, 1px)));

    list-style: none;
    margin-block: var(--rows-margin, var(--block-space));
    padding: 0;
    background-color: var(--rows-bg, var(--color-canvas));
    border: solid var(--color-ink-lighter);
    border-width: var(--rows-border-size, 1px) var(--rows-side-size, var(--rows-border-size, 1px));
    border-radius: var(--rows-border-radius, 1em);
    box-shadow: var(--rows-shadow, var(--shadow));

    &:not(:has(.row:not([hidden]))) {
      --rows-bg: transparent;
      --rows-border-size: 0;
      --rows-shadow: none;
    }

    /* A list within has no corner to take, so the card cuts what it holds, except a floating suggestions list. */
    &:has(.rows):not(:has(.suggestions__list)) {
      overflow: hidden;
    }

    @media print {
      --rows-border-size: 0;
      --rows-shadow: none;
    }
  }

  .rows__heading {
    margin: 0;
    padding-inline: calc(var(--inline-space) * 1.5);

    + .rows {
      margin-block-start: var(--block-space-half);
    }
  }

  /* Rows that lead to another list are not what a filter searches, so they go while one is typed. */
  [data-filtering] .rows--links {
    display: none;
  }

  /* :has cannot sit inside :has, so the heading goes with its section when a filter leaves no row in it. */
  .rows__section:not(:has(.row:not([hidden]))) {
    display: none;
  }

  .row {
    --row-padding-block: calc(var(--block-space-half) * 0.75);

    display: flex;
    align-items: center;
    gap: var(--inline-space);
    margin: 0;
    padding-inline: var(--row-padding-inline);
    line-height: var(--leading-snug);
    outline: none;

    &[aria-selected="true"] {
      background-color: var(--color-ink-lightest);
    }

    @media (any-hover: hover) {
      &:has(> a.row__body:hover, > form > button.row__body:hover) {
        background-color: var(--color-ink-lightest);
      }
    }

    /* A title alone keeps the half block, or its row would be little more than the line. */
    &:where(:not(:has(.row__meta:not(:empty)))) {
      --row-padding-block: var(--block-space-half);
    }

    &[hidden] {
      display: none;
    }
  }

  /* A row has no corner of its own: its ground runs edge to edge, and the rows at the ends take the card's. */
  .rows > :nth-child(1 of :not([hidden])) {
    border-start-start-radius: var(--rows-corner);
    border-start-end-radius: var(--rows-corner);
  }

  .rows > :nth-last-child(1 of :not([hidden])) {
    border-end-start-radius: var(--rows-corner);
    border-end-end-radius: var(--rows-corner);
  }

  /* A rule between two rows, and none over the first one a filter leaves in view. */
  .row:not([hidden]) ~ .row {
    border-block-start: var(--border);
  }

  /* A list has no end, so its rows are not all named for the view transition: only the one under the pointer
     or holding the focus is, which is the one being opened. It says its own name in --row-transition-name. */
  .row:is(:hover, :focus-within) {
    view-transition-name: var(--row-transition-name, none);
  }

  /* A group of rows inside a list, under a header of its own. */
  .rows__group {
    --rows-margin: 0;

    padding-block-end: var(--block-space-half);
  }

  .rows__group-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--inline-space-half) var(--inline-space);
    padding: var(--block-space-half) var(--row-padding-inline);
  }

  .rows__group-title {
    flex: 1 1 auto;
    min-inline-size: 0;
  }

  /* A row under the one above it, as a subcontractor under the firm that hired it. */
  .row--nested {
    padding-inline-start: calc(var(--row-padding-inline) + var(--depth, 0) * var(--inline-space-double));
  }

  /* What a nested row hangs from. Typing in the filter can leave the row without the one above it, so the indent
     goes and the row says it. */
  .row__meta--nested {
    display: none;
  }

  [data-filtering] {
    .row--nested[data-quick-find-target~="item"] {
      padding-inline-start: var(--row-padding-inline);
    }

    .row__meta--nested {
      display: block;
    }
  }

  /* A form opened in place under a row, indented as the rows it adds. */
  .rows__form {
    padding-inline: calc(var(--row-padding-inline) + var(--depth, 0) * var(--inline-space-double)) var(--row-padding-inline);
  }

  .row--inactive {
    color: var(--color-ink-dark);
  }

  .row__body {
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
    min-width: 0;
    padding-block: var(--row-padding-block);
    color: inherit;
    text-decoration: none;

    &:last-child {
      flex-grow: 1;
    }
  }

  button.row__body {
    align-items: stretch;
    background: none;
    border: 0;
    border-radius: 0;
    font-weight: inherit;
    padding-inline: 0;
    text-align: start;

    &:enabled:hover {
      background: none;
    }
  }

  .row__title,
  .row__meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .row__title {
    font-weight: normal;
  }

  .row__meta {
    color: var(--color-ink-dark);
    font-size: var(--text-small);
    line-height: 1.2;
  }

  .row__title--wrap,
  .row__meta--wrap {
    overflow: visible;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  /* A state said in the meta line is the meta's size, whatever the list sets it to. */
  .row__meta .status {
    font-size: inherit;
  }

  .row__end {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: var(--inline-space);
    color: var(--color-ink-dark);
    font-size: var(--text-small);
    white-space: nowrap;
  }

  /* A row's end that stacks its lines, flush with the row's edge. */
  .row__end--stacked {
    align-items: flex-end;
    flex-direction: column;
    font-variant-numeric: tabular-nums;
    gap: 0.2em;
  }
}

@layer components {
  .separator {
    block-size: 100%;
    border-block: 0;
    border-inline-end: 0;
    border-inline-start: var(--border-size, 1px) var(--border-style, solid) var(--border-color, currentColor);
    display: inline-flex;
    inline-size: 0;
  }

  .separator--horizontal {
    block-size: 0;
    border-block-end: 0;
    border-block-start: var(--border-size, 1px) var(--border-style, solid) var(--border-color, currentColor);
    border-inline: 0;
    display: flex;
  }
}

@layer components {
  .panel {
    background-color: var(--panel-bg, var(--color-canvas));
    border: var(--panel-border-size, 1px) solid var(--panel-border-color, var(--color-ink-lighter));
    border-radius: var(--panel-border-radius, 1em);
    color: var(--color-ink);
    inline-size: var(--panel-size, 60ch);
    max-inline-size: 100%;
    padding: var(--panel-padding, var(--block-space));

    @media (min-width: 640px) {
      --panel-size: 100%;

      padding: var(--panel-padding, var(--block-space-double));
    }
  }

  .panel--wide {
    --panel-size: 60ch;
  }

  .panel--centered {
    --panel-border-size: 0;
    --panel-size: 100%;

    @media (min-width: 640px) {
      --panel-size: 42ch;
    }

    #main:has(&) {
      display: grid;
      justify-content: center;
      margin: auto;
    }
  }
}

@layer components {
  /* Suggestions float over what follows the field instead of pushing it down. */
  .suggestions {
    position: relative;
  }

  /* A turbo-frame is display: contents by default, which would leave nothing to position. */
  .suggestions__list {
    --rows-border-size: 0;

    display: block;
    position: absolute;
    inset-block-start: 100%;
    inset-inline: 0;
    z-index: var(--z-popup);
    max-block-size: 60vh;
    overflow-y: auto;
    background-color: var(--color-canvas);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);

    &:not(:has(.row:not([hidden]))) {
      display: none;
    }

    [data-filtering] &:has(.suggestions__skeleton) {
      display: block;
    }
  }

  .suggestions__skeleton {
    padding: var(--block-space-half) var(--inline-space-double);

    > * + * {
      margin-block-start: var(--block-space-half);
    }

    /* The hairline's ink is too faint on the white list in light mode. */
    .skeleton {
      background-color: light-dark(var(--tint-ink-20), var(--color-ink-light));
    }
  }

  /* What to do with the text when nothing suggested matches it, offered once something is typed. Flush with the
     search above it. */
  .suggestions__fallback {
    display: none;

    [data-filtering]:not([data-has-match]) &,
    &[open] {
      display: block;
    }

    > .btn {
      inline-size: fit-content;
      list-style: none;
    }
  }

  .suggestions__typed {
    display: none;

    [data-filtering] & {
      display: inline;
    }
  }

  [data-filtering] .suggestions__untyped {
    display: none;
  }

  /* A firm hired in place: a search over the register, or a new firm's fields. */
  .hire {
    display: flex;
    flex-direction: column;
    gap: var(--block-space-half);
    padding-block: var(--block-space-half);
  }

  .hire__search {
    align-items: center;
    display: flex;
    gap: var(--inline-space-half);

    > .suggestions {
      flex: 1 1 auto;
      min-inline-size: 0;
    }
  }

  .hire__form {
    display: flex;
    flex-direction: column;
    gap: var(--block-space);
    margin-block-start: var(--block-space);
  }

  /* Country, CUIT and name on one row, stacked on a phone. */
  .hire__fields {
    display: flex;
    flex-direction: column;
    gap: var(--block-space-half) var(--inline-space);

    .input {
      inline-size: 100%;
    }

    @media (width >= 640px) {
      flex-direction: row;

      > :nth-child(1) {
        flex: 0 0 9rem;
      }

      > :nth-child(2) {
        flex: 0 1 14rem;
      }

      > :nth-child(3) {
        flex: 1 1 0;
        min-inline-size: 0;
      }
    }
  }
}

@layer components {
  /* Prevent page scrolling when modal dialog is open */
  html:has(dialog:modal) {
    overflow: hidden;
  }

  :is(.dialog) {
    border: 0;
    opacity: 0;
    transform: scale(0.85);
    transform-origin: center;
    transition-behavior: allow-discrete;
    transition-duration: calc(var(--dialog-duration) / 2); /* Faster closing */
    transition-property: display, opacity, overlay, transform;
    transition-timing-function: ease-out;

    &::backdrop {
      background-color: var(--color-black);
      opacity: 0;
      transition-behavior: allow-discrete;
      transition-duration: calc(var(--dialog-duration) / 2);
      transition-property: display, opacity, overlay;
      transition-timing-function: ease-out;
    }

    &[open] {
      opacity: 1;
      transform: scale(1);
      transition-duration: var(--dialog-duration); /* Normal opening speed */

      &::backdrop {
        opacity: 0.5;
        transition-duration: var(--dialog-duration);
      }
    }

    @starting-style {
      &[open] {
        opacity: 0;
        transform: scale(0.85);
      }

      &[open]::backdrop {
        opacity: 0;
      }
    }
  }

  /* Ensure padding from viewport edges */
  .dialog.panel {
    max-inline-size: calc(100vw - var(--inline-space-double) * 2);
  }
}

/* Styles for the blank slate. To manage when they are shown/hidden, do so in context */

@layer components {
  .blank-slate {
    border-radius: 0.5ch;
    border: 2px dashed var(--color-ink-lighter);
    color: var(--color-ink-dark);
    font-weight: 500;
    margin-block-start: 2dvh;
    padding: 1.5ch 2ch;
    rotate: -3deg;
  }

  .blank-slate--drag {
    background-color: color-mix(in srgb, transparent, var(--card-color) 5%);
    border-color: color-mix(in srgb, transparent, var(--card-color) 10%);
    color: color-mix(in srgb, transparent, var(--card-color) 75%);
    margin-block-start: 0;
    rotate: 0deg;
  }
}

@layer components {
  .breadcrumbs {
    align-items: center;
    display: flex;
    font-size: var(--text-medium);
    font-weight: 700;
    gap: var(--header-gap, var(--inline-space-half));
    margin-inline: auto;
    min-width: 0;

    > * {
      flex-shrink: 1;
      max-inline-size: 40ch;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    /* Room goes to the page's own crumb first, then the section after home, and a long crumb between them takes what is left.
       Growing from zero instead of shrinking keeps a crumb that fits free of even a fraction of a pixel's ellipsis.
       The section after home grows from 6ch, or a long page name leaves it a sliver. */
    > :where(a:not(.breadcrumbs__home), strong) {
      flex: 1 1 0;
      max-inline-size: max-content;
      min-inline-size: 2em;
    }

    > a {
      color: var(--color-ink);
    }

    > .breadcrumbs__home + .breadcrumbs__separator + a {
      flex-basis: 6ch;
      flex-grow: 100;
      min-inline-size: 0;
    }

    > strong {
      color: var(--color-link);
      flex-grow: 10000;
      min-inline-size: 0;

      &[role="button"] {
        cursor: pointer;
      }

      &:focus-visible {
        outline: 2px solid var(--color-link);
        outline-offset: 1px;
      }
    }

    &.breadcrumbs--expanded > strong {
      max-inline-size: none;
      overflow: visible;
      overflow-wrap: anywhere;
      white-space: normal;
    }

    > .breadcrumbs__separator {
      flex-shrink: 0;
    }

    > .breadcrumbs__home {
      --icon-size: 1.15em;

      align-items: center;
      display: inline-flex;
      flex-shrink: 0;
    }
  }
}

@layer components {
  /* A zero floor, so a long file name in a value never widens the sheet past its edge. */
  .details {
    display: grid;
    gap: var(--block-space);
    grid-template-columns: minmax(0, 1fr);
    margin-block: var(--block-space);
  }

  .details__row {
    display: grid;
    gap: 0.125rem;
    grid-template-columns: minmax(0, 1fr);
  }

  .details__label {
    font-size: var(--text-small);
    font-weight: 600;
    color: var(--color-ink-dark);
  }

  .details__value {
    overflow-wrap: anywhere;
  }

  .details--columns {
    gap: 0;
    margin-block: 0;

    .details__row {
      grid-template-columns: 9rem 1fr;
      align-items: baseline;
      gap: var(--inline-space-double);
      padding-block: var(--block-space-half);

      @media (width < 640px) {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.125rem;
      }
    }

    > :last-child {
      padding-block-end: 0;
    }
  }

  /* Label and value flush on what holds them, a hairline over each row and under the last. */
  .details--lined {
    .details__row {
      grid-template-columns: 6.5rem minmax(0, 1fr);
      gap: var(--inline-space-double);
      padding-block: var(--block-space-half);
      border-block-start: var(--border);

      @media (width < 640px) {
        grid-template-columns: 5.5rem minmax(0, 1fr);
      }

      &:last-child {
        border-block-end: var(--border);
      }
    }

    a {
      color: inherit;
      text-decoration-color: var(--color-ink-light);
      text-underline-offset: 0.15em;
    }
  }

  .details__values {
    display: grid;
    gap: var(--block-space-half);
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .details__heading {
    display: grid;
    gap: 0.25rem;
    min-inline-size: 0;
  }

  .details__meta {
    margin: 0;
    color: var(--color-ink-dark);
  }
}

@layer components {
  .record {
    --rows-bg: var(--color-ink-lightest);

    background-color: var(--color-canvas);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: var(--block-space);
    margin-block-end: var(--block-space);
    padding: var(--block-space-double);

    @media (width < 640px) {
      padding: var(--block-space);
    }

    @media print {
      background: none;
      border: none;
      box-shadow: none;
      padding: 0;
    }

    @media (width >= 800px) {
      padding-inline: calc(var(--block-space-double) + var(--block-space));
    }

    /* The list is named: rows.css sorts later and sets a margin of its own. */
    > *,
    > .rows {
      margin-block: 0;
    }
  }

  .record__header {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: var(--block-space-half);
    min-inline-size: 0;
    text-align: center;
  }

  .record__title {
    font-size: var(--text-large);
    font-weight: 800;
    letter-spacing: -0.024em;
    line-height: 1.15;
    margin: 0;
    overflow-wrap: anywhere;
    text-wrap: balance;

    @media (width >= 640px) {
      font-size: var(--text-x-large);
    }
  }

  .record__byline {
    --avatar-size: 1.5rem;

    align-items: center;
    color: var(--color-ink-dark);
    display: flex;
    flex-wrap: wrap;
    font-size: var(--text-small);
    gap: var(--inline-space-half);
    justify-content: center;
    margin: 0;
    overflow-wrap: anywhere;

    .record__byline-name {
      color: var(--color-ink);
    }

    .avatar {
      font-size: var(--text-xx-small);
    }
  }

  /* Fields the sheet no longer takes: what they hold stays readable, and they are plainly shut. */
  .record__fields:disabled .input {
    --input-background: var(--color-ink-lightest);
    --input-border-color: var(--color-ink-lightest);
    --input-color: var(--color-ink-dark);

    cursor: not-allowed;

    &::placeholder {
      color: transparent;
    }
  }

  .same-file__summary {
    cursor: pointer;

    .same-file[open] > & {
      margin-block-end: var(--block-space-half);
    }
  }

  .same-file__count {
    color: var(--color-link);
    text-decoration: underline;
  }

  .same-file__caret {
    font-size: 1ch;
    rotate: -90deg;
    transition: rotate var(--duration-medium) ease-out;

    .same-file[open] & {
      rotate: 0deg;
    }
  }

  /* The sheet is the only container: what it holds sits straight on it, set apart by space and hairlines,
     never by a second fill. */
  .record:not(.record--boxed) {
    /* A row can sit in a turbo-frame of its own, so each row draws the line over it and the list closes the last. */
    .rows:not(.library__rows, .suggestions__list *) {
      background: none;
      border: 0;

      &:has(.row:not([hidden]), .rows__form) {
        border-block-end: var(--border);
      }

      :is(&, & > turbo-frame) > :is(.row, .rows__form) {
        border-radius: 0;
        padding-inline: calc(var(--depth, 0) * var(--inline-space-double)) 0;
      }

      :is(&, & > turbo-frame) > .row,
      :is(&, & > turbo-frame) > .rows__form:has(> :not(turbo-frame), > turbo-frame > *) {
        border-block-start: var(--border);
      }

      /* The fill reaches past the lines, so the text and the buttons at a row's ends keep their air. */
      @media (any-hover: hover) {
        :is(&, & > turbo-frame) > .row:has(> a.row__body:hover, > form > button.row__body:hover) {
          box-shadow: calc(-1 * var(--inline-space)) 0 var(--color-ink-lightest), var(--inline-space) 0 var(--color-ink-lightest);
        }
      }

      .step__editor {
        border: 0;
        margin-inline: 0;
        padding-inline: 0;
      }
    }

    .library__rows {
      background: none;
      margin-block: 0;
      padding: 0;
    }

    .library__row {
      gap: var(--inline-space);
      padding-inline: 0;

      &:first-child {
        padding-block-start: 0;
      }

      &:last-child {
        padding-block-end: 0;
      }
    }

    .library__thumb {
      justify-items: start;
    }
  }

  /* What an answer has to meet, as lines on the sheet: a quiet dot, or the reading's mark over its evidence. */
  .conditions {
    --icon-size: 1.25em;

    display: flex;
    flex-direction: column;
    font-size: var(--text-small);
    gap: var(--block-space-half);
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .conditions__line {
    align-items: start;
    display: flex;
    gap: var(--inline-space);

    .conditions__title {
      font-weight: 600;
    }

    .icon {
      margin-block-start: calc((1lh - var(--icon-size)) / 2);
    }
  }

  .conditions__line--unmet .conditions__title {
    color: var(--color-error-text);
  }

  .conditions__dot {
    background-color: var(--color-ink-medium);
    block-size: 0.3em;
    border-radius: 50%;
    flex: none;
    inline-size: 0.3em;
    margin: calc((1lh - 0.3em) / 2) calc((var(--icon-size) - 0.3em) / 2) 0;
  }

  .conditions__body {
    display: flex;
    flex-direction: column;
    min-inline-size: 0;
    overflow-wrap: anywhere;
  }

  .record--stacked {
    inline-size: 100%;
    margin-block-end: 0;
    min-inline-size: 0;

    /* The panel spaces what it holds, so nothing inside stacks its own margins on top of that gap. */
    :is(.rows, .details) {
      margin-block: 0;
    }

    > .btn {
      align-self: start;
    }
  }

  /* The sheet reads from the left edge: its title, badge and sentences line up with what follows them. */
  .record--start {
    .record__header {
      align-items: start;
      text-align: start;
    }

    .record__byline {
      justify-content: start;
    }
  }
}

@layer components {
  .trail {
    display: grid;
    grid-template-columns: max-content max-content max-content minmax(0, max-content) minmax(0, 1fr);
    column-gap: var(--inline-space);
    row-gap: var(--block-space-half);
    margin-block: var(--block-space);
    font-size: var(--text-small);
    color: var(--color-ink);
  }

  .trail__entry,
  .trail__line,
  .trail__entry::details-content {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    align-items: baseline;
    min-width: 0;
  }

  .trail__entry {
    row-gap: 0;
  }

  .trail__line {
    cursor: pointer;
  }

  .trail__time,
  .trail__number {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  .trail__time--short {
    color: var(--color-ink-dark);
    font-family: var(--font-sans);
    font-size: var(--text-x-small);
  }

  .trail__number {
    color: inherit;
    text-decoration: none;

    @media (any-hover: hover) {
      &:hover {
        text-decoration: underline;
      }
    }
  }

  .trail__action {
    white-space: nowrap;
  }

  .trail__actor,
  .trail__text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .trail__detail {
    display: flex;
    align-items: baseline;
    gap: var(--inline-space-half);
    min-width: 0;
  }

  .trail__caret {
    flex: 0 0 auto;
    margin-inline-start: auto;
    font-size: 1ch;
    rotate: -90deg;
    transition: rotate var(--duration-medium) ease-out;

    .trail__entry[open] & {
      rotate: 0deg;
    }
  }

  .trail__more {
    --prose-gap: var(--block-space);

    grid-column: 1 / -1;
    margin-block: var(--block-space-half);
    padding: var(--block-space);
    background-color: var(--color-canvas);
    border-radius: var(--radius-md);
    overflow-wrap: break-word;

    @media screen {
      border: var(--trail-more-border-size, 1px) solid var(--color-ink-lighter);
    }

    > :first-child {
      margin-block-start: 0;
    }

    > :last-child {
      margin-block-end: 0;
    }
  }

  .trail__paragraph {
    margin-block: var(--block-space);
  }

  .trail__entry {
    outline: none;

    &[hidden] {
      display: none;
    }

    &[aria-selected="true"] {
      background-color: var(--color-ink-lightest);
    }
  }

  .trail__sentence {
    grid-column: 2 / -1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .trail__sentence--link {
    color: inherit;
    text-decoration: none;

    @media (any-hover: hover) {
      &:hover {
        text-decoration: underline;
      }
    }
  }

  .trail .pagination-link {
    grid-column: 1 / -1;
  }

  @media (width < 640px) {
    .trail {
      grid-template-columns: max-content max-content max-content minmax(0, 1fr);
      row-gap: var(--block-space);
    }

    .trail__detail {
      grid-column: 2 / -1;
      margin-block-start: 0.2rem;
    }

    .trail__sentence {
      white-space: normal;
      overflow-wrap: break-word;
    }

    .trail__detail:has(.trail__text:empty):not(:has(.trail__caret)) {
      display: none;
    }

    .trail--answers {
      grid-template-columns: max-content max-content max-content minmax(0, max-content) minmax(1ch, 1fr);

      .trail__detail {
        grid-column: auto;
        margin-block-start: 0;
      }
    }
  }

  .trail--events {
    grid-template-columns: max-content minmax(0, 1fr);

    .trail__entry {
      position: relative;
    }

    .trail__sentence {
      grid-column: 2;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .trail__sentence--link::after {
      content: "";
      inset: 0;
      position: absolute;
    }

    /* Above the sentence link's overlay, so its attachments open */
    .trail__more {
      position: relative;
    }
  }

  .trail--events,
  .trail--answers {
    row-gap: var(--block-space-half);
  }

  .trail-day__title {
    margin-block: var(--block-space) 0;
    color: var(--color-ink-dark);
    font-size: var(--text-small);
    font-weight: 600;
  }

  .trail-days__more {
    display: flex;
    inline-size: fit-content;
    margin-inline: auto;

    turbo-frame:has(~ turbo-frame) > & {
      display: none;
    }
  }
}

@layer components {
  .project {
    display: flex;
    flex-direction: column;
    gap: var(--block-space-double);
  }

  .project__sheet {
    background-color: var(--color-canvas);
    border-radius: 0.5em;
    box-shadow: var(--shadow);
    overflow: hidden;
  }

  .project__activity {
    --page-size: 40rem;
  }

  .project__header {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: var(--block-space);
    padding: calc(var(--block-space) * 1.5) var(--inline-space-double) var(--block-space);
    text-align: center;
  }

  .project__title {
    font-size: var(--text-x-large);
    font-weight: 800;
    letter-spacing: -0.024em;
    line-height: 1.15;
    margin: 0;
    overflow-wrap: anywhere;
    text-wrap: balance;

    @container card-grid (inline-size >= 640px) {
      font-size: var(--text-xx-large);
    }
  }

  .project__description {
    margin-block: calc(var(--block-space-half) / 2 - var(--block-space)) 0;
    max-inline-size: 40rem;
    text-wrap: pretty;
  }

  .project__text {
    margin-block: calc(var(--block-space-half) / 2 - var(--block-space)) 0;
    margin-inline: 0;
    max-inline-size: 40rem;
    overflow-wrap: anywhere;
    text-wrap: pretty;

    + .project__description {
      margin-block-start: calc(var(--block-space-half) - var(--block-space));
    }
  }

  .project__meta {
    color: var(--color-ink-dark);
    font-size: var(--text-small);
    margin: 0;
    max-inline-size: 40rem;
    text-wrap: balance;

    .project__header & + & {
      margin-block-start: calc(var(--block-space-half) / 2 - var(--block-space));
    }
  }

  .project__prompt {
    color: var(--color-text-placeholder);
    text-decoration: none;

    @media (any-hover: hover) {
      &:hover {
        text-decoration: underline;
      }
    }
  }

  .project__statement {
    border-inline-start: 0.25em solid var(--color-ink-lighter);
    font-size: var(--text-small);
    overflow-wrap: anywhere;
    padding-inline-start: var(--inline-space-double);
  }

  .publication {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: var(--block-space);
    inline-size: 100%;
    margin-inline: auto;
    max-inline-size: 32rem;
    text-align: center;
  }

  .publication__box {
    align-items: center;
    background-color: var(--color-ink-lightest);
    border-radius: 0.5em;
    display: flex;
    flex-direction: column;
    gap: var(--block-space-half);
    inline-size: 100%;
    padding: var(--block-space) var(--inline-space);
  }

  .publication__box--published {
    background-color: var(--color-selected);
  }

  .publication__switch {
    --icon-size: 1.5em;

    align-items: center;
    display: flex;
    gap: var(--inline-space);
  }

  .publication__url {
    margin: 0;
    text-align: center;
  }

  .publication__actions {
    display: flex;
    flex-wrap: wrap;
    font-size: var(--text-small);
    gap: var(--inline-space);
    justify-content: center;
  }

  .project__people {
    --avatar-size: 1.75rem;

    align-items: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: var(--inline-space-half);
    text-decoration: none;

    .btn {
      font-size: var(--text-small);
      margin-inline-end: var(--inline-space);
    }

    .avatar {
      box-shadow: 0 0 0 2px var(--color-canvas);
      font-size: calc(var(--avatar-size) * 0.36);
      margin-inline-end: calc(var(--avatar-size) * -0.08);

      &:last-child {
        margin-inline-end: 0;
      }
    }
  }

  .tools {
    --tools-columns: 3;
    --tools-row-size: 17rem;

    border-block-start: var(--border);
    display: grid;
    grid-template-columns: 1fr;
    overflow: hidden;

    &:not(:has(> :nth-child(3))) {
      --tools-columns: 2;
    }

    &:not(:has(> :nth-child(2))) {
      --tools-columns: 1;
    }

    &:has(> :nth-child(4)):not(:has(> :nth-child(5))) {
      --tools-columns: 2;
    }

    &:not(:has(.rows)) {
      --tools-row-size: auto;
    }

    @container card-grid (inline-size >= 800px) {
      grid-auto-rows: minmax(var(--tools-row-size), auto);
      grid-template-columns: repeat(var(--tools-columns), minmax(0, 1fr));
    }
  }

  .tool {
    border-block-end: var(--border);
    border-inline-end: var(--border);
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: var(--block-space-half);
    margin-block-end: calc(-1 * 1px);
    margin-inline-end: calc(-1 * 1px);
    min-block-size: 0;
    min-inline-size: 0;
    padding: var(--block-space);
    text-decoration: none;

    @media (any-hover: hover) {
      &:is(a):hover .tool__title {
        text-decoration: underline;
      }
    }

    &:focus-visible {
      outline: 0.15rem solid var(--color-link);
      outline-offset: -0.15rem;
    }
  }

  .tool__title {
    font-size: var(--text-medium);
    font-weight: 700;
    line-height: 1.15;
    margin: 0;
    text-align: center;
  }

  .tool__panel {
    --rows-bg: transparent;
    --rows-border-size: 0;
    --rows-margin: 0;

    background-color: var(--color-ink-lightest);
    border-radius: 0.5em;
    flex: 1 1 auto;
    min-block-size: 0;
    overflow: hidden;
    padding: var(--block-space-half);

    &:has(> .blank-slate) {
      background-color: transparent;
      padding: 0;
    }

    > .blank-slate {
      block-size: 100%;
    }

    .row {
      padding-inline: var(--inline-space-half);
    }

    .row--nested {
      padding-inline-start: calc(var(--inline-space-half) + var(--depth, 0) * var(--inline-space));
    }

    .row__body {
      padding-block: calc(var(--block-space-half) / 2);
    }

    .row__title {
      font-size: var(--text-small);
    }

    .row__meta {
      font-size: var(--text-x-small);
    }

    .row__end {
      font-size: var(--text-x-small);
    }

    /* A state at a row's end is told by the word's colour alone, at the end's size. */
    .row__end .status {
      font-size: inherit;
      font-weight: normal;
    }
  }

  .tool__more {
    color: var(--color-ink-dark);
    font-size: var(--text-x-small);
    margin: 0;
    padding: calc(var(--block-space-half) / 2) var(--inline-space-half) 0;
    text-align: center;
  }

  .project__group {
    @media screen {
      margin-block: var(--block-space) 0;

      &:first-child {
        margin-block-start: 0;
      }
    }

    @media print {
      margin-block: var(--block-space-double);

      &:last-child {
        margin-block-end: 0;
      }
    }
  }

  /* A slate that fills a panel sits square in it: tilted, the panel would clip its corners. */
  .blank-slate--small {
    font-size: var(--text-small);
    margin: 0;
    padding-block: var(--block-space-half);
    rotate: 0deg;
  }
}

@layer components {
  /* The gaps alone set the rhythm, so the verdict, what is missing and the button fit a phone screen. */
  .verdict {
    display: flex;
    flex-direction: column;
    gap: var(--block-space);

    > * {
      margin-block: 0;
    }
  }

  .verdict__decision {
    display: block;
    padding-block: clamp(var(--block-space), 3vw, var(--block-space-double));
    padding-inline: var(--inline-space-double);
    border-radius: var(--radius-xl);
    font-size: clamp(2rem, 6vw, var(--text-xx-large));
    letter-spacing: -0.03em;
    line-height: 1.05;
    text-align: center;
    text-wrap: balance;
    white-space: normal;
  }

  /* Focused on load so Tab goes straight to the action; it is no Tab stop of its own, so it draws no ring. */
  .verdict__decision:focus {
    outline: none;
  }

  .verdict__summary {
    font-size: var(--text-medium);
    font-weight: 600;
    text-wrap: pretty;
  }

  .verdict__parties {
    display: flex;
    flex-direction: column;
    gap: var(--block-space-double);
  }

  .verdict__party {
    display: flex;
    flex-direction: column;
    align-items: start;
    gap: 0.25rem;
  }

  .verdict__party-name {
    margin: 0;
    font-size: var(--text-large);
    line-height: 1.15;
    text-align: start;
  }

  .verdict__party-meta {
    color: var(--color-ink-dark);
    font-size: var(--text-small);
  }

  .verdict__party-verdict {
    margin-block-start: 0.25rem;
  }

  .verdict__reasons-label,
  .verdict__note {
    margin-block: var(--block-space-half) 0;
  }

  .verdict__reasons-label {
    font-weight: 700;
  }

  .verdict__party .rows {
    inline-size: 100%;
    margin-block: var(--block-space-half) 0;
  }

  .verdict__action {
    :is(button, .btn) {
      inline-size: 100%;
      padding-block: var(--block-space);
      font-size: var(--text-medium);
    }
  }
}

@layer components {
  .avatar {
    --avatar-border-radius: 50%;
    --avatar-size-default: 5ch;
    --btn-border-size: 0;

    aspect-ratio: 1;
    block-size: var(--avatar-size, var(--avatar-size-default));
    border-radius: var(--avatar-border-radius);
    display: grid;
    flex-shrink: 0;
    inline-size: var(--avatar-size, var(--avatar-size-default));
    margin: 0;
    place-items: center;

    :is(img, .icon) {
      aspect-ratio: 1;
      block-size: 100%;
      border-radius: var(--avatar-border-radius);
      grid-area: 1/1;
      inline-size: 100%;
      max-inline-size: 100%;
      object-fit: cover;
    }
  }

  .avatar__form {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }
}

@layer components {
  .avatar--initials,
  .avatar {
    color: var(--color-white);
    font-size: var(--text-small);
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
  }

  .avatar--initials {
    white-space: nowrap;
    word-break: normal;
  }

  /* Three initials shrink to the circle they are in, whatever unit sized it. */
  .avatar--squeezed {
    container-type: inline-size;
  }

  .avatar__letters {
    font-size: min(1em, 30cqi);
  }

  .avatar--icon {
    --icon-size: 1.25rem;

    background-color: var(--color-canvas);
    border: var(--border);
    color: var(--color-ink);

    /* Outranks avatars.css, which sizes the icon to the whole avatar. */
    &.avatar .icon {
      block-size: var(--icon-size);
      inline-size: var(--icon-size);
    }
  }

  .avatar__form {
    --avatar-size: 4rem;
  }

  .avatar--square {
    --avatar-border-radius: var(--radius-lg);
  }

  .input--file {
    img:not([src]),
    &:has(img[src]) .icon {
      display: none;
    }
  }
}

@layer components {
  :root {
    --credential-blocklisting: light-dark(oklch(52% 0.19 25), oklch(72% 0.15 25));
    --credential-vehicle: light-dark(oklch(56% 0.15 55), oklch(75% 0.13 55));
    --credential-machinery: light-dark(oklch(57% 0.12 85), oklch(78% 0.12 85));
    --credential-work-permit: light-dark(oklch(52% 0.13 145), oklch(74% 0.12 145));
    --credential-requirement: light-dark(oklch(52% 0.15 320), oklch(74% 0.13 320));
    --credential-site: light-dark(oklch(50% 0.07 65), oklch(75% 0.07 65));
    --credential-checklist: light-dark(oklch(52% 0.1 185), oklch(75% 0.1 185));
    --credential-finding: light-dark(oklch(55% 0.12 110), oklch(77% 0.12 110));
    --credential-person: light-dark(oklch(52% 0.12 215), oklch(74% 0.11 215));
    --credential-firm: light-dark(oklch(50% 0.17 255), oklch(72% 0.13 255));
    --credential-training: light-dark(oklch(50% 0.17 285), oklch(72% 0.13 285));
    --credential-user: light-dark(oklch(52% 0.17 350), oklch(73% 0.13 350));
    --credential-grey: light-dark(oklch(56.7% 0 0), oklch(62.9% 0 0));
  }

  .credential {
    --credential-tone: var(--credential-color, var(--credential-grey));
    --credential-content-color: color-mix(in srgb, var(--credential-tone) 30%, var(--color-ink));
    --credential-text-color: color-mix(in srgb, var(--credential-tone) 75%, var(--color-ink));
    --credential-padding: var(--block-space);
    --credential-radius: var(--radius-sm);
    --credential-border-width: 2px;
    --credential-photo-size: 3rem;

    background-color: var(--color-canvas);
    border: var(--credential-border-width) solid var(--credential-tone);
    border-radius: var(--credential-radius);
    box-shadow: var(--shadow-card);
    margin-block-end: var(--block-space);
    padding: var(--credential-padding);
    position: relative;
  }

  .credential:has(.credential__serial) {
    padding-block-end: calc(var(--credential-padding) + 1lh);
  }

  .credential--inactive {
    --credential-tone: var(--credential-grey);
  }

  .credential__header {
    margin-block-start: calc(-1 * var(--credential-padding));
    margin-inline: calc(-1 * var(--credential-padding));
    min-inline-size: 0;
  }

  .credential__tab {
    align-items: baseline;
    background-color: var(--credential-tone);
    /* Inside the border, so its corners curve by the radius less the border, and meet the border with no gap. */
    border-radius: calc(var(--credential-radius) - var(--credential-border-width)) calc(var(--credential-radius) - var(--credential-border-width)) 0 0;
    color: var(--color-canvas);
    display: flex;
    font-size: var(--text-small);
    font-weight: 600;
    gap: var(--inline-space);
    justify-content: space-between;
    min-inline-size: 0;
    padding-block: 0.25lh;
    padding-inline: var(--credential-padding);
  }

  .credential__kind {
    white-space: nowrap;
  }

  .credential__issuer {
    min-inline-size: 0;
    overflow: hidden;
    text-align: end;
    text-overflow: ellipsis;
    white-space: nowrap;

    a {
      color: inherit;
    }
  }

  .credential__serial {
    color: var(--credential-text-color);
    font-family: var(--font-mono);
    font-size: var(--text-x-small);
    inset-block-end: var(--credential-padding);
    inset-inline-end: var(--credential-padding);
    letter-spacing: 0.04em;
    position: absolute;

    &::before {
      content: "Nº ";
      opacity: 0.5;
    }
  }

  .credential__body {
    align-items: center;
    display: grid;
    gap: var(--credential-padding);
    grid-template-columns: var(--credential-photo-size) 1fr;
    padding-block: calc(var(--credential-padding) / 2);
  }

  .credential__photo {
    --avatar-size: var(--credential-photo-size);
    --icon-size: 55%;

    background-color: var(--credential-tone);
    grid-column: 1;
  }

  .credential__identity {
    color: var(--credential-content-color);
    grid-column: 2;
    min-inline-size: 0;

    .credential__name {
      color: var(--credential-content-color);
      font-size: var(--text-x-large);
      font-weight: 900;
      line-height: 1.15;
      margin: 0;
      overflow-wrap: break-word;
      text-wrap: balance;
    }

    .credential__number {
      color: var(--credential-text-color);
      font-family: var(--font-mono);
      margin: 0;
    }

    .credential__state {
      color: var(--color-ink-dark);
      font-family: var(--font-sans);
    }
  }

  .credential__summary {
    margin: 0.25rem 0 0;
  }

  .credential__fields,
  .credential__sites {
    margin-block-start: var(--credential-padding);
  }

  .credential__fields {
    display: grid;
    gap: var(--block-space-half) var(--inline-space-double);
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));

    .details__row {
      align-content: start;
    }
  }

  .credential .details__label {
    color: var(--credential-text-color);
    font-weight: 500;
  }

  .credential__sites {
    color: var(--credential-text-color);
    font-size: var(--text-small);
    font-weight: 500;
  }

  .credential__site-list {
    color: var(--color-ink);
    display: flex;
    flex-wrap: wrap;
    gap: var(--block-space-half) var(--inline-space-double);

    a {
      color: inherit;
    }
  }

  .credential__site {
    overflow-wrap: anywhere;
  }

  .credential__no-sites {
    overflow-wrap: anywhere;
  }

  .credential__check {
    color: var(--color-ink-dark);
    display: grid;
    font-size: var(--text-small);
    font-weight: 400;
    gap: 0.25em;
    margin-block-start: var(--block-space-half);
  }
}

@layer utilities {
  /* Text */
  .txt-xx-small { font-size: var(--text-xx-small); }
  .txt-x-small { font-size: var(--text-x-small); }
  .txt-small { font-size: var(--text-small); }
  .txt-normal { font-size: var(--text-normal); }
  .txt-medium { font-size: var(--text-medium); }
  .txt-large { font-size: var(--text-large); }
  .txt-x-large { font-size: var(--text-x-large); }
  .txt-xx-large { font-size: var(--text-xx-large); }

  .txt-align-center { text-align: center; }
  .txt-align-start { text-align: start; }
  .txt-align-end { text-align: end; }

  .txt-current { color: currentColor; }
  .txt-ink { color: var(--color-ink); }
  .txt-reversed { color: var(--color-ink-inverted); }
  .txt-negative { color: var(--color-negative); }
  .txt-positive { color: var(--color-positive); }
  .txt-subtle { color: var(--color-ink-dark); }
  .txt-alert { color: var(--color-marker); }
  .txt-undecorated { text-decoration: none; }
  .txt-underline { text-decoration: underline; }
  .txt-tight-lines { line-height: 1.2; }
  .txt-tall-lines { line-height: 2; }
  .txt-nowrap { white-space: nowrap; }
  .txt-balance { text-wrap: balance; }
  .txt-break { word-break: break-word; }
  .txt-uppercase { text-transform: uppercase; }
  .txt-capitalize { text-transform: capitalize; }
  .txt-capitalize-first-letter::first-letter { text-transform: capitalize; }
  .txt-link { color: var(--color-link); text-decoration: underline; }

  .font-weight-normal { font-weight: 400; }
  .font-weight-medium { font-weight: 500; }
  .font-weight-semibold { font-weight: 600; }
  .font-weight-bold { font-weight: 700; }
  .font-weight-black { font-weight: 900; }

  /* Flexbox and Grid */
  .justify-end { justify-content: end; }
  .justify-start { justify-content: start; }
  .justify-center { justify-content: center; }
  .justify-space-between { justify-content: space-between; }

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

  .align-self-center { align-self: center; }
  .align-self-end { align-self: end; }
  .align-self-start { align-self: start; }

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

  .contain { contain: inline-size; }

  .display-inline { display: inline; }

  .flex { display: flex; }
  .flex-inline { display: inline-flex; }
  .flex-column { flex-direction: column; }
  .flex-wrap { flex-wrap: wrap; }

  .flex-1 { flex: 1; }
  .flex-item-grow { flex-grow: 1; }
  .flex-item-shrink { flex-shrink: 1; }
  .flex-item-no-shrink { flex-shrink: 0; }
  .flex-item-justify-start { margin-inline-end: auto; }
  .flex-item-justify-end { margin-inline-start: auto; }

  .gap {
    column-gap: var(--column-gap, var(--inline-space));
    row-gap: var(--row-gap, var(--block-space));
  }

  .gap-half {
    column-gap: var(--column-gap, var(--inline-space-half));
    row-gap: var(--row-gap, var(--block-space-half));
  }

  .gap-none {
    --column-gap: 0;
    --row-gap: 0;

    gap: 0;
  }

  /* Sizing */
  .full-width { inline-size: 100%; }
  .min-width { min-inline-size: 0; }
  .half-width { inline-size: 50%; }
  .max-width { max-inline-size: 100%; }
  .min-content { inline-size: min-content; }
  .fit-content { inline-size: fit-content; }
  .max-inline-size { max-inline-size: 100%; }

  /* Overflow */
  .overflow-x { overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; }
  .overflow-y { overflow-y: auto; scroll-snap-type: y mandatory; scroll-behavior: smooth; }
  .overflow-clip { text-overflow: clip; white-space: nowrap; overflow: hidden; }
  .overflow-ellipsis { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }

  .overflow-line-clamp {
    -webkit-line-clamp: var(--lines, 2);
    -webkit-box-orient: vertical;
    display: -webkit-box;
    overflow: hidden;
    text-overflow: clip;
    white-space: normal;
  }

  /* Mouse pointer */
  .non-clickable {
    cursor: default;
    pointer-events: none;
  }

  .cursor-pointer { cursor: pointer; }

  /* Padding */
  .pad { padding: var(--block-space) var(--inline-space); }
  .pad-double { padding: var(--block-space-double) var(--inline-space-double); }

  .pad-block { padding-block: var(--block-space); }
  .pad-block-start { padding-block-start: var(--block-space); }
  .pad-block-end { padding-block-end: var(--block-space); }
  .pad-block-half { padding-block: var(--block-space-half); }
  .pad-block-start-half { padding-block-start: var(--block-space-half); }

  .pad-inline { padding-inline: var(--inline-space); }
  .pad-inline-start { padding-inline-start: var(--inline-space); }
  .pad-inline-end { padding-inline-end: var(--inline-space); }
  .pad-inline-half { padding-inline: var(--inline-space-half); }
  .pad-inline-double { padding-inline: var(--inline-space-double); }

  .unpad { padding: 0; }
  .unpad-block-end { padding-block-end: 0; }
  .unpad-inline { padding-inline: 0; }

  /* Margins */
  .margin { margin: var(--block-space) var(--inline-space); }
  .margin-block { margin-block: var(--block-space); }
  .margin-block-half { margin-block: var(--block-space-half); }
  .margin-block-start { margin-block-start: var(--block-space); }
  .margin-block-start-half { margin-block-start: var(--block-space-half); }
  .margin-block-start-auto { margin-block-start: auto; }
  .margin-block-end { margin-block-end: var(--block-space); }
  .margin-block-end-half { margin-block-end: var(--block-space-half); }
  .margin-block-double { margin-block: var(--block-space-double); }
  .margin-block-end-double { margin-block-end: var(--block-space-double); }
  .margin-block-start-double { margin-block-start: var(--block-space-double); }

  .margin-inline { margin-inline: var(--inline-space); }
  .margin-inline-start { margin-inline-start: var(--inline-space); }
  .margin-inline-start-half { margin-inline-start: var(--inline-space-half); }
  .margin-inline-end { margin-inline-end: var(--inline-space); }
  .margin-inline-end-half { margin-inline-end: var(--inline-space-half); }
  .margin-inline-half { margin-inline: var(--inline-space-half); }
  .margin-inline-double { margin-inline: var(--inline-space-double); }

  .margin-none { margin: 0; }
  .margin-none-block { margin-block: 0; }
  .margin-none-block-start { margin-block-start: 0; }
  .margin-none-block-end { margin-block-end: 0; }

  .margin-none-inline { margin-inline: 0; }
  .margin-none-inline-start { margin-inline-start: 0; }
  .margin-none-inline-end { margin-inline-end: 0; }

  .center { margin-inline: auto; }
  .center-block { margin-block: auto; }

  /* Position */
  .position-relative { position: relative; }
  .position-sticky { position: sticky; inset: var(--inset, 0 auto auto auto); z-index: var(--z, 1); }

  /* Fills */
  .fill { background-color: var(--color-canvas); }
  .fill-black { background-color: var(--color-ink); }
  .fill-white { background-color: var(--color-ink-inverted); }
  .fill-shade { background-color: var(--color-ink-lightest); }
  .fill-selected { background-color: var(--color-selected); }
  .fill-highlight { background-color: var(--color-highlight); }
  .fill-transparent { background-color: transparent; }

  .fill-highlighter {
    display: inline-block;
    position: relative;
    z-index: 1;

    &::before {
      background-color: var(--color-highlight);
      border-radius: 0.2em;
      content: "";
      inset-block: 0;
      inset-inline: -0.1em;
      position: absolute;
      transform: skewX(-10deg) rotate(1deg);
      z-index: -1;
    }
  }

  .translucent { opacity: var(--opacity, 0.66); }

  /* Borders */
  .border { border: var(--border-size, 1px) var(--border-style, solid) var(--border-color, var(--color-ink-lighter)); }
  .border-block { border-block: var(--border-size, 1px) var(--border-style, solid) var(--border-color, var(--color-ink-lighter)); }
  .border-bottom { border-block-end: var(--border-size, 1px) var(--border-style, solid) var(--border-color, var(--color-ink-lighter)); }
  .border-top { border-block-start: var(--border-size, 1px) var(--border-style, solid) var(--border-color, var(--color-ink-lighter)); }
  .borderless { border: 0; }

  /* Border radius */
  .border-radius { border-radius: var(--border-radius, 0.5em); }

  /* Shadows */
  .shadow { box-shadow: var(--shadow); }

  /* Lists */
  :where(.list-style-none) {
    list-style: none;
    margin: 0 auto;
    padding: 0;
  }

  :where(.list-unindented) {
    padding-inline-start: 1.25em;
  }

  /* Accessibility */
  .visually-hidden,
  .for-screen-reader {
    block-size: 1px;
    clip-path: inset(50%);
    inline-size: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
  }

  /* Visibility */
  [hidden] { display: none !important; }
  .display-contents,
  [contents] { display: contents; }

  .hide-in-pwa {
    @media (display-mode: standalone) {
      display: none;
    }
  }

  .hide-in-browser {
    @media (display-mode: browser) {
      display: none;
    }
  }

  .hide-focus-ring {
    --focus-ring-size: 0;
  }

  .hide-on-touch {
    @media (any-hover: none) {
      display: none;
    }
  }

  .show-on-touch {
    display: none;

    @media (any-hover: none) {
      display: unset;
    }
  }

  .show-on-native {
    body:not([data-platform~=native]) & {
      display: none;
    }
  }

  .hide-scrollbar {
    -ms-overflow-style: none;  /* Edge */
    scrollbar-width: none; /* FF */

    /* Chrome/Safari/Opera */
    &::-webkit-scrollbar {
      display: none;
    }
  }

  .hide-on-dark-mode {
    html[data-theme="dark"] & {
      display: none;
    }

    html:not([data-theme]) & {
      @media (prefers-color-scheme: dark) {
        display: none;
      }
    }
  }

  .hide-on-light-mode {
    html[data-theme="light"] & {
      display: none;
    }

    html:not([data-theme]) & {
      @media (prefers-color-scheme: light) {
        display: none;
      }
    }
  }
}

/* The app's tokens come from its _global.css, unlayered, earlier in style.css. This is unlayered too
   and follows it, so it wins. */
:root {
  color-scheme: light dark;

  /* The system stack, less the app's face. */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";

  /* The marketing site's: one fluid base, every other size a share of it. */
  --font-size: clamp(1.125rem, 0.55rem + 1vw, 1.375rem);
  --size-display: 2.2em;
  --size-heading: 1.55em;
  --size-subheading: 1.15em;
  --size-lead: 1.15em;
  --size-small: 0.85em;
  --size-x-small: 0.75em;
  --hairline: color-mix(in oklch, var(--color-ink) 10%, transparent);
  --content-width: 72rem;
  --prose-width: 36em;
  --gutter: 1rem;
  /* The top bar, kept in view: what stays clear of it, and where its drawer opens, is reckoned from it. */
  --header-block-size: 4rem;

  @media (width >= 64em) {
    --gutter: 2rem;
    --size-display: 2.75em;
    --size-heading: 1.9em;
  }
}

/* What the app's elements.css adds to its reset, without the type and boxes it gives the app's bare elements. */
@layer reset {
  * {
    margin: 0;
  }

  html {
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
  }

  img,
  picture,
  video,
  canvas,
  svg {
    display: block;
    max-width: 100%;
    height: auto;
  }

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

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    text-wrap: balance;
  }
}

@layer base {
  /* On body, where the app's reset sets its own family. */
  body {
    color: var(--color-ink);
    background-color: var(--color-canvas);
    font-family: var(--font-sans);
    font-size: var(--font-size);
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  h1,
  h2,
  h3 {
    font-weight: 800;
    letter-spacing: -0.026em;
    line-height: 1.15;
  }

  p {
    text-wrap: pretty;
  }

  a {
    color: var(--color-link);
    text-decoration-thickness: 0.07em;
    text-underline-offset: 0.15em;

    @media (any-hover: hover) {
      &:hover {
        text-decoration: none;
      }
    }
  }

  mark {
    background-color: var(--color-highlight);
    color: var(--color-ink);
    padding-inline: 0.15em;
    border-radius: 0.15em;
  }

  :focus-visible {
    outline: var(--focus-ring);
    outline-offset: 2px;
  }

  .btn--large {
    --btn-padding: 0.7em 1.4em;
  }
}

@layer components {
  /* The app's header__skip-navigation: off to the side until a keyboard reaches it. */
  .skip-link {
    position: absolute;
    inset-block-start: 0.75rem;
    inset-inline-start: -999em;
    z-index: 999;
    white-space: nowrap;

    &:focus {
      inset-inline-start: var(--gutter);
    }
  }
}

@layer components {
  /* The marketing site's header, kept in view: the name at the start, then who the help is for, the search and the way
     into the app at the end. On a phone the search is its glyph, and the way into the app goes to the guides' drawer
     where a page has one. */
  .header {
    display: flex;
    position: sticky;
    inset-block-start: 0;
    z-index: var(--z-nav);
    align-items: center;
    gap: var(--inline-space-double);
    min-block-size: var(--header-block-size);
    padding-block: 0.5rem;
    padding-inline: var(--gutter);
    border-block-end: 1px solid var(--hairline);
    background-color: var(--color-canvas);

    @media (width < 52em) {
      gap: var(--inline-space);
    }

    @media (width >= 64em) {
      padding-inline: calc(var(--gutter) + 1rem);
    }
  }

  /* The home's holds the name alone, in the middle, as a search engine's does, and scrolls away with the page. */
  .header--home {
    position: static;
    justify-content: center;
    border-block-end: 0;
  }

  /* A link to a heading lands below the header, not under it. */
  html {
    scroll-padding-block-start: calc(var(--header-block-size) + 1rem);
  }

  .header__logo {
    flex-shrink: 0;
    color: var(--color-ink);
    font-size: 1.25em;
    font-weight: 900;
    letter-spacing: -0.035em;
    text-decoration: none;

    @media (width < 30em) {
      font-size: 1.1em;
    }
  }

  /* The site's own: which part of Auditans this is, beside the name and lighter than it. */
  .header__section {
    color: var(--color-ink-dark);
    font-weight: 600;
    letter-spacing: -0.02em;
  }

  .header__audiences {
    display: flex;
    gap: var(--inline-space-half);
    font-size: var(--size-small);

    @media (width < 52em) {
      display: none;
    }
  }

  .header__audience {
    padding: 0.3em 0.7em;
    border-radius: 99rem;
    color: var(--color-ink-dark);
    font-weight: 600;
    text-decoration: none;

    &[aria-current] {
      background-color: var(--color-ink-lightest);
      color: var(--color-ink);
    }

    @media (any-hover: hover) {
      &:hover {
        color: var(--color-ink);
      }
    }
  }

  /* A box that opens the search, as wide as a few words, with its keys at the end. */
  .header__search {
    --btn-background: var(--color-ink-lightest);
    --btn-border-color: var(--color-ink-lighter);
    --btn-color: var(--color-ink-dark);
    --btn-font-weight: 400;
    --btn-padding: 0.45em 0.6em 0.45em 0.9em;
    --icon-size: 1em;

    justify-content: flex-start;
    min-inline-size: 15em;
    margin-inline-start: auto;
    font-size: var(--size-small);
    white-space: nowrap;

    @media (width < 52em) {
      --btn-padding: 0;

      flex: none;
      justify-content: center;
      inline-size: 2.5em;
      block-size: 2.5em;
      min-inline-size: 0;

      .header__search-words {
        position: absolute;
        inline-size: 1px;
        block-size: 1px;
        overflow: hidden;
        clip-path: inset(50%);
      }
    }
  }

  /* The keys work only with the script, and only where there is a keyboard. */
  .header__key {
    display: none;
    margin-inline-start: auto;
    padding: 0 0.4em;
    border: 1px solid var(--color-ink-lighter);
    border-radius: 0.3em;
    background-color: var(--color-canvas);
    font-family: inherit;
    font-size: 0.8em;

    .js & {
      display: inline;
    }

    @media (any-hover: none) or (width < 52em) {
      .js & {
        display: none;
      }
    }
  }

  .header__enter {
    flex-shrink: 0;
    font-size: var(--size-small);
    white-space: nowrap;
  }

  /* The button that opens a guide's drawer, on a phone and with the script. */
  .header > .header__menu {
    --btn-size: 2.5em;

    display: none;
    flex: none;
    font-size: var(--size-small);

    @media (width < 52em) {
      .js & {
        display: grid;
      }
    }
  }

  /* A guide on a phone: the way into the app is in the drawer, and the search takes its words back. */
  @media (width < 52em) {
    .js .header:has(.header__menu) {
      .header__enter {
        display: none;
      }

      .header__search {
        --btn-padding: 0.45em 0.9em;

        flex: 1 1 auto;
        justify-content: flex-start;
        inline-size: auto;
        min-inline-size: 0;
      }

      .header__search-words {
        position: static;
        inline-size: auto;
        block-size: auto;
        overflow: hidden;
        clip-path: none;
        text-overflow: ellipsis;
      }
    }
  }
}

@layer components {
  .canvas {
    display: flex;
    flex-direction: column;
    gap: clamp(3rem, 7vw, 6rem);
    padding-block: clamp(2rem, 6vw, 5rem);
    padding-inline: var(--gutter);
    background-color: var(--color-ink-lightest);

    @media (width >= 64em) {
      margin-inline: 1rem;
    }

    &:focus-visible {
      outline: none;
    }

    > * {
      inline-size: 100%;
      max-inline-size: var(--content-width);
      margin-inline: auto;
    }
  }
}

@layer components {
  /* The marketing site's hero, centred. */
  .hero {
    display: grid;
    gap: 2.5em;
    align-items: center;
  }

  .hero__text {
    text-align: center;
  }

  .hero__title {
    font-size: var(--size-display);
    font-weight: 900;
    letter-spacing: -0.035em;
    line-height: 1.05;
  }

  .hero__lead {
    max-inline-size: var(--prose-width);
    margin-block-start: 0.8em;
    margin-inline: auto;
    font-size: var(--size-lead);
  }

  .hero__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25em;
    margin-block-start: 1.5em;
  }
}

@layer components {
  /* The home fills the window as a search engine's does: the header at the top, the footer at its foot, and the ground
     stretched between them with the search in its middle. */
  body:has(> .canvas > .hero--search) {
    display: flex;
    flex-direction: column;
    min-block-size: 100dvh;
  }

  /* The home is the search: a heading and its line, the box larger than over the results, and one line under it, close
     in its ground. A query's results stand under the box from the top. */
  .canvas:has(> .hero--search) {
    flex-grow: 1;
    justify-content: center;
    padding-block: var(--block-space-double);

    &:has(.search-results:not(:empty)) {
      justify-content: start;
    }
  }

  .hero--search {
    justify-items: center;
    gap: var(--block-space);

    .hero__title {
      font-size: var(--size-heading);
      letter-spacing: -0.02em;
      line-height: 1.15;
      text-wrap: balance;
    }

    .hero__lead {
      margin-block-start: 0.4em;
    }

    .site-search {
      font-size: clamp(1.1875rem, 1rem + 1vw, 1.5rem);
    }
  }

  .hero__more {
    font-weight: 700;
    text-align: center;
  }
}

@layer components {
  /* The marketing site's article: a title block over one column of prose. */
  .article {
    max-inline-size: var(--prose-width);
  }

  /* The prose's spacing, which stops at a drawing of the app's screen: a mock keeps the app's. */
  @scope (.article) to (.mock) {
    p + p,
    p + ul,
    p + ol,
    ul + p,
    ol + p {
      margin-block-start: 1em;
    }

    ul,
    ol {
      padding-inline-start: 1.25em;
    }

    li + li {
      margin-block-start: 0.4em;
    }
  }

  .article__title {
    margin-block-start: 0.4em;
    font-size: var(--size-heading);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.1;
  }

  .article__lead {
    margin-block-start: 1em;
    font-size: var(--size-lead);
    line-height: 1.4;
  }
}

@layer components {
  /* The marketing site's footer: a note, then every page as one centred, wrapping run of bold ink links, then the
     legal line. */
  .footer {
    display: grid;
    justify-items: center;
    gap: 2.5em;
    max-inline-size: calc(var(--content-width) + 2 * var(--gutter));
    margin-inline: auto;
    padding: var(--block-space-double) var(--gutter) 3em;
    text-align: center;
  }

  .footer__note {
    max-inline-size: 30em;
    color: var(--color-ink-dark);
    text-wrap: balance;
  }

  .footer__nav {
    inline-size: 100%;
  }

  .footer__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 1em;
    padding: 0;
    font-weight: 900;
    list-style: none;

    a {
      color: var(--color-ink);
      text-decoration: none;

      @media (any-hover: hover) {
        &:hover {
          color: var(--color-link);
        }
      }
    }
  }

  .footer__legal {
    color: var(--color-ink-dark);
    font-size: var(--size-x-small);
  }
}

@layer components {
  /* Where a page sits, from the index down. The app's breadcrumbs are its header's: centred, and cut to one line. */
  .crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2em var(--inline-space-half);
    font-size: var(--text-small);
    font-weight: 700;
    letter-spacing: normal;
  }

  .crumbs__link {
    color: var(--color-ink);
  }

  .crumbs__separator {
    color: var(--color-ink-dark);
  }

  .crumbs__current {
    color: var(--color-ink-darker);
  }
}

@layer components {
  /* The search box: wide, tall and round, the page's main control. Its suggestions are the app's, open under it. */
  .site-search {
    inline-size: 100%;
    max-inline-size: 40em; /* the app's 40rem: its root is this size */
    margin-inline: auto;
    font-size: clamp(1.1875rem, 1rem + 1vw, 1.375rem);
    letter-spacing: normal;
    text-align: start;

    .suggestions__list {
      inset-block-start: calc(100% + var(--block-space-half));
    }
  }

  /* One round box that holds the words and the button side by side, so a phone's width goes to the words. */
  .site-search__box {
    display: flex;
    align-items: center;
    gap: var(--inline-space-half);
    padding: var(--block-space-half);
    padding-inline-start: var(--inline-space);
    border: 1px solid var(--color-ink-medium);
    border-radius: var(--btn-border-radius, 99rem); /* the app's buttons' */
    background-color: var(--color-canvas);
    box-shadow: var(--shadow-card);

    &:has(.site-search__input:focus-visible) {
      outline: var(--focus-ring);
    }
  }

  .site-search__input {
    --input-border-size: 0;
    --input-padding: var(--block-space-half) var(--inline-space-half);

    flex: 1;
    min-inline-size: 0;
    font-size: 1.05em;
    text-overflow: ellipsis;

    &:focus-visible {
      outline: none;
    }
  }

  .site-search__keys {
    padding: var(--block-space-half) var(--inline-space-double);
    color: var(--color-ink-darker);
    font-size: var(--text-x-small);

    @media (any-hover: none) {
      display: none;
    }
  }

  /* Said only where the script does not run, since it is the script that keeps the search here. */
  .site-search__fallback {
    margin-block-start: var(--block-space);
    color: var(--color-ink-darker);
    font-size: var(--size-small);
    text-align: center;

    .js & {
      display: none;
    }
  }

  /* Results in one column, as a search engine lists them, in place of the guides while a query stands. */
  .search-results {
    display: grid;
    gap: var(--block-space-half);
    inline-size: 100%;
    max-inline-size: 40em;
    margin-inline: auto;
    font-size: 1.1875rem;
    letter-spacing: normal;
    text-align: start;

    &:empty {
      display: none;
    }

    &[aria-busy="true"] {
      cursor: progress;
      opacity: 0.5;
    }

    .rows {
      margin: 0;
    }
  }

  .search-results__count {
    color: var(--color-ink-darker);
    font-size: var(--text-small);
  }

  .search-results__empty {
    display: grid;
    gap: var(--block-space);
  }
}

@layer components {
  /* The search the top bar opens on every page but the home: a box near the top of the window, its guides listed under
     it as they are typed, in the app's rows. */
  .search-dialog {
    inline-size: min(36rem, calc(100vw - 2 * var(--gutter)));
    max-block-size: calc(100dvh - 2 * var(--gutter));
    margin: min(10vh, 6rem) auto auto;
    padding: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background-color: var(--color-canvas);
    box-shadow: var(--shadow-card);
    color: var(--color-ink);
    font-size: 1.1rem;
    letter-spacing: normal;
  }

  .search-dialog__form {
    display: flex;
    flex-direction: column;
    max-block-size: inherit;
  }

  .search-dialog__box {
    display: flex;
    align-items: center;
    gap: var(--inline-space-half);
    padding: var(--block-space-half) var(--block-space-half) var(--block-space-half) var(--inline-space);
    border-block-end: 1px solid var(--color-ink-lighter);

    > .icon {
      --icon-size: 1em;

      flex: none;
      color: var(--color-ink-dark);
    }
  }

  .search-dialog__input {
    --input-border-size: 0;
    --input-padding: var(--block-space-half) var(--inline-space-half);

    flex: 1;
    min-inline-size: 0;

    &:focus-visible {
      outline: none;
    }

    /* The box's own clear button would clear only the words; Cerrar closes. */
    &::-webkit-search-cancel-button {
      display: none;
    }
  }

  .search-dialog__close {
    --btn-padding: 0.3em 0.8em;

    flex: none;
    font-size: var(--size-small);
  }

  .search-dialog__rows {
    --rows-border-size: 0;

    margin: 0;
    overflow-y: auto;

    &:empty {
      display: none;
    }
  }

  .search-dialog__empty {
    padding: var(--block-space) var(--inline-space);
    color: var(--color-ink-dark);
  }

  .search-dialog__keys {
    padding: var(--block-space-half) var(--inline-space);
    border-block-start: 1px solid var(--color-ink-lighter);
    color: var(--color-ink-darker);
    font-size: var(--size-x-small);

    @media (any-hover: none) {
      display: none;
    }
  }
}

@layer components {
  /* The guides page: its heading, then every guide by audience and group, in the app's rows at the size the site reads
     at, in a column as wide as the app's page. */
  .canvas:has(> .hero--guides) {
    gap: var(--block-space-double);
  }

  .hero--guides {
    .hero__title {
      font-size: var(--size-heading);
      letter-spacing: -0.02em;
      line-height: 1.15;
    }

    .hero__lead {
      margin-block-start: 0.4em;
    }
  }

  .guides {
    display: grid;
    gap: var(--block-space-double);
    inline-size: 100%;
    max-inline-size: 40em; /* the app's 40rem: its root is this size */
    margin-inline: auto;
    font-size: 1.1875rem;
    letter-spacing: normal;
  }

  .guides__audience {
    display: grid;
    gap: var(--block-space-half);
    scroll-margin-block-start: var(--block-space);
  }

  .guides__title {
    font-size: var(--size-subheading);
  }

  .guides__group {
    margin-block-start: var(--block-space);
    color: var(--color-ink-dark);
    font-size: var(--text-small);
    font-weight: 700;
  }

  .guides__rows {
    margin: 0;
  }
}

@layer components {
  /* A guide's page: the guides of its audience at the start, the guide, and on a wide window what is on the page at the
     end. On a phone the guides open in a drawer from the top bar; without the script they follow the guide. */
  .canvas:has(> .docs) {
    padding-block: clamp(1.25rem, 3vw, 2.5rem);
  }

  .canvas > .docs {
    max-inline-size: 84rem;
  }

  .docs {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--block-space-double);
    align-items: start;

    @media (width >= 52em) {
      grid-template-columns: 14rem minmax(0, 1fr);
      gap: clamp(2rem, 4vw, 4rem);
    }

    @media (width >= 75em) {
      grid-template-columns: 14rem minmax(0, 1fr) 11rem;
    }
  }

  .docs__main {
    min-inline-size: 0;
  }

  .docs__nav {
    position: sticky;
    inset-block-start: calc(var(--header-block-size) + 1rem);
    max-block-size: calc(100dvh - var(--header-block-size) - 2rem);
    overflow-y: auto;

    @media (width < 52em) {
      position: static;
      max-block-size: none;
      order: 1;

      .js & {
        display: none;
      }

      .js &.docs__nav--open {
        display: block;
        position: fixed;
        inset: var(--header-block-size) 0 0;
        z-index: calc(var(--z-nav) - 1);
        padding: var(--block-space) var(--gutter) var(--block-space-double);
        background-color: var(--color-canvas);
      }
    }
  }

  /* The page under an open drawer stays where it is. */
  @media (width < 52em) {
    html:has(.docs__nav--open) {
      overflow: hidden;
    }
  }
}

@layer components {
  /* Every guide of the audience by group, as the home lists them, the one open marked in the colour of a link. */
  .sidebar {
    font-size: var(--size-small);
    letter-spacing: normal;
    line-height: 1.35;

    @media (width >= 52em) {
      font-size: var(--size-x-small);
    }
  }

  .sidebar__group {
    margin-block: var(--block-space) 0.3em;
    padding-inline: 0.6rem;
    color: var(--color-ink-dark);
    font-size: var(--size-small);
    font-weight: 700;
    letter-spacing: normal;

    &:first-child {
      margin-block-start: 0;
    }
  }

  .sidebar__list {
    display: grid;
    gap: 1px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .sidebar__link {
    display: block;
    padding: 0.35em 0.6rem;
    border-radius: 0.4em;
    color: var(--color-ink);
    text-decoration: none;

    @media (any-hover: hover) {
      &:hover {
        background-color: var(--hairline);
      }
    }

    &[aria-current] {
      background-color: var(--color-selected);
      color: var(--color-link);
      font-weight: 700;
    }
  }

  .sidebar__foot {
    display: grid;
    gap: 0.4em;
    margin-block-start: var(--block-space);
    padding: var(--block-space) 0.6rem 0;
    border-block-start: 1px solid var(--hairline);

    a {
      color: var(--color-ink-dark);
      text-decoration: none;
    }
  }

  /* The top bar holds the way into the app, but in a phone's drawer it is here. */
  .sidebar__enter {
    display: none;

    @media (width < 52em) {
      .js & {
        display: block;
      }
    }
  }
}

@layer components {
  /* What is on a guide's page, at the end of a wide window and in view while it scrolls. */
  .toc {
    position: sticky;
    inset-block-start: calc(var(--header-block-size) + 1rem);
    display: none;
    font-size: var(--size-x-small);
    letter-spacing: normal;
    line-height: 1.35;

    @media (width >= 75em) {
      display: grid;
      gap: 0.5em;
    }
  }

  .toc__title {
    color: var(--color-ink-dark);
    font-size: var(--size-small);
    font-weight: 700;
    letter-spacing: normal;
  }

  .toc__list {
    display: grid;
    gap: 0.3em;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .toc__link {
    display: block;
    padding-inline-start: 0.7em;
    border-inline-start: 2px solid var(--hairline);
    color: var(--color-ink-dark);
    text-decoration: none;

    @media (any-hover: hover) {
      &:hover {
        border-color: var(--color-link);
        color: var(--color-link);
      }
    }
  }
}

@layer components {
  /* A guide is the marketing site's article, set close, as a page looked up rather than read through: the title block,
     the numbered steps, the notes, then the guides beside it. */
  .guide {
    display: grid;
    gap: var(--block-space-double);
    line-height: 1.5;
  }

  .guide__header {
    display: grid;
    gap: 0.25em;
  }

  .guide__reviewed {
    margin-block-start: 0.5em;
    color: var(--color-ink-dark);
    font-size: var(--size-small);
  }

  .guide__body {
    display: grid;
    gap: 1em;

    > * {
      margin: 0;
    }
  }

  .guide__heading {
    margin-block-start: 0.75em;
    font-size: var(--size-subheading);
  }

  /* The steps as the marketing site numbers its walk through the app: the number and a full stop, in the link's
     colour, before the step. */
  .guide .guide__steps {
    display: grid;
    gap: 0.75em;
    margin-block: 0.5em;
    padding: 0;
    list-style: none;
  }

  .guide .guide__step {
    margin: 0;

    &::before {
      content: counter(list-item) ". ";
      color: var(--color-link);
      font-variant-numeric: tabular-nums;
      font-weight: 800;
    }
  }

  .guide__list {
    margin: 0;
  }

  /* A button or a field as the app names it. */
  .guide__label {
    font-weight: 700;
  }

  .guide .status--badge {
    font-size: 0.85em;
  }

  .guide__related {
    display: grid;
    gap: var(--block-space-half);
    font-size: 0.9em;

    .rows {
      margin: 0;
    }
  }

  /* The guides before and after this one, in the sidebar's order: the one after always at the end. */
  .pager {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--inline-space);
    font-size: var(--size-small);
    letter-spacing: normal;
  }

  .pager__link {
    display: grid;
    gap: 0.1em;
    padding: 0.7em 0.9em;
    border-radius: var(--radius-lg);
    background-color: var(--color-canvas);
    box-shadow: var(--shadow-card);
    color: var(--color-ink);
    font-weight: 600;
    text-decoration: none;

    small {
      color: var(--color-ink-dark);
      font-size: 0.85em;
      font-weight: 400;
    }

    @media (any-hover: hover) {
      &:hover {
        box-shadow: 0 0 0 1px var(--color-link);
      }
    }
  }

  .pager__link--next {
    grid-column: 2;
    text-align: end;
  }
}

@layer components {
  /* A guide for the reader's assistant, beside where it sits: its Markdown to copy or read, and the assistants that open
     with it named. With the script a button opens the list over the page; without it the links stand in a row. */
  .guide__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--block-space-half) var(--inline-space);
  }

  .page-menu {
    position: relative;
    margin-inline-start: auto;
    font-size: var(--size-small);
    letter-spacing: normal;
    line-height: 1.35;
  }

  .page-menu__button {
    --btn-padding: 0.4em 0.9em;
    --icon-size: 1em;

    display: none;

    .js & {
      display: inline-flex;
    }

    .icon--caret-down {
      --icon-size: 0.7em;
    }
  }

  .page-menu__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2em 1em;
    margin: 0;
    padding: 0;
    list-style: none;

    .js & {
      display: none;
      position: absolute;
      inset-block-start: calc(100% + 0.3em);
      inset-inline-end: 0;
      z-index: var(--z-popup);
      inline-size: max-content;
      max-inline-size: min(18rem, calc(100vw - 2 * var(--gutter)));
      padding: 0.35em;
      border-radius: var(--radius-lg);
      background-color: var(--color-canvas);
      box-shadow: var(--shadow-card);
    }

    .js [aria-expanded="true"] + & {
      display: grid;
    }
  }

  .page-menu__item {
    display: grid;
    inline-size: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-link);
    font: inherit;
    text-align: start;
    cursor: pointer;

    small {
      display: none;
    }

    .js & {
      padding: 0.45em 0.7em;
      border-radius: 0.4em;
      color: var(--color-ink);
      font-weight: 600;
      text-decoration: none;

      small {
        display: block;
        color: var(--color-ink-dark);
        font-size: 0.9em;
        font-weight: 400;
      }

      @media (any-hover: hover) {
        &:hover {
          background-color: var(--color-ink-lightest);
        }
      }
    }
  }

  /* Copying needs the script. */
  .page-menu__copy {
    display: none;

    .js & {
      display: block;
    }
  }
}

@layer components {
  /* A screen of the app in a guide, as the marketing site draws one: the app's own rows, states and header at the
     mock's scale, in a frame. */
  .mock {
    --mock-size: calc(var(--font-size) * 0.8);
    --text-x-small: calc(var(--mock-size) * 0.75);
    --text-small: calc(var(--mock-size) * 0.85);
    --text-normal: var(--mock-size);
    --text-medium: calc(var(--mock-size) * 1.1);
    --text-large: calc(var(--mock-size) * 1.3);
    --block-space: calc(var(--mock-size) * 0.65);
    --block-space-half: calc(var(--block-space) / 2);
    --block-space-double: calc(var(--block-space) * 2);
    --rows-margin: 0;
    --rows-bg: var(--color-canvas);

    container-type: inline-size;
    min-inline-size: 0;
    margin: 0.5em 0;
    overflow: hidden;
    border-radius: 0.5em;
    background-color: var(--color-canvas);
    box-shadow: 0 0 0 1px var(--hairline);
    font-size: var(--mock-size);
    letter-spacing: normal;
    line-height: 1.375;

    /* A drawing never moves. Inside the frame's container a button's first style is worked out before the container's
       size, and its transition would fade it in from no colour at all. */
    * {
      transition: none;
    }

    > .rows {
      margin: var(--block-space) 1em;
      padding-inline: 0;
    }

    @container (width < 26em) {
      .row__end--stacked {
        margin-inline-start: auto;
      }
    }
  }

  /* strip.css at the mock's scale: the crumbs at the start, the page's own strong, and a hairline under. */
  .mock__header {
    display: flex;
    align-items: center;
    min-block-size: calc(var(--text-normal) * 3.25);
    padding: 0.5em 1em;
    border-block-end: 1px solid var(--color-ink-lighter);
    font-weight: 700;

    .breadcrumbs {
      flex: 1 1 auto;
      margin-inline: 0;
      font-size: inherit;
    }
  }

  .mock__section {
    margin: 0;
    padding: 0.9em 1em 0;
    color: var(--color-ink-dark);
    font-size: var(--text-small);
    font-weight: 700;
  }

  /* A requirement's page opens on the record's head, centred, its state under the name. */
  .mock .record__header {
    padding: var(--block-space) 1em 0;
  }

  /* The title's phone size at every width: record.css grows it by the window's width, which a mock is far narrower than. */
  .mock .record__title {
    margin: 0;
    font-size: var(--text-large);
  }

  .mock .details,
  .mock .trail {
    margin-inline: 1em;
  }

  .mock .details {
    margin-block-start: var(--block-space);
  }

  /* The details' rem column, in the mock's em. */
  .mock .details--lined .details__row {
    grid-template-columns: 6.5em minmax(0, 1fr);
  }

  .mock__note {
    margin: var(--block-space) 1em 0;
  }

  /* The answer form the app draws, at the mock's scale. */
  .mock__form {
    display: grid;
    justify-items: start;
    gap: 0.9em;
    padding: 1em;
  }

  /* inputs.css and filter-bar.css hold a field at 16px or more on a phone, so iOS does not zoom into it, and Safari's
     with !important. A mock's fields are a drawing at the mock's scale, never focused, so they keep its size. */
  .mock .input {
    font-size: var(--text-x-small) !important;
  }

  .mock__date {
    display: block;
    min-inline-size: 8em;
    min-block-size: 2.4em;
  }

  .mock__field {
    display: grid;
    gap: 0.35em;
  }

  .mock__field--wide {
    justify-self: stretch;
  }

  .mock__area {
    display: block;
    min-block-size: 4.5em;
  }

  .mock__placeholder {
    color: var(--color-ink-dark);
  }

  /* What the step has the reader tap, ringed in the colour of a link: around a button or a field, inside a box or a
     row. */
  .mock__tap {
    border-radius: 0.5em;
    outline: 2px solid var(--color-link);
    outline-offset: 2px;
    box-shadow: 0 0 0 0.4em color-mix(in oklch, var(--color-link) 15%, transparent);
  }

  :is(.row, .tool, .trail__entry).mock__tap {
    outline-offset: -2px;
    box-shadow: inset 0 0 0 0.4em color-mix(in oklch, var(--color-link) 12%, transparent);
  }

  .trail__entry.mock__tap {
    padding-inline: 0.4em;
  }

  /* site-header.css at the mock's scale: the sections centred, Mensajes at the end, a hairline under. */
  .mock__nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0.5em 1em;
    border-block-end: 1px solid var(--color-ink-lighter);
    font-size: var(--text-small);
  }

  .mock__nav-links {
    display: flex;
    grid-column: 2;
    gap: 0.5em;
  }

  .mock__nav-link {
    padding: 0.35em 0.6em;
  }

  .mock__nav-messages {
    justify-self: end;
  }

  .mock__header .mock__title {
    flex: 1 1 auto;
    font-size: var(--text-medium);
    text-align: center;
  }

  /* The header's buttons, a glyph and its label, at the end. */
  .mock__actions {
    display: flex;
    flex: none;
    gap: 0.5em;
    font-size: var(--text-small);
    font-weight: 400;
  }

  /* buttons.css's btn--circle-mobile, at the width of a phone's screen in the mock: the glyph alone, in a circle. */
  @container (width < 40em) {
    .mock__action {
      --btn-padding: 0;

      display: grid;
      place-items: center;
      inline-size: 2.6em;
      aspect-ratio: 1;

      > span:not(.icon) {
        display: none;
      }
    }
  }

  .mock__heading {
    margin: 0;
    font-size: var(--text-medium);
    font-weight: 700;
  }

  .mock__text {
    margin: 0;
  }

  .mock__box {
    display: block;
    min-inline-size: 8em;
    min-block-size: 2.4em;
  }

  /* contractors/batches: each row its boxes side by side, then the red button that takes it out. */
  .mock .mock__batch {
    display: grid;
    gap: 0.5em;
    justify-self: stretch;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .mock__batch-row {
    display: flex;
    align-items: center;
    gap: 0.5em;

    .btn--circle {
      --btn-size: 2em;

      flex: none;
    }
  }

  .mock__batch-fields {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 0.5em;

    .mock__box {
      flex: 1 1 7em;
      min-inline-size: 0;
    }
  }

  /* A question of a course: its number in the margin, then the box with what it asks and its options. */
  .mock__question {
    display: grid;
    grid-template-columns: 1.5em minmax(0, 1fr);
    gap: 0.5em;
    justify-self: stretch;
  }

  .mock__question-number {
    color: var(--color-ink-dark);
    font-weight: 700;
  }

  .mock__question-box {
    display: grid;
    justify-items: start;
    gap: 0.4em;
  }

  /* A firm's page: its head, then its boxes as tools.css draws them, as many to a line as fit. */
  .mock .project__header {
    padding: var(--block-space) 1em;
  }

  .mock .project__title {
    font-size: var(--text-large);
  }

  @container (width >= 30em) {
    .mock__tools {
      grid-template-columns: repeat(auto-fill, minmax(14em, 1fr));
    }
  }

  .mock .tool {
    padding: var(--block-space) 1em;
  }

  /* A conversation: the firm over its messages, each with its author's initials, then the box to write in. */
  .mock__thread {
    margin: 0;
    padding: 0.9em 1em 0;
    font-size: var(--text-medium);
    font-weight: 700;
  }

  .mock__messages {
    display: grid;
    gap: 0.9em;
    padding: 0.9em 1em;
  }

  .mock__message {
    display: grid;
    grid-template-columns: 2.2em minmax(0, 1fr);
    gap: 0.6em;
    align-items: start;

    p {
      margin: 0;
    }
  }

  .mock .avatar {
    --avatar-size: 2.2em;

    font-size: var(--text-x-small);
  }

  .mock__message-meta time {
    color: var(--color-ink-dark);
    font-size: var(--text-x-small);
  }

  .mock__composer {
    padding: 0 1em 1em;

    .icon {
      flex: none;
    }
  }

  /* The panel of what is waiting, over the button at the foot of the screen that opens it. */
  .mock__tray {
    margin: 1em 1em 0;
    padding: 0.75em;
    border-radius: 0.5em;
    background-color: var(--color-ink-lightest);
  }

  .mock__tray-title {
    margin: 0 0 0.5em;
    font-weight: 700;
  }

  .mock__tray-items {
    display: grid;
    gap: 0.4em;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .mock__tray-item {
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.6em 0.75em;
    border-radius: 0.5em;
    background-color: var(--color-canvas);
    font-size: var(--text-small);

    .icon {
      flex: none;
    }
  }

  .mock__tray-toggle {
    display: flex;
    justify-content: center;
    padding: 0.75em 1em 1em;
  }

  /* An entry's verdict, its banner at the mock's own scale: the app's floor is in rem, which a miniature cannot hold. */
  .mock__verdict {
    padding: 1em;

    .verdict__decision {
      font-size: var(--text-xx-large);
    }

    .verdict__party .rows {
      padding-inline: 0;
    }
  }

  /* A person's card, set in from the frame as the page sets it. */
  .mock__card {
    padding: 1em;

    .credential {
      --credential-photo-size: 2.6em;

      margin: 0;
    }

    .credential__name {
      font-size: var(--text-large);
    }
  }

  .mock__site-state {
    padding-inline: 0.2em;
  }

  /* A screenshot of the app, taken in its light theme: a hairline keeps its white apart from a dark page. One not taken
     yet shows what it would. */
  .capture {
    margin: 0.5em 0;

    img {
      display: block;
      max-inline-size: 100%;
      block-size: auto;
      border-radius: 0.5em;
      box-shadow: 0 0 0 1px var(--hairline);
    }
  }

  .capture--missing {
    padding: 1em;
    border: 1px dashed var(--color-ink-medium);
    border-radius: 0.5em;
    color: var(--color-ink-dark);
    font-size: var(--size-small);

    p {
      margin: 0;
    }
  }
}
