/* Meva design tokens – zgodne z Meva.css (MevaSearch). Czcionki z /fonts/ (bez Google Fonts). */
:root {
  --bg: 245 247 250;
  --canvas: 226 231 238;
  --card: 255 255 255;
  --card-alt: 244 245 249;
  --muted: 234 236 240;
  --border: 222 226 230;

  --fg: 20 23 30;
  --muted-fg: 100 116 139;

  --primary: 14 165 233;
  --primary-hover: 12 140 200;
  --on-primary: 255 255 255;
  --accent: 99 102 241;
  --danger: 239 68 68;
  --success: 22 163 74;
  --warning: 217 119 6;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .07), 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .06), 0 2px 4px rgba(0, 0, 0, .04);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .09), 0 4px 10px rgba(0, 0, 0, .05);

  --radius: .875rem;
  --btn-radius: .5rem;

  --app-header-h: 64px;
  --app-header-x: 2rem;
  --glass-bg: rgb(255 255 255 / .62);
  --glass-border: rgb(15 23 42 / .08);
  --glass-shadow: 0 1px 2px rgb(15 23 42 / .04), 0 8px 24px rgb(15 23 42 / .06);

  --app-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --title-font: 'Space Grotesk Qwantium', 'Space Grotesk', var(--app-font);
  --mono-font: 'Cascadia_Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  --sb-size: 8px;
  --sb-thumb: rgba(128, 137, 152, .38);
  --sb-thumb-hover: rgba(128, 137, 152, .62);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  color-scheme: light;
}

.dark {
  --bg: 14 17 22;
  --canvas: 6 8 11;
  --card: 26 29 36;
  --card-alt: 19 22 32;
  --muted: 42 47 58;
  --border: 42 47 58;

  --fg: 230 230 230;
  --muted-fg: 156 163 175;

  --primary: 34 211 238;
  --primary-hover: 45 220 250;
  --on-primary: 6 8 11;
  --accent: 129 140 248;
  --danger: 252 100 100;
  --success: 74 222 128;
  --warning: 251 191 36;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, .6);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);

  --glass-bg: rgb(22 26 34 / .62);
  --glass-border: rgb(255 255 255 / .08);
  --glass-shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);

  color-scheme: dark;
}

@media (max-width: 600px) {
  :root { --app-header-x: 1rem; }
}

@font-face {
  font-family: 'Space Grotesk Qwantium';
  src: url('/fonts/SpaceGroteskQu.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-Regular.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/fonts/fixel.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0400-04FF, U+0500-052F;
}

@font-face {
  font-family: 'Cascadia_Mono';
  src: url('/fonts/CascadiaMono.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Paski przewijania */
@media (hover: hover) and (pointer: fine) {
  ::-webkit-scrollbar { width: var(--sb-size); height: var(--sb-size); }
  ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
  ::-webkit-scrollbar-button { display: none; }
  ::-webkit-scrollbar-thumb {
    background-color: var(--sb-thumb);
    border-radius: 999px;
    border: 1px solid transparent;
    background-clip: padding-box;
  }
  ::-webkit-scrollbar-thumb:hover, ::-webkit-scrollbar-thumb:active { background-color: var(--sb-thumb-hover); }
  @supports not selector(::-webkit-scrollbar) {
    * { scrollbar-width: thin; scrollbar-color: var(--sb-thumb) transparent; }
  }
}

html, *, *::before, *::after { -webkit-tap-highlight-color: transparent; }

button, [role="button"], .icon-btn, .btn, .tb-btn, summary {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Szklany nagłówek w kształcie pigułek (jak w MevaSearch) */
.header {
  position: relative;
  z-index: 60;
  min-height: var(--app-header-h);
  padding: calc(10px + var(--safe-top)) var(--app-header-x) 10px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: .75rem;
}

:is(.header-left, .header-right) {
  box-sizing: border-box;
  height: 44px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  border-radius: 999px;
  position: relative;
  z-index: 60;
}

.header-left {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: 0 .9rem 0 4px;
  font-family: var(--title-font);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.3px;
  line-height: 1;
  white-space: nowrap;
  color: rgb(var(--fg));
  text-decoration: none;
  flex-shrink: 0;
}

.header-left img {
  box-sizing: content-box;
  width: 18px;
  height: 18px;
  padding: 0 8px;
  border-radius: 50%;
}

.header-right {
  display: flex;
  align-items: center;
  padding: 0 4px;
  gap: 2px;
  margin-left: auto;
}

.header-right .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border-radius: 999px;
}

.header-right .icon-btn svg { width: 18px; height: 18px; stroke-width: 1.8; }

input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 0 4px 0 6px;
  border-radius: 50%;
  cursor: pointer;
  background-color: rgb(var(--muted-fg));
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7 7 17'/%3E%3C/svg%3E") center / 14px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7 7 17'/%3E%3C/svg%3E") center / 14px no-repeat;
  opacity: .85;
}
