@layer base {
  /* 16px, the browser's own, scaled by Text size (Settings > Appearance, or a person's own in Your
  /* account). In rem, so a browser set to larger text makes Runwell larger too. Every size in the
  /* stylesheets is rem or em from here. Text runs on shadcn/ui's scale: the body at 14px
  /* (--text-normal), meta at 12–13px, headings from 16px (_global.css). */
  html {
    font-size: calc(1rem * var(--text-scale, 1));
  }

  :root[data-text-size="small"] { --text-scale: 0.875; }
  :root[data-text-size="large"] { --text-scale: 1.125; }
  :root[data-text-size="larger"] { --text-scale: 1.25; }

  body {
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: none;
    background: var(--color-canvas);
    color: var(--color-ink);
    font-family: var(--font-sans);
    font-size: var(--text-normal);
    font-feature-settings: "cv11", "ss01";
    font-optical-sizing: auto;
    interpolate-size: allow-keywords;
    line-height: 1.45;
    max-inline-size: 100vw;
    scroll-behavior: auto;
    text-rendering: optimizeLegibility;
    text-size-adjust: none;
  }

  a {
    text-decoration: none;

    &:not([class]) {
      color: var(--color-link);
      text-decoration: underline;
      text-decoration-skip-ink: auto;
    }
  }

  :is(a, button, input, textarea, .switch, .btn) {
    transition: 100ms ease-out;
    transition-property: background-color, border-color, box-shadow, outline;
    touch-action: manipulation;

    /* Keyboard navigation */
    &:where(:focus-visible) {
      border-radius: calc(0.25ch * var(--radius-scale, 1));
      outline: var(--focus-ring-size) solid var(--focus-ring-color);
      outline-offset: var(--focus-ring-offset);
    }

    /* Default disabled styles */
    &:where([disabled]) {
      cursor: not-allowed;
      opacity: 0.5;
      pointer-events: none;
    }
  }

  ::selection {
    background: var(--color-selected);

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

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

  :where(ul, ol):where([role="list"]) {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  /* Key hints: a small, quiet keycap. */
  kbd {
    border: 1px solid color-mix(in oklch, currentColor 22%, transparent);
    border-radius: calc(0.25rem * var(--radius-scale, 1));
    font-family: var(--font-sans);
    font-size: 0.72em;
    font-weight: 500;
    line-height: 1.5;
    min-inline-size: 1.6em;
    opacity: 0.65;
    padding: 0 0.35em;
    text-align: center;
    text-transform: uppercase;
    vertical-align: middle;
    white-space: nowrap;
  }

  video {
    max-inline-size: 100%;
  }

  /* Printing */
  @page {
    margin: 1in;
  }

  @media print {
    .no-print {
      display: none;
    }
  }

  /* Turbo */
  turbo-frame,
  turbo-cable-stream-source {
    display: contents;
  }

  .turbo-progress-bar {
    visibility: hidden;
  }

  /* Nicer scrollbars on Chrome 29+. This is intended for Windows machines, but */
  /* there's not a way to target Windows using CSS, so Chrome on Mac will have */
  /* slightly thinner scrollbars than normal. #C1C1C1 is the default color on Macs. */
  @media screen and (-webkit-min-device-pixel-ratio:0) and (min-resolution:.001dpcm) {
    * {
      scrollbar-color: #C1C1C1 transparent;
      scrollbar-width: thin;
    }
  }
}
