/* ==========================================================================
   TimingKit design tokens — the single source of truth.
   Every other stylesheet uses only these variables; raw values live here.
   Rules: 4px grid · whole pixels · two weights (400 / 700) · one font family.
   The full reference with live samples: design.php (platform owner only).
   ========================================================================== */

:root{
  /* ---------- type ---------- */
  --font:"Inter Tight",-apple-system,"SF Pro Display","SF Pro Text","Helvetica Neue",system-ui,sans-serif;
  --fw-regular:400;
  --fw-bold:700;

  /* sizes: fluid for headings, fixed for UI text */
  --fs-display:clamp(48px,9vw,156px);   /* hero title of a timing */
  --fs-h1:clamp(40px,7vw,112px);        /* section / day title */
  --fs-h2:clamp(36px,4.2vw,56px);       /* page titles in the cabinet, auth pitch */
  --fs-h3:clamp(28px,3vw,44px);         /* card titles, big numbers, item time */
  --fs-h4:clamp(22px,2.1vw,32px);       /* item title on the public page */
  --fs-title:clamp(20px,1.8vw,28px);    /* block titles */
  --fs-title-s:clamp(20px,1.5vw,24px);  /* small block titles, logo in the cabinet */
  --fs-lead:clamp(17px,1.4vw,22px);     /* intro paragraphs */
  --fs-body:17px;                       /* running text, large buttons */
  --fs-input:16px;                      /* form fields on phones: below 16px iOS zooms in */
  --fs-small:15px;                      /* UI text: buttons, inputs, lists */
  --fs-cap:13px;                        /* captions, uppercase labels */
  --fs-micro:12px;                      /* hints, badges, table heads */
  --fs-nano:11px;                       /* counters, live badge, avatar initials */

  --lh-display:.95;
  --lh-tight:1.05;  /* headings */
  --lh-snug:1.2;    /* titles, multi-line UI */
  --lh-body:1.5;    /* running text */

  /* Inter Tight is already tight, so headings get only a light squeeze (about half of the usual) */
  --ls-display:-.025em; /* hero title */
  --ls-tight:-.02em;    /* headings, big numbers */
  --ls-title:-.01em;    /* titles, names */
  --ls-caps:.06em;      /* uppercase captions */

  /* ---------- space: 4px grid ---------- */
  --s-1:4px;--s-2:8px;--s-3:12px;--s-4:16px;--s-5:20px;--s-6:24px;--s-8:32px;--s-12:48px;--s-16:64px;--s-24:96px;

  /* layout rhythm — adapts to the screen (see media queries below) */
  --pad:40px;     /* page side padding */
  --sec-y:96px;   /* between page sections */
  --gap-l:48px;   /* between big columns */
  --gap:16px;     /* between cards in a grid */
  --inset:48px;   /* inner padding of big cards */
  --inset-s:24px; /* inner padding of regular cards, vertical stack */
  --float:32px;   /* distance of floating buttons from the screen edges */

  /* ---------- shape ---------- */
  --r-xs:4px;     /* tiny marks */
  --r-s:12px;     /* inputs, small panels */
  --r-m:24px;     /* cards */
  --r-l:32px;     /* big cards, sheets */
  --pill:999px;   /* buttons, chips */
  --round:50%;    /* avatars, round icon buttons */

  /* control heights */
  --h-l:64px;     /* large buttons */
  --h-m:48px;     /* buttons, inputs */
  --h-s:40px;     /* small buttons, icon buttons */
  --h-chip:36px;  /* chips, people tags */
  --h-xs:28px;    /* mini icon buttons */
  --h-badge:22px; /* badges, counters */

  /* avatars */
  --ava-xs:24px;--ava-s:40px;--ava-m:48px;--ava-l:72px;--ava-xl:112px;

  /* icons: 24×24 grid, 2px stroke, always 24px */
  --icon:24px;    /* icon safe area: the glyph is centred in this box */
  --ic-gap:8px;   /* between an icon box and its text */

  /* ---------- motion ---------- */
  --ease:cubic-bezier(.2,.7,.1,1);     /* default */
  --ease-out:cubic-bezier(.22,1,.36,1); /* things that arrive and glide */
  --t-fast:.2s;  /* hover, color */
  --t-base:.3s;  /* show / hide */
  --t-slow:.5s;  /* sheets, drawers, movement */

  /* ---------- layers ---------- */
  --z-sticky:10;  /* sticky top bars and filters */
  --z-float:15;   /* floating page buttons */
  --z-bar:20;     /* full-width notice bars */
  --z-drawer:30;  /* mobile menu */
  --z-modal:40;   /* person card */
  --z-toast:50;   /* toasts, conflict bar */
  --z-popover:60; /* date picker */
}
@media (min-width:1920px){:root{--pad:80px;--sec-y:160px;--gap-l:64px;--gap:24px;--inset:64px;--inset-s:32px;--fs-body:19px;--fs-small:16px}}
@media (max-width:1279px){:root{--pad:32px;--gap-l:32px;--inset:40px}}
@media (max-width:1023px){:root{--pad:24px;--sec-y:80px;--gap-l:24px;--gap:12px;--inset:32px;--float:24px}}
@media (max-width:479px){:root{--pad:16px;--sec-y:64px;--inset:24px;--inset-s:16px;--float:16px;--r-l:24px;--r-m:16px;--h-l:56px}}

