/* Esmeralda Minimal CSS — inspired by OpenAI aesthetics - clean, quiet, typographic-first - minimal colors, high contrast, ample whitespace - supports light & dark via system preference */ /* ---------------------------------- CSS Variables ---------------------------------- */
:root {
  --font-size: 16px;
  --bg: hsl(210 0% 98%);
  --surface: hsl(210 0% 90%);
  --text: hsl(210 0% 5%);
  --muted: hsl(210 0% 30%);
  --border: hsl(0, 0%, 75%);
  --accent: hsl(210 60% 60%);
  --danger: hsl(0, 60%, 50%);
  --shadow-in: inset 4px 4px 16px hsla(0 0% 0% / 0.05);
  --shadow-sm: 2px 2px 8px hsla(0 0% 0% / 0.05);
  --shadow-md: 4px 4px 16px hsla(0 0% 0% / 0.05);
  --glow-md: 0px 0px 16px hsl(210 30% 90%);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-pill: 960px;
  --font-sans: "Roboto", ui-sans-serif, system-ui, -apple-system, Segoe UI, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --lh: 1.55;
  --space-0: 0px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --gap-xs: var(--space-1);
  --gap-sm: var(--space-2);
  --gap-md: var(--space-3);
  --gap-lg: var(--space-4);
  --gap-xl: var(--space-5);
  --white: hsl(0 0% 100%);
  --black: hsl(0 0% 0%);
}
:root[data-theme="dark"] {
  --bg: hsl(210 0% 5%);
  --surface: hsl(210 0% 10%);
  --text: hsl(210 0% 95%);
  --muted: hsl(210 0% 70%);
  --border: hsl(210 0% 10%);
  --accent: hsl(210 60% 60%);
  --shadow-in: inset 4px 4px 16px hsla(0 0% 0% / 0.05);
  --shadow-sm: 2px 2px 8px hsla(0 0% 0% / 0.05);
  --shadow-md: 4px 4px 16px hsla(0 0% 0% / 0.05);
  --glow-md: 0px 0px 16px hsla(0 0% 100% / 0.25);
  --border: hsl(0, 0%, 12.5%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: hsl(210 0% 5%);
    --surface: hsl(210 0% 10%);
    --text: hsl(210 0% 95%);
    --muted: hsl(210 0% 70%);
    --border: hsl(210 0% 10%);
    --accent: hsl(210 60% 60%);
    --shadow-in: inset 4px 4px 16px hsla(0 0% 0% / 0.05);
    --shadow-sm: 2px 2px 8px hsla(0 0% 0% / 0.05);
    --shadow-md: 4px 4px 16px hsla(0 0% 0% / 0.05);
    --glow-md: 0px 0px 16px hsla(0 0% 100% / 0.25);
    --border: hsl(0, 0%, 12.5%);
  }
} /* ---------------------------------- Base Resets & Typography ---------------------------------- */
html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: var(--lh);
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Typography scale */
h1 {
  font-size: 1.75rem;
/*  line-height: 1.3; */
  margin-block-start: 0.5rem;
  margin-block-end: 0rem;
}
h2 {
  font-size: 1.5rem;
  line-height: 1.2;
}
h3 {
  font-size: 1.25rem;
/*  line-height: 1.2; */
}
p {
  margin-block-start: 0rem;
  margin-block-end: 0.25rem;
}
small{
  font-size: 0.75rem;
}
.muted {
  color: var(--muted);
}
.monotype {
  font-family: var(--font-mono);
}

/* Links */
a {
  color: inherit;
  text-decoration: none;
}
/* a:hover {
  text-decoration: underline;
} */

/* ---------------------------------- Layout helpers ---------------------------------- */
.container {
  width: min(1100px, 100% - 40px);
  margin-inline: auto;
}
/* .stack > * + * {
  margin-top: var(--space-4);
} */
.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-md);
  align-items: center;
}

