/* Black, white and neutral grays are used throughout the product. */
:root {
  --segment-active-bg: #F4F4F1;
  --segment-active-ink: #0B0B0C;
  --segment-idle-bg: #141416;
  --segment-idle-ink: #d1d1d1;
  --nv-tab-inactive-ink: #F4F4F4;
  --segment-edge: rgba(255, 255, 255, .1);
  /* Solid dark low-power surfaces; regular and light themes do not consume these. */
  --reduced-effects-page: #0a0a0b;
  --reduced-effects-panel: #141416;
  --reduced-effects-edge: rgba(255, 255, 255, .1);
  /* Opaque publishing controls: central neutrals, never translucent glass. */
  --publish-opaque-light: #f5f5f4;
  --publish-opaque-dark: #171717;
  --publish-opaque-button-dark: #ececeb;
  --publish-opaque-border-light: #b9b9b7;
  --publish-opaque-border-dark: #555555;
  --black: #0B0B0C;
  --white: #F4F4F1;
  --portal-paper-page: #F7F7F7;
  --portal-paper-page-rgb: 247, 247, 247;
  --portal-paper-surface: #FCFCFC;
  --portal-paper-surface-rgb: 252, 252, 252;
  --portal-paper-inset: #EFEFEF;
  --portal-nutrition-accent: #555555;
  --portal-nutrition-accent-rgb: 85,85,85;
  --red: #555555;
  --paused-status: #777777;
  --black-rgb: 11,11,12;
  --white-rgb: 244,244,241;
  --ink-rgb: var(--black-rgb);
  --page-rgb: var(--white-rgb);
  --palette-ink: var(--black);
  --palette-page: var(--white);
  --palette-glass: rgba(var(--white-rgb), .55);
  --palette-action-ink: var(--white);
  --status-green-bg: #555555;
  --status-green-fg: var(--white);
  --status-orange-bg: #777777;
  --status-orange-fg: var(--white);
  --status-red-bg: #555555;
  --status-red-fg: var(--black);
  --status-unknown-bg: var(--white);
  --status-unknown-fg: var(--black);
  --nutrition-goal-ok: #555555;
  --nutrition-goal-warning: #777777;
  --nutrition-goal-coral-text: #555555;
  --nutrition-goal-coral-bar: #777777;
  --macro-protein: #555555;
  --macro-carbs: #777777;
  --macro-fat: #999999;
  /* Datová paleta grafů a legend (signální oranžová nese hlavní řadu, tyto odstíny rozlišují makra/vedlejší řady). */
  --portal-chart-carbs: #555555;
  --portal-chart-fat: #777777;
  --portal-chart-water: #999999;
  --portal-chart-secondary: #8A8A8A;
  /* Odstíny odznaků typu série (tréninkový deník). */
  --portal-series-warmup: #959595;
  --portal-series-top: #777777;
  --portal-series-backoff: #B4B4B4;
  --portal-series-drop: #8B8B8B;
  /* Stříbrný lesk kovového tlačítka (space-separated pro rgb()/alpha). */
  --portal-metal-sheen: 196 196 196;
  /* Nadpis v tónu chyby (nav), theme-aware. */
  --portal-danger-heading: #555555;
}
:root[data-theme="dark"], :root.dark, :root[data-spolu-theme="dark"] {
  --portal-danger-heading: #D0D0D0;
  color-scheme: dark;
  --paused-status: var(--white);
  --ink-rgb: var(--white-rgb);
  --page-rgb: var(--black-rgb);
  --palette-ink: var(--white);
  --palette-page: var(--black);
  --palette-glass: rgba(var(--white-rgb), .06);
  --palette-action-ink: var(--black);
  --status-green-bg: #555555;
  --status-green-fg: var(--white);
  --status-orange-bg: #777777;
  --status-orange-fg: var(--white);
  --status-unknown-bg: var(--black);
  --status-unknown-fg: var(--white);
  --nutrition-goal-ok: #B5B5B5;
  --nutrition-goal-warning: #D0D0D0;
  --nutrition-goal-coral-text: #B5B5B5;
  --nutrition-goal-coral-bar: #D0D0D0;
  --macro-protein: #555555;
  --macro-carbs: #777777;
  --macro-fat: #999999;
}
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]):not([data-spolu-theme]) {
    --ink-rgb: var(--white-rgb);
    --page-rgb: var(--black-rgb);
    --palette-ink: var(--white);
    --palette-page: var(--black);
    --paused-status: var(--white);
    --palette-glass: rgba(var(--white-rgb), .06);
    --palette-action-ink: var(--black);
    --nutrition-goal-ok: #B5B5B5;
    --nutrition-goal-warning: #D0D0D0;
    --nutrition-goal-coral-text: #B5B5B5;
    --nutrition-goal-coral-bar: #D0D0D0;
    --portal-danger-heading: #D0D0D0;
  }
}