/* ---------- color: themes ----------
   bg → panel → card: three surface levels; ink → ink-2 → ink-3: three text levels */
[data-mode="light"]{
  --bg:#FFFFFF;--panel:#F5F5F7;--card:#EDEDF2;--card-edge:rgba(7,7,7,.06);--line:#E7E7EC;
  --ink:#070707;--ink-2:#4D4D55;--ink-3:#6E6E78;
  --inv:#070707;--inv-ink:#FFFFFF;
  --bar:rgba(255,255,255,.86);
  --scrim:rgba(7,7,7,.45);
  --sh-1:0 1px 3px rgba(0,0,0,.2);
  --sh-2:0 8px 24px rgba(0,0,0,.16);
  --sh-3:0 16px 40px rgba(0,0,0,.16);
  --sh-4:0 24px 64px rgba(0,0,0,.24);
  /* status */
  --success:#30A46C;--success-ink:#1A7F45;--success-soft:#E6F6EC;
  --warn:#FFB224;--warn-ink:#8A5A00;--warn-soft:#FFF4D6;
  --danger:#E5484D;--danger-ink:#B42318;--danger-soft:#FDECEC;
}
[data-mode="dark"]{
  --bg:#070707;--panel:#141416;--card:#1C1C21;--card-edge:rgba(255,255,255,.08);--line:rgba(255,255,255,.14);
  --ink:#FFFFFF;--ink-2:#B4B4BE;--ink-3:#8A8A94;
  --inv:#FFFFFF;--inv-ink:#070707;
  --bar:rgba(7,7,7,.82);
  --scrim:rgba(0,0,0,.6);
  --sh-1:0 1px 3px rgba(0,0,0,.4);
  --sh-2:0 8px 24px rgba(0,0,0,.4);
  --sh-3:0 16px 40px rgba(0,0,0,.5);
  --sh-4:0 24px 64px rgba(0,0,0,.6);
  --success:#3DD68C;--success-ink:#4CE59A;--success-soft:rgba(48,164,108,.18);
  --warn:#FFB224;--warn-ink:#FFC75C;--warn-soft:rgba(255,178,36,.16);
  --danger:#FF6369;--danger-ink:#FF8B8E;--danger-soft:rgba(229,72,77,.18);
}

/* fixed brand colors (don't change with the theme) */
:root{
  --white:#FFFFFF;--black:#070707;
  --tg:#2AABEE;--wa:#25D366;
  --max:linear-gradient(135deg,#00C2FF 0%,#4C5BFF 55%,#9B3DFF 100%);
}

/* ---------- color: accents (Оформление → Цвет) ---------- */
[data-palette="violet"]{--accent:#D500F9;--accent-ink:#A000BC;--accent-soft:#FAEBFE;--on-accent:#FFFFFF}
[data-palette="red"]{--accent:#E74124;--accent-ink:#B8301A;--accent-soft:#FDECE8;--on-accent:#FFFFFF}
[data-palette="teal"]{--accent:#00BFA5;--accent-ink:#00806E;--accent-soft:#E0F7F3;--on-accent:#070707}
[data-palette="blue"]{--accent:#2F5BFF;--accent-ink:#1D3FD1;--accent-soft:#EAF0FF;--on-accent:#FFFFFF}
[data-palette="ink"]{--accent:#070707;--accent-ink:#070707;--accent-soft:#F5F5F7;--on-accent:#FFFFFF}
[data-mode="dark"][data-palette="violet"]{--accent-ink:#E36BFF;--accent-soft:rgba(213,0,249,.16)}
[data-mode="dark"][data-palette="red"]{--accent-ink:#FF7A5C;--accent-soft:rgba(231,65,36,.18)}
[data-mode="dark"][data-palette="teal"]{--accent-ink:#3DE0C8;--accent-soft:rgba(0,191,165,.16)}
[data-mode="dark"][data-palette="blue"]{--accent-ink:#8DA6FF;--accent-soft:rgba(47,91,255,.2)}
[data-mode="dark"][data-palette="ink"]{--accent:#FFFFFF;--accent-ink:#FFFFFF;--accent-soft:#1C1C21;--on-accent:#070707}
/* gradient palettes (Оформление → Градиент) live in gradients.css together with their effects */