/* Page shell */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(75%) blur(5px);
  background: var(--bg), transparent;
}
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}
.header-title {
  display: inline-flex;
  align-items: baseline;
}
.header-nav {
  display: flex;
  gap: 0.5rem;
}
.dropdown {
  position: relative;
  display: inline-flex;
  align-items: stretch;
}
.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background 250ms 5s;
  appearance: none;
  -webkit-appearance: none;
}
/* .dropdown-toggle:hover,
.dropdown-toggle:focus-visible {
  background: color-mix(in hsl, var(--text) 6%, transparent);
} */
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(75% + var(--space-2));
  display: none;
  min-width: 180px;
  padding: var(--space-2) 0;
  margin: 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 5;
  color: var(--text);
}

/* Pure CSS dropdown reveal */
.dropdown:hover .dropdown-menu { display: block; }

.dropdown-menu li { margin: 0; padding: 0; }
.dropdown-menu li a {
  display: block;
  padding: var(--space-2) var(--space-4);
  color: inherit;
}
.dropdown-menu li a:hover,
.dropdown-menu li a:focus-visible {
  background: color-mix(in hsl, var(--accent) 12%, transparent);
}
.dropdown-menu li + li a {
  border-top: 1px solid var(--border-light, var(--border));
}
.dropdown.open .dropdown-menu {
  display: block;
}
.dropdown-menu .theme-toggle-item {
  padding: var(--space-2) var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--border-light, var(--border));
}
.theme-toggle {
  display: inline-grid;
  grid-auto-flow: column;
  gap: var(--gap-xs);
  padding: var(--space-1);
  border-radius: var(--radius-pill);
  background: color-mix(in hsl, var(--surface) 70%, transparent);
/*  border: 1px solid color-mix(in hsl, var(--border) 75%, transparent); */
/*  box-shadow: inset 0 1px 0 color-mix(in hsl, var(--white) 25%, transparent); */
}
.theme-toggle__btn {
  border: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-xs);
  line-height: 1;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
  appearance: none;
  -webkit-appearance: none;
  white-space: nowrap;
}
.theme-toggle__btn[data-theme="light"] {
  font-size: var(--fs-sm);
  text-transform: none;
}
.theme-toggle__btn[data-theme="dark"] {
  font-size: var(--fs-sm);
  text-transform: none;
}
.theme-toggle__btn.is-active {
  background: color-mix(in hsl, var(--accent) 60%, var(--surface) 20%);
  color: var(--white);
  box-shadow: 0 1px 2px hsla(0 0% 0% / 0.15);
}
.theme-toggle__btn:focus-visible {
  outline: none;
  background: color-mix(in hsl, var(--accent) 35%, transparent);
  color: var(--white);
}
.theme-toggle__btn.is-active:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in hsl, var(--accent) 45%, transparent);
}
.dropdown-menu .theme-toggle-item + li a {
  border-top: none;
}
.dropdown-menu a[aria-disabled="true"],
.dropdown-menu a.disabled,
.dropdown-menu .disabled {
  color: var(--muted);
  pointer-events: none;
  cursor: default;
}
.main {
  flex: 1 1 auto;
  display: flex;           /* allow inner sections to stretch */
  flex-direction: column;
  min-height: 0;           /* enable children to use flex-basis height */
  padding: var(--space-6) 0;
}
.footer {
  margin-top: auto;
  padding: var(--space-5) 0;
  color: var(--muted);
} /* ---------------------------------- Surfaces ---------------------------------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: clamp(var(--space-4), 2vw, var(--space-5));
}
.card:hover {
  box-shadow: var(--shadow-md);
  transition: box-shadow 180ms ease;
}
/* ---------------------------------- Buttons ---------------------------------- */
.button {
  --btn-bg: var(--text);
  --btn-fg: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-sm);
  padding: var(--space-3) var(--space-3);
  border-radius: calc(var(--radius) - var(--space-1));
  border: 1px solid transparent;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: var(--fs-sm);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.button:hover {
  filter: brightness(1.03);
}
.button:active {
  transform: translatey(1px);
}
.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.button--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  border-color: var(--border);
}
.button--subtle {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  border-color: var(--border);
}
.button--accent {
  --btn-bg: var(--accent);
  --btn-fg: var(--white);
}
.button--danger {
  --btn-bg: var(--danger);
  --btn-fg: var(--white);
}