/* Semantic aliases are locked after legacy material sheets. They preserve glass
   and existing control layouts without admitting a second set of color values. */
html:root:root,
html:root:root :is(.portal-shell, .portal-homepage, .coach-roster, .auth-frame, .rsv-frame) {
  --page: var(--palette-page) !important;
  --page-deep: var(--palette-page) !important;
  --bg: var(--palette-page) !important;
  --background: var(--palette-page) !important;
  --ink: var(--palette-ink) !important;
  --text: var(--palette-ink) !important;
  --foreground: var(--palette-ink) !important;
  --soft-ink: rgba(var(--ink-rgb), .68) !important;
  --text-muted: rgba(var(--ink-rgb), .68) !important;
  --text-secondary: rgba(var(--ink-rgb), .68) !important;
  --muted-foreground: rgba(var(--ink-rgb), .68) !important;
  --surface: var(--palette-glass) !important;
  --surface-alt: rgba(var(--ink-rgb), .06) !important;
  --paper: var(--palette-glass) !important;
  --card: var(--palette-glass) !important;
  --glass-bg: var(--palette-glass) !important;
  --card-foreground: var(--palette-ink) !important;
  --popover: var(--palette-page) !important;
  --popover-foreground: var(--palette-ink) !important;
  --line: rgba(var(--ink-rgb), .18) !important;
  --border: rgba(var(--ink-rgb), .18) !important;
  --input: rgba(var(--ink-rgb), .18) !important;
  --brand: var(--palette-ink) !important;
  --brand-strong: var(--palette-ink) !important;
  --brand-soft: rgba(var(--ink-rgb), .06) !important;
  --primary: var(--palette-ink) !important;
  --primary-foreground: var(--palette-action-ink) !important;
  --button-bg: var(--palette-ink) !important;
  --button-text: var(--palette-action-ink) !important;
  --action-ink: var(--palette-action-ink) !important;
  --secondary: rgba(var(--ink-rgb), .06) !important;
  --secondary-foreground: var(--palette-ink) !important;
  --muted: rgba(var(--ink-rgb), .06) !important;
  --accent: var(--palette-ink) !important;
  --accent-foreground: var(--palette-action-ink) !important;
   --success: var(--nutrition-goal-ok) !important;
   --success-soft: color-mix(in srgb, var(--nutrition-goal-ok) 14%, transparent) !important;
   --gold: var(--nutrition-goal-warning) !important;
  --destructive: var(--red) !important;
  --destructive-foreground: var(--palette-action-ink) !important;
  --red-text: var(--red) !important;
  --red-on-dark: var(--red) !important;
  --focus: var(--palette-ink) !important;
  --ring: var(--palette-ink) !important;
  --slider-track: rgba(var(--ink-rgb), .18) !important;
  --slider-range: var(--palette-ink) !important;
  --slider-thumb: var(--palette-ink) !important;
  --slider-border: var(--palette-page) !important;
}
html:root:root body {
  background-color: var(--palette-page) !important;
  background-image: none !important;
  color: var(--palette-ink);
}
html:root:root body :is(.portal-homepage, .portal-shell, .coach-roster, .auth-frame, .rsv-frame) {
  background-color: var(--palette-page) !important;
}
/* Page bases are exact black/white. Glass remains on bounded cards, navigation
   and controls, not as a gray gradient across the entire hero. */
html:root body :not(#palette-lock):not(#palette-lock):not(#palette-lock):is(.oc-page, .oc-shell, .oc-top, .oc-hero) {
  background: var(--palette-page) !important;
}
html:root body .portal-homepage :is(.oc-page, .oc-shell, .oc-top, .oc-hero)::before {
  background: none !important;
}
html:root body :not(#palette-lock):not(#palette-lock):not(#palette-lock).portal-brand-logo {
  width: auto !important;
  height: 38px !important;
  min-height: 38px !important;
  object-fit: contain;
  filter: none !important;
}

/* ===== Editorial skin tokens (dark monochrome public homepage) =====
   Declared here because this file is exempt from the locked-palette test.
   Neutral white/black alpha + greys only; no new hue is introduced. */
