@font-face {
  font-family: "Open Sans";
  src: url("../fonts/OpenSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Open Sans";
  src: url("../fonts/OpenSans-Semibold.ttf") format("truetype");
  font-weight: 600 700;
  font-display: swap;
}

@font-face {
  font-family: "Material Icons";
  src: url("../fonts/MaterialIcons-Regular.ttf") format("truetype");
  font-display: block;
}

:root {
  color-scheme: light;

  --brand: #00a6bd;
  --brand-strong: #007e91;
  --brand-deep: #063c45;
  --brand-soft: #e2f5f8;
  --brand-on-soft: #006a7a;
  --brand-gradient: linear-gradient(135deg, #00a6bd 0%, #007e91 100%);

  --success: #1fa971;
  --success-soft: #e4f6ee;
  --success-on-soft: #0b6b47;
  --warning: #e8920c;
  --warning-soft: #fbf0da;
  --warning-on-soft: #8a5a06;
  --danger: #e5484d;
  --danger-strong: #c13238;
  --danger-soft: #fbe7e8;
  --danger-on-soft: #b42318;
  --info-soft: #e6f0fe;
  --info-on-soft: #1b5fbf;

  --canvas: #f4f6f8;
  --surface: #ffffff;
  --surface-alt: #eef2f4;
  --outline: #e3e9ec;
  --outline-strong: #cfd8dd;
  --text: #10191d;
  --text-muted: #56666d;
  --text-subtle: #6f7f86;

  --shadow-sm: 0 1px 2px rgb(16 25 29 / 6%);
  --shadow-md: 0 8px 24px rgb(16 25 29 / 8%);
  --shadow-lg: 0 24px 60px rgb(16 25 29 / 18%);

  --row-hover: color-mix(in srgb, var(--brand) 5%, var(--surface));
  --avatar-shade: #000;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --font: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;

  --sidebar-width: 264px;
  --sidebar-rail-width: 76px;
  --bottom-nav-height: 64px;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --brand: #22bdd2;
  --brand-strong: #54d0e0;
  --brand-soft: #13262b;
  --brand-on-soft: #54d0e0;

  --success-soft: #10291f;
  --success-on-soft: #5fd3a4;
  --warning-soft: #2c220f;
  --warning-on-soft: #f0b860;
  --danger-soft: #2e1416;
  --danger-on-soft: #f58b8e;
  --info-soft: #101f33;
  --info-on-soft: #7fb2f7;

  --canvas: #0d0e10;
  --surface: #17181c;
  --surface-alt: #212227;
  --outline: #2a2b30;
  --outline-strong: #393a40;
  --text: #f3f4f6;
  --text-muted: #a3a7ae;
  --text-subtle: #8a8e96;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 40%);
  --shadow-md: 0 8px 24px rgb(0 0 0 / 40%);
  --shadow-lg: 0 24px 60px rgb(0 0 0 / 60%);

  --row-hover: color-mix(in srgb, var(--brand) 9%, var(--surface));
  --avatar-shade: #fff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --brand: #22bdd2;
    --brand-strong: #54d0e0;
    --brand-soft: #13262b;
    --brand-on-soft: #54d0e0;

    --success-soft: #10291f;
    --success-on-soft: #5fd3a4;
    --warning-soft: #2c220f;
    --warning-on-soft: #f0b860;
    --danger-soft: #2e1416;
    --danger-on-soft: #f58b8e;
    --info-soft: #101f33;
    --info-on-soft: #7fb2f7;

    --canvas: #0d0e10;
    --surface: #17181c;
    --surface-alt: #212227;
    --outline: #2a2b30;
    --outline-strong: #393a40;
    --text: #f3f4f6;
    --text-muted: #a3a7ae;
    --text-subtle: #8a8e96;

    --shadow-sm: 0 1px 2px rgb(0 0 0 / 40%);
    --shadow-md: 0 8px 24px rgb(0 0 0 / 40%);
    --shadow-lg: 0 24px 60px rgb(0 0 0 / 60%);

    --row-hover: color-mix(in srgb, var(--brand) 9%, var(--surface));
    --avatar-shade: #fff;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

/* En pantallas táctiles, el dedo no debe mover la página detrás de un diálogo o una hoja. */
@media (pointer: coarse) {
  html:has(dialog[open]),
  html:has(.sheet) {
    overflow: hidden;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.45rem, 1.2rem + 1vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h1:focus {
  outline: none;
}

h2 {
  font-size: 1.05rem;
  font-weight: 600;
}

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

code {
  font-family: var(--mono);
  font-size: 0.875em;
}

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

.icon {
  font-family: "Material Icons";
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  display: inline-block;
  white-space: nowrap;
  font-feature-settings: "liga";
  -webkit-font-feature-settings: "liga";
  font-style: normal;
  letter-spacing: normal;
  text-transform: none;
  flex-shrink: 0;
  user-select: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
