/* Q'Ocupa Design System V6 «Signature» (QOC-75, docs/DESIGN_SYSTEM_V6.md §2), on the names of Design System 5
   (QOC-58, docs/DESIGN_SYSTEM_V5.md): the tokens, and the only stylesheet that may write a
   colour, a font size, a radius or a shadow as a literal. Every other sheet reads these names.

   Linked first by every page (``ui._document``). Three scopes, one set of names:
   - ``:root`` and the classic panel (``.app:not(.grafito)``: Q'Ocupa's own platform and the accountant's cockpit)
     take the light values;
   - ``.grafito`` (a business's screens, dark by default) and ``.ktv`` (the kitchen TV, always dark) the dark ones;
   - ``.grafito.marfil`` (a business that chose the light variant) the light ones again.
   V6: the side menu (``--q-rail*``) follows its theme (sand in Marfil, deeper than the ground in Grafito). ``.grafito.g-big`` («A+») moves the type scale one step up.

   Names beyond the spec's table, each for one need the spec states: ``--q-*-text`` (a state or the accent written as
   text on a surface, AA in both themes), ``--q-on-state`` (text on a solid state fill), ``--q-focus`` (the accent ring,
   3:1 on its ground), ``--q-accent-hover``, the rail, ``--q-scrim`` (the shade under a sheet), ``--q-paper`` and
   ``--q-ink`` (paper, a QR code and a print preview: white and black in every theme), the control heights and
   ``--q-ease``, and ``--q-fs-control`` (the text typed in a field: 16 px on a touch screen, so a phone never zooms). */

/* ------------------------------------------------------------------ type: Geist and Geist Mono, SIL OFL 1.1 */
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
             src: url("/static/fonts/geist-variable.woff2") format("woff2-variations"), url("/static/fonts/geist-variable.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap;
             src: url("/static/fonts/geist-mono-variable.woff2") format("woff2-variations"), url("/static/fonts/geist-mono-variable.woff2") format("woff2"); }

/* V6 (QOC-75): Instrument Serif, SIL OFL 1.1, for the greeting alone (docs/DESIGN_SYSTEM_V6.md §2). Latin subset. */
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
             src: url("/static/fonts/instrument-serif-latin.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
             src: url("/static/fonts/instrument-serif-italic-latin.woff2") format("woff2"); }

/* ------------------------------------------------------------------ the same in every theme */
/* The height of what is visible. ``100vh`` is the LARGE viewport: on Firefox for Android with its address bar showing
   (the Las Fresas HiPOS, 2026-12-01) it is 696 px where 576 px are visible, so a panel sized with it is 120 px
   too tall and its foot (the account's buttons, the menu's end) is out of reach. ``100dvh`` is what is visible, now. */
:root { --q-vh: 100vh; }
@supports (height: 100dvh) { :root { --q-vh: 100dvh; } }