.button--danger {
  --btn-bg: var(--danger);
  --btn-fg: var(--white);
}
/* ---------------------------------- Forms ---------------------------------- */
.label {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--muted);
}
.input,
.select,
.textarea {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-md);
}
.select {
  appearance: none;
  padding-right: var(--space-7);
  cursor: pointer;
}
.select-wrapper {
  position: relative;
  display: inline-block;
}
.select-wrapper::after {
  content: '';
  position: absolute;
  pointer-events: none;
  right: var(--space-4);
  top: 50%;
  width: var(--space-3);
  height: var(--space-3);
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-60%) rotate(45deg);
  transition: border-color 0.2s ease;
}
.select-wrapper:focus-within::after {
  border-color: var(--accent);
}
.input::placeholder,
.textarea::placeholder {
  color: color-mix(in hsl, var(--muted) 70%, transparent);
}
.textarea {
  min-height: 120px;
  resize: vertical;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: 4px solid hsla(165 82% 35% / 0.35);
  border-color: color-mix(in hsl, var(--accent) 40%, var(--border));
}
/* ---------------------------------- Code & Pre ---------------------------------- */
code,
pre {
  font-family: var(--font-mono);
  font-size: var(--fs-code);
}
code {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
}
pre {
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--space-4);
  overflow: auto;
} /* ---------------------------------- Tables ---------------------------------- */
.table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius);
  overflow: hidden;
}
.table thead th {
  text-align: left;
  font-weight: 600;
  font-size: var(--fs-sm);
  background: var(--surface);
  color: var(--muted);
}
.table th,
.table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}
.table tr:hover td {
  background: color-mix(in hsl, var(--surface) 70%, transparent);
}
.table--pricing {
  width: 75%;
  max-width: 100%;
}
.table--pricing th,
.table--pricing td {
  text-align: left;
}
/* ---------------------------------- Nav & Pills ---------------------------------- */
.nav {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}
.nav a {
  padding: var(--space-2) var(--space-3);
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 400;
}
.nav a[aria-current="page"],
.nav a.active {
  color: var(--text);
  border-color: var(--text);
} /* Zarovnanie dropdown ikonky s linkami v .nav */
/* .nav .dropdown-toggle {
  color: var(--muted);
} */
  /* keď je otvorený dropdown, ikonka vyzerá ako aktívna */
/* .nav .dropdown.open .dropdown-toggle {
  color: var(--text);
  border-color: var(--text);
} */

.pills {
  display: flex;
  gap: var(--gap-lg);
  flex-wrap: wrap;
  border-bottom: 1px solid color-mix(in hsl, var(--border) 90%, transparent);
  padding-bottom: 0;
}
.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  margin-bottom: -1px; /* allow active underline to overlap the track */
  background: transparent;
  border: none;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: color 160ms ease, border-color 160ms ease;
}
.pill:hover {
  color: var(--text);
  border-bottom-color: color-mix(in hsl, var(--accent) 35%, var(--border));
}
.pill:focus-visible {
  outline: none;
  color: var(--text);
  border-bottom-color: color-mix(in hsl, var(--accent) 55%, var(--text) 10%);
}
.pill[aria-selected="true"],
.pill.active,
.pills a[aria-current="page"],
.pills a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
/* ---------------------------------- Utilities (sparingly) ---------------------------------- */
.hidden {
  display: none !important;
}
/* Utility classes trimmed to reduce bundle size
.hero {
  padding: clamp(40px, 8vw, 96px) 0;
}
.hero h1 {
  font-size: var(--fs-hero);
}
.hero p {
  font-size: var(--fs-hero-body);
  color: var(--muted);
} */
.section {
  padding: clamp(28px, 6vw, 64px) 0;
} /* ---------------------------------- Animations (gentle) ---------------------------------- */
/* removed unused fade-in animation */
/* ---------------------------------- Chat layout ---------------------------------- */
html, body { height: 100%; } /* ensure full height for viewport-based layouts */
.chat { 
  margin: 0 auto; 
  width: 100%; 
  max-width: 900px; 
  display: flex; 
  flex-direction: column; 
  flex: 1 1 auto;          /* fill between header and footer */
  min-height: 0;           /* allow #chat-box to shrink/scroll */
}
/* Shared content width to match chat */

