/* Fuentes alojadas en el propio sitio (licencia OFL, ver fonts/OFL-licenses.txt). Solo se descargan las que una app usa. */
@font-face { font-family: "Big Shoulders"; font-weight: 400; font-style: normal; font-display: swap; src: url("./fonts/BigShoulders-Regular.ttf") format("truetype"); }
@font-face { font-family: "Big Shoulders"; font-weight: 700; font-style: normal; font-display: swap; src: url("./fonts/BigShoulders-Bold.ttf") format("truetype"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 400; font-style: normal; font-display: swap; src: url("./fonts/BricolageGrotesque-Regular.ttf") format("truetype"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 700; font-style: normal; font-display: swap; src: url("./fonts/BricolageGrotesque-Bold.ttf") format("truetype"); }
@font-face { font-family: "DM Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("./fonts/DMMono-Regular.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("./fonts/IBMPlexMono-Regular.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 700; font-style: normal; font-display: swap; src: url("./fonts/IBMPlexMono-Bold.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Serif"; font-weight: 400; font-style: normal; font-display: swap; src: url("./fonts/IBMPlexSerif-Regular.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Serif"; font-weight: 700; font-style: normal; font-display: swap; src: url("./fonts/IBMPlexSerif-Bold.ttf") format("truetype"); }
@font-face { font-family: "Instrument Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("./fonts/InstrumentSans-Regular.ttf") format("truetype"); }
@font-face { font-family: "Instrument Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("./fonts/InstrumentSans-Bold.ttf") format("truetype"); }
@font-face { font-family: "Outfit"; font-weight: 400; font-style: normal; font-display: swap; src: url("./fonts/Outfit-Regular.ttf") format("truetype"); }
@font-face { font-family: "Outfit"; font-weight: 700; font-style: normal; font-display: swap; src: url("./fonts/Outfit-Bold.ttf") format("truetype"); }
@font-face { font-family: "Red Hat Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("./fonts/RedHatMono-Regular.ttf") format("truetype"); }
@font-face { font-family: "Red Hat Mono"; font-weight: 700; font-style: normal; font-display: swap; src: url("./fonts/RedHatMono-Bold.ttf") format("truetype"); }
@font-face { font-family: "Tektur"; font-weight: 400; font-style: normal; font-display: swap; src: url("./fonts/Tektur-Regular.ttf") format("truetype"); }
@font-face { font-family: "Tektur"; font-weight: 500; font-style: normal; font-display: swap; src: url("./fonts/Tektur-Medium.ttf") format("truetype"); }
@font-face { font-family: "Work Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("./fonts/WorkSans-Regular.ttf") format("truetype"); }
@font-face { font-family: "Work Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("./fonts/WorkSans-Bold.ttf") format("truetype"); }
@font-face { font-family: "Young Serif"; font-weight: 400; font-style: normal; font-display: swap; src: url("./fonts/YoungSerif-Regular.ttf") format("truetype"); }

/* Base compartida: tokens y componentes mínimos. Cada app define su acento en :root. */
:root {
  --ink: #15192b;
  --ink-soft: #4a5170;
  --paper: #edf1f7;
  --surface: #ffffff;
  --line: #c9d1e2;
  --accent: #3640c9;
  --accent-ink: #ffffff;
  --plus: #0b7a52;
  --minus: #a81f55;
  --focus: #1a73e8;
  --radius: 10px;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-figure: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8ecf8;
    --ink-soft: #a6aecd;
    --paper: #0f1324;
    --surface: #181d33;
    --line: #2d3558;
    --accent: #8b94ff;
    --accent-ink: #0f1324;
    --plus: #4fd1a1;
    --minus: #ff8fb5;
    --focus: #8ab4f8;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--font-body);
}

h1, h2 { font-family: var(--font-figure); font-weight: 600; line-height: 1.2; margin: 0 0 0.6rem; }
h1 { font-size: 1.7rem; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; }
p { margin: 0 0 0.75rem; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 0.25rem; }
input[type="text"], input[type="number"], select {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.7rem;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
legend { font-size: 0.9rem; font-weight: 600; padding: 0; margin-bottom: 0.3rem; }

button {
  min-height: 44px;
  padding: 0.5rem 1rem;
  font: inherit;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.danger { background: var(--minus); color: var(--paper); border-color: var(--minus); }
button.ghost { background: transparent; }
button:hover { filter: brightness(0.97); }

.hint { font-size: 0.85rem; color: var(--ink-soft); }
.note { padding: 0.6rem 0.8rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.note.error { border-color: var(--minus); }
.note.ok { border-color: var(--plus); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Anuncios y consentimiento (solo aparecen si hay configuración real) */
.ad-box { margin: 1.5rem 0; min-height: 90px; }

.consent { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 0.9rem 1rem; display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; background: var(--surface); border-top: 2px solid var(--ink); }
.consent p { flex: 1 1 100%; margin: 0; font-size: 0.9rem; }

/* Instalación como app */
.install-link { min-height: 36px; padding: 0.15rem 0.7rem; font-size: 0.85rem; margin-left: 0.4rem; }
.install-dialog { max-width: min(92vw, 420px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 1.25rem; }
.install-dialog::backdrop { background: rgba(0, 0, 0, 0.5); }
.install-dialog ol { padding-left: 1.2rem; }

/* Respaldo de datos y botones de archivo (común a las apps) */
.backup { margin: 2rem 0 1rem; } .backup summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.attach { position: relative; cursor: pointer; } .attach input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.attach:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.ad-label { display: block; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 0.25rem; }
.linklike { background: none; border: 0; padding: 0; min-height: 0; color: var(--accent); text-decoration: underline; font: inherit; cursor: pointer; }
.more-tools { margin: 2rem 0 1rem; }
.more-tools ul { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.more-tools a { display: block; padding: 0.7rem 0.9rem; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; min-height: 44px; }
.more-tools strong { display: block; }
.more-tools span { font-size: 0.85rem; color: var(--ink-soft); }
.share-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 1rem; }
.consent a { color: var(--accent); }