:root, .app, .grafito, .ktv {
  --q-font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --q-mono: "Geist Mono", ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --q-brand: "Poppins", var(--q-font);
  --q-serif: "Instrument Serif", Georgia, "Times New Roman", serif;

  /* V6: one scale of seven steps (12.5 · 13.5 · 14 · 16.5 · 20 · 25 · 38), kept on DS5's names so no sheet moves.
     14 is the body; the old 15 joins it; 18 (a section) is 16.5, 22 (a page) is 20, 28 (a figure) is 25. 38 is the
     greeting alone, in Instrument Serif (wave A2). */
  /* V6 A6 (the owner, 2026-11-27: «la letra es diminuta»): the three small steps one step up — 13 · 14 · 15 px. */
  --q-fs-12: .8125rem; --q-fs-13: .875rem; --q-fs-14: .9375rem; --q-fs-15: .9375rem;
  /* What sits on a photograph (the trade's photo on Inicio): white words over a dark wash, in both themes. */
  --q-photo-ink: #FFFFFF; --q-photo-wash: rgb(0 0 0 / .74); --q-photo-wash-soft: rgb(0 0 0 / .12);
  --q-photo-shadow: rgb(0 0 0 / .35);
  --q-fs-18: 1.03125rem; --q-fs-22: 1.25rem; --q-fs-28: 1.5625rem; --q-fs-38: 2.375rem;
  /* What a field shows as it is typed: the body size, 16 px on a touch screen so a phone does not zoom in. */
  --q-fs-control: var(--q-fs-14);

  /* V6 radii: 9 for buttons and fields (the name «8» kept), 12 for cards and tiles, 14 for panels (the name «16»). */
  --q-r-6: 6px; --q-r-8: 9px; --q-r-12: 12px; --q-r-16: 14px; --q-r-full: 999px;

  /* Controls: sm, md and lg; nothing a finger taps on a phone is under 44 px. */
  --q-h-sm: 30px; --q-h-md: 36px; --q-h-lg: 48px; --q-touch: 44px;

  /* V6 motion: only an answer to the person (hover, press) and a 0.2 s cross-fade; nothing loops (§2). */
  --q-fast: 120ms; --q-base: 200ms; --q-ease: cubic-bezier(.2, 0, 0, 1);

  /* DS5 density (QOC-58): a field is as wide as what it holds, never the whole row on a wide screen. The width of
     what is typed; --q-w-pad is the control's own padding and border around it (components.css, «DS5 density»). */
  --q-w-num: 14ch;     /* an amount, a count, a percentage */
  --q-w-id: 14ch;      /* a cédula, a phone */
  --q-w-date: 15ch;    /* a date, a time, a month, with the browser's picker */
  --q-w-name: 30ch;    /* a person's or a business's name, an e-mail */
  --q-w-search: 32ch;  /* a search box */
  --q-w-select: 28ch;  /* the longest choice a list may show before it is cut */
  --q-w-text: 40ch;    /* any other line of text */
  --q-w-note: 60ch;    /* a note of several lines */
  --q-w-pad: 2rem;

  --q-accent: #FFC400; --q-on-accent: #16171A;
  --q-paper: #FFFFFF; --q-ink: #000000;
}
/* A finger: on a touch screen and on a phone every control is 44 px at least. */
@media (pointer: coarse), (max-width: 47.99rem) {
  :root, .app, .grafito, .ktv { --q-h-sm: 44px; --q-h-md: 44px; --q-fs-control: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  :root, .app, .grafito, .ktv { --q-fast: 0ms; --q-base: 0ms; }
}
/* A phone (under 40 rem): a field takes the whole width of its column. */
@media (max-width: 39.99rem) {
  :root, .app, .grafito, .ktv { --q-w-num: 100%; --q-w-id: 100%; --q-w-date: 100%; --q-w-name: 100%; --q-w-search: 100%;
                                --q-w-select: 100%; --q-w-text: 100%; --q-w-note: 100%; }
}

/* ------------------------------------------------------------------ light: the classic panel, Marfil, the public site
   (.grafito.marfil outranks .grafito below by one class) */
:root, .app:not(.grafito), .grafito.marfil {
  /* V6 Marfil: paper, warm sand at the side; the side menu is light too (§2). */
  --q-bg: #F4F1EA; --q-surface: #FFFEFB; --q-raised: #FAF7F1; --q-hover: #F1EEE8;
  --q-line: #E3DDD1; --q-line-2: #D3CBBC;
  --q-text: #202329; --q-muted: #5B5F68; --q-faint: #6B6E75;
  --q-accent-soft: #FFF4CC; --q-accent-hover: #F2B900; --q-accent-text: #8A6100; --q-focus: #B38600;
  --q-ok: #1C8757; --q-ok-soft: #E3F2EA; --q-ok-text: #166C46;
  --q-warn: #A86A12; --q-warn-soft: #FBF0DC; --q-warn-text: #8A5300;
  --q-bad: #CC2F35; --q-bad-soft: #FCE8E8; --q-bad-text: #AF252B;
  --q-info: #2F62D1; --q-info-soft: #E7EEFC; --q-info-text: #2552B8;
  --q-on-state: #FFFFFF;
  --q-scrim: rgb(13 14 17 / .45);
  --q-shadow-1: 0 1px 2px rgb(32 35 41 / .05), 0 12px 28px -18px rgb(32 35 41 / .25);
  --q-shadow-2: 0 4px 12px rgb(32 35 41 / .1), 0 24px 60px rgb(32 35 41 / .18);
  --q-highlight: rgb(255 255 255 / .9);
  --q-rail: #ECE7DD; --q-rail-hover: #E3DCCF; --q-rail-line: #DDD6C9; --q-rail-text: #5B5F68; --q-rail-strong: #202329;
}

/* ------------------------------------------------------------------ dark: Grafito, the kitchen TV */
.grafito, .ktv {
  /* V6 Grafito: warm graphite; the side menu is deeper than the ground (§2). */
  --q-bg: #111113; --q-surface: #1A1A1D; --q-raised: #232327; --q-hover: #2A2A2F;
  --q-line: #2B2B30; --q-line-2: #3B3B42;
  --q-text: #F1F2F4; --q-muted: #A9AEB7; --q-faint: #8A9099;
  --q-accent-soft: rgb(255 196 0 / .14); --q-accent-hover: #FFD033; --q-accent-text: #FFC400; --q-focus: #FFC400;
  --q-ok: #3DB37E; --q-ok-soft: rgb(61 179 126 / .15); --q-ok-text: #5CC896;
  --q-warn: #E3A13B; --q-warn-soft: rgb(227 161 59 / .15); --q-warn-text: #EDB25C;
  --q-bad: #E5484D; --q-bad-soft: rgb(229 72 77 / .15); --q-bad-text: #F07A7E;
  --q-info: #6E9CF5; --q-info-soft: rgb(110 156 245 / .15); --q-info-text: #8DB2F8;
  --q-on-state: #111113;
  --q-scrim: rgb(0 0 0 / .6);
  --q-shadow-1: inset 0 1px 0 rgb(255 255 255 / .035), 0 1px 2px rgb(0 0 0 / .45), 0 12px 30px -18px rgb(0 0 0 / .8);
  --q-shadow-2: 0 4px 12px rgb(0 0 0 / .5), 0 24px 64px rgb(0 0 0 / .55);
  --q-highlight: rgb(255 255 255 / .045);
  --q-rail: #0B0B0D; --q-rail-hover: #1E1E22; --q-rail-line: #1E1E22; --q-rail-text: #A9AEB7; --q-rail-strong: #F1F2F4;
}
/* V6 (QOC-75, docs/DESIGN_SYSTEM_V6.md §2): each trade's identity tint, named by the catalog (module_media.json
   «tint»). It marks identity only — the business mark, the module's icons, the work surface's top line, a soft glow;
   the accent keeps its four uses and the states never change by module. Without a tint the accent stands in. */
/* The same identity tints by name, for the public site (QOC-75 A5: the home page's trades and groups). */
:root { --q-tint-terracota: #F26B3A; --q-tint-canela: #B98A5E; --q-tint-verde-agua: #38C3A8; --q-tint-lima: #A3D94C;
        --q-tint-amarillo: #FFC400; --q-tint-violeta: #A77BFF; --q-tint-rosa: #E9546B; --q-tint-azul: #4C8DFF; }
:root, .app { --q-mod: var(--q-accent); --q-mod-ink: var(--q-accent-text);
               --q-mod-soft: color-mix(in srgb, var(--q-accent) 16%, transparent); }
.grafito { --q-mod: var(--q-accent); --q-mod-ink: var(--q-accent-text); }
.grafito .tint-terracota { --q-mod: #F26B3A; } .grafito .tint-rosa { --q-mod: #E9546B; }
.grafito .tint-verde-agua { --q-mod: #38C3A8; } .grafito .tint-orquidea { --q-mod: #EE77C1; }
.grafito .tint-acero { --q-mod: #8FA3BC; } .grafito .tint-celeste { --q-mod: #39B7F0; }
.grafito .tint-lima { --q-mod: #A3D94C; } .grafito .tint-canela { --q-mod: #B98A5E; }
.grafito .tint-azul { --q-mod: #4C8DFF; } .grafito .tint-violeta { --q-mod: #A77BFF; }
.grafito [class*="tint-"] { --q-mod-ink: var(--q-mod); --q-mod-soft: color-mix(in srgb, var(--q-mod) 16%, transparent); }
.grafito.marfil [class*="tint-"] { --q-mod-ink: color-mix(in srgb, var(--q-mod) 58%, #000000); }
.grafito { --q-mod-soft: color-mix(in srgb, var(--q-mod) 16%, transparent); }

/* «A+» on a business's screens: the type one step up, the shapes in their place. */
.grafito.g-big {
  --q-fs-12: .875rem; --q-fs-13: .9375rem; --q-fs-14: 1rem; --q-fs-15: 1rem; --q-fs-18: 1.125rem; --q-fs-22: 1.375rem;
  --q-fs-28: 1.75rem;
}

/* Old engines without color-mix() (Chrome 81, the HiPOS): the trade's soft tint falls back to the accent's soft one and
   the Marfil ink to the text, instead of no colour at all. Modern browsers skip this block. */
@supports not (color: color-mix(in srgb, red, red)) {
  :root, .app, .grafito, .grafito [class*="tint-"] { --q-mod-soft: var(--q-accent-soft); }
  .grafito.marfil [class*="tint-"] { --q-mod-ink: var(--q-text); }
}