#chat-box { 
  flex: 1 1 auto; 
  overflow-y: auto; 
/*  border: 1px solid var(--border); */
  border-radius: var(--radius-sm); 
  padding: 12px; 
  min-height: 0;
/*  background: var(--surface); */
  display: flex;              /* allow per-message alignment */
  flex-direction: column;
  gap: var(--gap-sm);
}
.chat-message {
  line-height: 1.4;
  align-self: flex-start;     /* default: left-aligned */
  max-width: 75%;             /* three-quarters of container */
  word-wrap: break-word;
  overflow-wrap: anywhere;
  display: inline-block;
  padding: var(--space-3);
  border-radius: var(--radius);
  background: var(--surface);
/*  border: 1px solid var(--border); */
/*  box-shadow: var(--shadow-sm); */
}
.chat-message.assistant strong { color: var(--text); }
.chat-message.user {
  align-self: flex-end;       /* right-aligned */
  max-width: 75%;             /* stretch to three-quarters width */
  text-align: left;           /* keep text ragged-right inside bubble */
  background: var(--accent);
/*  border-color: color-mix(in hsl, var(--accent) 35%, var(--border)); */
}
/* Slightly mute the name label to reduce visual noise */
.chat-message strong { color: var(--muted); }
.chat-message.user {
  align-self: flex-end;       /* right-aligned */
  max-width: 75%;             /* stretch to three-quarters width */
  text-align: left;           /* keep text ragged-right inside bubble */
}
.chat-status-line {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--gap-sm);
  padding: 0;
  margin-top: var(--space-1);
  margin-bottom: var(--space-1);
  text-align: center;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.chat-status-line strong {
  color: inherit;
  margin-left: var(--space-1);
}
.chat-status-item {
  display: inline-flex;
  align-items: baseline;
  gap: var(--gap-xs);
}
.chat-status-label {
  text-transform: none;
}
.chat-status-action {
  margin-left: var(--space-4);
  color: inherit;
  text-decoration: underline;
}
.chat-status-action:hover {
  text-decoration: none;
}
.chat-reset-bubble {
  min-height: 200px;
  height: 200px;
  max-width: min(100%, 380px);
  margin: var(--space-5) auto var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--surface);
}
.chat-reset-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-md);
  width: 100%;
}

/* ---------------------------------- Modal (Popover) ---------------------------------- */
.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--gap-sm);
  margin-top: var(--space-4);
}

/* Popover API styles */
[popover] {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(520px, 92%);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: var(--space-4);
}
[popover]::backdrop {
  background: rgba(0,0,0,0.4);
}

.checkmark {
  height:1rem;
  width: 1rem;
  background-color: var(--muted);
}

.checkmark:after {
  content: "";
  background-color: var(--accent);
  display: none;
}