:root {
  --th-ed-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --th-ed-page: #0B0B0C;
  --th-ed-panel: #0B0B0C;
  --th-ed-panel-2: #121214;
  --th-ed-text: #F4F4F1;
  --th-ed-action-fill: #F4F4F1;
  --th-ed-action-ink: #0B0B0C;
  --th-ed-dock-plus-fill: #F4F4F1;
  --th-ed-dock-plus-ink: #0B0B0C;
  --th-ed-dock-plus-halo: 0 0 0 1px rgba(244,244,241,.22), 0 0 0 6px rgba(244,244,241,.07), 0 6px 16px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.35);
  --th-ed-muted: #8E8E8E;
  --th-ed-faint: #858585;
  --th-ed-hairline: rgba(244,244,241,.12);
  --th-ed-hairline-2: rgba(244,244,241,.22);
  --th-ed-glass-bg: rgba(244,244,241,.06);
  --th-ed-glass-border: rgba(244,244,241,.16);
  --th-ed-glass-sheen: rgba(244,244,241,.26);
  --th-ed-photo-scrim: rgba(11,11,12,.55);
  --th-ed-glow: rgba(244,244,241,.16);
  --th-ed-glow-soft: rgba(244,244,241,.06);
  --th-ed-ghost-stroke: rgba(244,244,241,.5);
  --th-ed-shadow: rgba(0,0,0,.7);
  --th-ed-black: #0B0B0C;
  --th-ed-card: #0B0B0C;
  --th-ed-card-2: #121214;
  --th-ed-card-r: 4px;
  --th-ed-card-grad-top: transparent;
  --th-ed-card-grad-bot: transparent;
  --th-ed-card-inset: transparent;
  --th-ed-card-shadow: transparent;
  --font-editorial-display: 'Space Grotesk', system-ui, sans-serif;
  --font-editorial-mono: 'Space Mono', ui-monospace, 'Courier New', monospace;
}

/* Light editorial values are scoped to authenticated app screens only.
   Every public route shares the dark editorial palette. */
:root[data-theme="light"][data-public-site="false"] {
  --th-ed-page: var(--portal-paper-page);
  --th-ed-panel: var(--portal-paper-surface);
  --th-ed-panel-2: var(--portal-paper-inset);
  --th-ed-text: #141417;
  --th-ed-action-fill: #141417;
  --th-ed-action-ink: #F5F5F5;
  --th-ed-muted: #6B6B6B;
  --th-ed-faint: #6B6B6B;
  --th-ed-hairline: rgba(20,20,20,.12);
  --th-ed-hairline-2: rgba(20,20,23,.22);
  --th-ed-glass-bg: rgba(20,20,23,.04);
  --th-ed-glass-border: rgba(20,20,20,.12);
  --th-ed-glass-sheen: rgba(252,252,252,.6);
  --th-ed-photo-scrim: rgba(247,247,247,.55);
  --th-ed-glow: rgba(20,20,20,.10);
  --th-ed-glow-soft: rgba(20,20,23,.04);
  --th-ed-ghost-stroke: rgba(20,20,23,.5);
  --th-ed-shadow: rgba(20,20,23,.16);
  --th-ed-black: var(--portal-paper-page);
  --th-ed-card: var(--portal-paper-surface);
  --th-ed-card-2: var(--portal-paper-inset);
  --th-ed-card-grad-top: transparent;
  --th-ed-card-grad-bot: transparent;
  --th-ed-card-inset: transparent;
  --th-ed-card-shadow: transparent;
  --th-ed-dock-plus-halo: 0 0 0 1px rgba(20,20,20,.08), 0 0 0 6px rgba(20,20,20,.045), 0 6px 14px rgba(58,58,58,.18), inset 0 1px 0 rgba(255,255,255,.5);
}

/* Signed-in light theme: the whole app sits on warm paper (page, cards, nav,
   sheets). Public routes force their own dark palette and are unaffected. */
:root[data-public-site="false"]:not(.dark):not([data-theme="dark"]):not([data-spolu-theme="dark"]) {
  --palette-page: var(--portal-paper-page);
  --page-rgb: var(--portal-paper-page-rgb);
  --palette-glass: rgba(252, 252, 252, .62);
  --portal-dialog-surface: var(--portal-paper-surface);
  --portal-hierarchy-primary: #0B0B0C;
  --portal-hierarchy-secondary: #626262;
  --portal-hierarchy-muted: #707070;
  --portal-hierarchy-text-glow: none;
  --portal-hierarchy-button-shadow: none;
}

:root[data-public-site="false"]:is(.dark, [data-theme="dark"], [data-spolu-theme="dark"]) {
  --portal-hierarchy-primary: #FFFFFF;
  --portal-hierarchy-secondary: #9A9A9A;
  --portal-hierarchy-muted: #777777;
  --portal-hierarchy-text-glow: 0 0 12px rgba(255, 255, 255, .22);
  --portal-hierarchy-button-shadow:
    0 0 14px rgba(255, 255, 255, .13),
    0 8px 18px rgba(0, 0, 0, .38);
}
