/* The one source of truth for colour, radius and type, loaded first on every page: the public
   site, the panel and the admin area. Change a value here and all three follow. Component CSS
   only ever says var(--name). The values and how to use them: MINIAPPS-DESIGN.md.

   --app is the grey behind everything, --bg the page surface, --panel a card on it.
   Light is the default. Dark is one choice for the public site and the panel alike: data-theme="dark"
   on <html>, set by templates/_theme_head.html and static/js/theme.js. The admin area stays light. */

:root {
  --app: #ECE9E3; --bg: #FDFCFA; --panel: #FFFFFF; --field: #F4F2EE; --raise: #ECE9E3; --border: #E8E5DF; --border-2: #D6D1C8;
  --group: #F6F4F0;
  --text: #1D1B19; --muted: #625D57; --dim: #76716A; --ink: #FFFFFF; --text-hover: #3A3733;
  /* Pressing on the grey ground: a shade of whatever is underneath. */
  --hover: rgba(0, 0, 0, .035); --soft-fill: rgba(0, 0, 0, .05);

  /* Blue. --accent is for fills and marks, --accent-text passes 4.5:1 on every surface here. */
  --accent: #1F7FBF; --accent-text: #1A6AA1; --accent-soft: #E6F1F8;
  /* Telegram blue from the logo: data and the brand mark, never words. */
  --brand: #2AABEE;
  /* Data colours, always beside a label. Telegram blue first. */
  --d1: #2AABEE; --d2: #2FB5A0; --d3: #F2B23E; --d4: #8C6FE8; --d5: #D6D1C8;
  /* One hue in steps, for the heatmap. Lightest to strongest. */
  --heat-0: #F1EFEA; --heat-1: #DCEFFB; --heat-2: #B5DFF8; --heat-3: #7FC8F3; --heat-4: #45AFEC; --heat-5: #1F86C9;
  /* Older charts: the same blue in steps. */
  --ramp-1: #1F7FBF; --ramp-2: #6BA9D6; --ramp-3: #A7CAE3; --ramp-4: #D0DFE8; --ramp-5: #D6D1C8; --ramp-6: #E8E5DF;
  --area: rgba(42, 171, 238, .1);
  --area-1: #2AABEE; --area-2: #BFE5FA;

  /* State. --good marks, --good-text words. Soft pills are a tint and a dark word. */
  --good: #2C9E6A; --good-text: #1B7A4E; --good-soft: #E0F4E9;
  --bad: #BC352B; --bad-soft: #FBE4E1;
  --warn: #8A5F12; --warn-soft: #FAF0D9;
  --scrim: rgba(33, 31, 29, .36);

  /* The chat wallpaper. --wall is the hero's ground, --wall-ink its drawings; --doodle the same
     drawings on the panel's grey frame, barely there. The drawings are a mask, so these set the colour. */
  --wall: #CFE5E0; --wall-ink: rgba(36, 96, 92, .2); --doodle: rgba(70, 62, 44, .055);
  /* A hairline round a logo. Nothing in light; in dark it stops a black logo melting into the page. */
  --logo-edge: transparent;
  --doodles: url("/static/img/doodles.svg"); --doodle-size: 440px;

  /* Radius: cards, controls, soft insets, tables inside a group card, pills. */
  --r-card: 14px; --r: 8px; --r-sm: 10px; --r-inner: 11px; --r-pill: 20px;

  /* Type. Big light titles, 13 to 14px interface text, numbers a little heavier. */
  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-features: 'cv02', 'cv03', 'cv04', 'cv11', 'ss01';
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --t-hero: clamp(32px, 3.6vw, 46px);
  --t-title: clamp(26px, 2.6vw, 32px);
  --t-section: 22px;
  --t-card: 14px;
  --t-ui: 13.5px;
  --t-small: 13px;
  --t-micro: 12.5px;
  --t-num: 26px;
  --t-read: 16px;
  --w-title: 400; --w-num: 500; --w-strong: 500;
  --ls-title: -.024em; --ls-section: -.018em; --ls-num: -.024em;

  /* Older names, so every older component follows. New CSS uses the names above. */
  --black: var(--text); --g900: var(--text); --g700: var(--text-hover); --g600: var(--muted); --g500: var(--muted);
  --g400: var(--dim); --g300: var(--border-2); --g200: var(--border); --g100: var(--field); --g50: var(--group);
  --white: var(--panel); --line: var(--border); --paper: var(--field); --slate: var(--group); --cream: var(--field); --amber: var(--warn-soft);
  --ton: var(--accent-text); --red: var(--bad); --green: var(--good-text);
  --tint-cream: var(--group); --tint-blue: var(--accent-soft); --tint-sage: var(--group); --tint-neutral: var(--group);
  --bd-cream: var(--border); --bd-blue: var(--border); --bd-sage: var(--border); --bd-neutral: var(--border);
  --r-btn: var(--r); --r-card-lg: var(--r-card); --r-lg: var(--r-card);
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --app: #100F0D; --bg: #181614; --panel: #1E1C19; --field: #26231F; --raise: #2E2A26; --border: #322E29; --border-2: #4A443C;
  --group: #1C1A17;
  --text: #EDE9E3; --muted: #B4AEA6; --dim: #A29C94; --ink: #1B1815; --text-hover: #D8D3CC;
  --hover: rgba(255, 255, 255, .05); --soft-fill: rgba(255, 255, 255, .06);
  --accent: #4FA8E3; --accent-text: #6CBAEE; --accent-soft: #1B2E3B;
  --brand: #45B4F0;
  --d1: #45B4F0; --d2: #3FBFAB; --d3: #E9B04C; --d4: #9B82EC; --d5: #4A443C;
  --heat-0: #26231F; --heat-1: #1C3442; --heat-2: #1F4F6C; --heat-3: #276F97; --heat-4: #3392C7; --heat-5: #55B5EE;
  --ramp-1: #4FA8E3; --ramp-2: #3A82B4; --ramp-3: #2C6187; --ramp-4: #23465F; --ramp-5: #4A443C; --ramp-6: #38332D;
  --area: rgba(79, 168, 227, .14);
  --area-1: #3E9CD4; --area-2: #235069;
  --good: #6DBE8F; --good-text: #86CFA4; --good-soft: #1A2C21;
  --bad: #E58D80; --bad-soft: #35201C;
  --warn: #D9B266; --warn-soft: #2F2716;
  --scrim: rgba(0, 0, 0, .5);
  --wall: #182624; --wall-ink: rgba(170, 215, 205, .12); --doodle: rgba(255, 255, 255, .03);
  --logo-edge: rgba(255, 255, 255, .16);
  color-scheme: dark;
}