/* Enable confirm only when checkbox is ticked (CSS-only via :has) */
#delete-popover:not(:has(#chk-confirm-delete:checked)) .btn-confirm {
  opacity: 0.5;
  pointer-events: none;
}
.chat-reset-title {
  font-size: var(--fs-base);
}
.chat-reset-body {
  margin: 0;
  color: var(--muted);
}
.chat-reset-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gap-md);
}
.chat-reset-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gap-md);
}
.chat-message.assistant.is-loading {
  color: var(--muted);
/*  border-style: dashed; */
}
.typing-dots {
  display: inline-flex;
  gap: var(--gap-xs);
  margin-left: var(--space-1);
}
.typing-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
  animation: typing-dots 1s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-dots {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-3px); opacity: 1; }
}
.chat-form-row {
  position: relative;
  display: block;
  flex: 0 0 auto;
  margin: var(--space-2) auto 0;
  width: min(720px, 100%);
  background: color-mix(in hsl, var(--surface) 92%, var(--bg));
  border: 1px solid color-mix(in hsl, var(--border) 60%, var(--surface));
  border-radius: calc(var(--radius) + var(--space-2));
  overflow: hidden;
}
.chat-form-row:focus-within {
  border-color: color-mix(in hsl, var(--accent) 50%, var(--border));
  box-shadow: 0 0 0 2px color-mix(in hsl, var(--accent) 30%, transparent);
}
.chat-input {
  width: 100%;
  display: block;
  border: none;
  background: transparent;
  padding: var(--space-4);
  line-height: 1.45;
  resize: none;
  height: 160px;
  min-height: 160px;
  max-height: 160px;
  color: var(--text);
  box-sizing: border-box;
}
.chat-input::placeholder {
  color: color-mix(in hsl, var(--muted) 82%, transparent);
}
.chat-input:focus {
  outline: none;
}
.chat-send-btn {
  position: absolute;
  right: var(--space-5);
  bottom: var(--space-5);
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xl);
  transition: background 160ms ease, transform 160ms ease;
  cursor: pointer;
}

.chat-send-btn:active {
  transform: translateY(0);
}
.chat-send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.chat-disclaimer {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  align-self: center;
  margin-top: var(--space-1) !important;
  margin-bottom: 0;
}

/* Chat page full-height layout: footer docked to window bottom, chat scrolls inside */
body.page-chat { height: 100vh; overflow: hidden; }
body.page-chat .main { padding: 0; }
body.page-chat .chat { padding: var(--space-4); }

/* ---------------------------------- Charts ---------------------------------- */
.chart .chart-total-title {
  font-size: var(--fs-xs);
  color: var(--muted);
}
.chart .chart-total-value {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--text); /* respects light/dark */
}
.chart .chart-header { margin-bottom: 4px; }
.chart svg .chart-x-label {
  font-size: var(--fs-2xs);
  fill: var(--muted);
}
.chart svg .chart-max-label {
  font-size: var(--fs-2xs);
  fill: var(--muted);
}
.chart svg .chart-max-line {
  stroke: color-mix(in hsl, var(--muted) 88%, var(--text));
  stroke-opacity: .85;
  stroke-width: 1;
  stroke-dasharray: 4 4;
}
.chart svg .chart-x-axis {
  stroke: color-mix(in hsl, var(--border) 80%, transparent);
  stroke-width: 1;
}
.chart-plot--columns {
  padding: var(--space-3);
  padding-bottom: calc(var(--space-3) + 40px);
  border-radius: calc(var(--radius) - var(--space-1));
  border: 1px solid color-mix(in hsl, var(--border) 85%, transparent);
  background: color-mix(in hsl, var(--surface) 82%, var(--bg));
  position: relative;
  overflow-x: auto;
  overflow-y: visible;
}
.chart-plot--columns .chart-empty {
  margin: var(--space-3) 0;
}
.chart-scale {
  display: flex;
  justify-content: flex-end;
  gap: var(--gap-sm);
  align-items: baseline;
  font-size: var(--fs-2xs);
  color: var(--muted);
  margin-bottom: var(--space-2);
}
.chart-scale-value {
  font-weight: 600;
  color: var(--text);
}
.chart-columns {
  list-style: none;
  display: flex;
  align-items: flex-end;
  gap: 0;
  margin: 0;
  padding: 0;
  height: clamp(160px, 35vh, 260px);
  min-width: 480px;
}
.chart-column {
  position: relative;
  flex: 1;
  min-width: var(--space-1);
  display: flex;
  align-items: flex-end;
  height: 100%;
}
.chart-bar {
  display: block;
  width: 100%;
  height: calc(var(--size, 0) * 100%);
  background: linear-gradient(180deg, color-mix(in hsl, var(--accent) 90%, var(--white)), var(--accent));
  border-top-left-radius: var(--space-1);
  border-top-right-radius: var(--space-1);
  transition: filter 160ms ease, transform 160ms ease;
  position: relative;
}
.chart-column:hover .chart-bar {
  filter: brightness(1.08);
  transform: translateY(-2px);
}
.chart-bar::after {
  content: attr(data-value);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  padding: var(--space-1) var(--space-2);
  font-size: var(--fs-2xs);
  color: var(--bg);
  background: color-mix(in hsl, var(--text) 84%, var(--black) 10%);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  white-space: nowrap;
}
.chart-column:hover .chart-bar::after {
  opacity: 1;
}
.chart-tick {
  position: absolute;
  left: 50%;
  bottom: -36px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-xs);
  font-size: var(--fs-2xs);
  color: var(--muted);
  white-space: nowrap;
  line-height: 1.1;
}
.chart-tick-label {
  color: var(--muted);
}
.chart-tick-sub {
  font-size: var(--fs-2xs);
  color: color-mix(in hsl, var(--muted) 85%, var(--text) 10%);
}
.chart-column--hour {
  border-right: 1px solid color-mix(in hsl, var(--border) 70%, transparent);
}
.chart-column--hour:last-child {
  border-right: none;
}

/* ---------------------------------- Balance page ---------------------------------- */
/* Make the "Prehľad platieb" link visually match the Stripe Buy Button */
body.page-balance .buy-actions {
  align-items: center;
}
body.page-balance .buy-actions .button.button--accent {
  height: 44px;            /* approximate Stripe button height */
  padding: 0 var(--space-4);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px hsla(0 0% 0% / 0.06); /* similar subtle shadow */
}

/* Overview bar & switch */
.overview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-md);
}
.switch {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-sm);
  cursor: pointer;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .switch-track {
  width: 40px;
  height: 20px;
  border-radius: var(--radius-pill);
  background: color-mix(in hsl, var(--border) 80%, transparent);
  position: relative;
  transition: background 160ms ease;
}
.switch .switch-track::after {
  content: '';
  position: absolute;
  top: 2px; left: var(--space-1);
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease;
}
.switch input:checked + .switch-track {
  background: var(--accent);
}
.switch input:checked + .switch-track::after {
  transform: translateX(16px);
}
.switch .switch-label { font-size: 0.75rem; color: var(--muted); }

/* ---------------------------------- Tables: scrolling blocks ---------------------------------- */
/* Wrapper that limits table height and enables inner scrolling so footer stays visible */
.table-block { display: grid; gap: var(--gap-md); }
.table-scroll {
  max-height: clamp(220px, 45vh, 560px);
  overflow: auto;
  border-radius: var(--radius);
  border: 1px solid transparent; /* reserve radius without affecting table */
}
/* Keep header visible while scrolling */
.table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

/* Balance: make daily overview fit container without horizontal scroll */
body.page-balance #daily-view .chart-columns {
  min-width: 0; /* allow 24 columns to compress to available width */
}
/* Remove horizontal scroll on daily chart and leave room for edge tooltips */
body.page-balance #daily-view .chart-plot--columns {
  overflow-x: hidden;
  padding-left: calc(var(--space-3) + 40px);
  padding-right: calc(var(--space-3) + 40px);
  padding-top: calc(var(--space-3) + 8px);
}
/* Ensure columns themselves can shrink as needed */
body.page-balance #daily-view .chart-column { min-width: 0; }
/* Daily table: wrap long topics and keep table within container */
body.page-balance #daily-view .table {
  table-layout: fixed;
  width: 100%;
}
body.page-balance #daily-view .table th,
body.page-balance #daily-view .table td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
/* Reserve reasonable space for time and price columns */
body.page-balance #daily-view .table th:nth-child(2),
body.page-balance #daily-view .table td:nth-child(2) { width: 7rem; }
body.page-balance #daily-view .table th:nth-child(3),
body.page-balance #daily-view .table td:nth-child(3) { width: 8rem; }
