/* ==========================================================================
   Prepočet farmy — design system (tokens, base, components, layout, views)
   Token names are a shared contract — see docs/UI_GUIDE.md.
   ========================================================================== */

/* ---------- Tokens: light (default) ---------- */
:root {
  color-scheme: light;

  --bg: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f3f2ee;
  --surface-3: #ebeae4;
  --input-bg: #ffffff;

  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #898781;
  --link: #1c5cab;

  --border: rgba(11, 11, 11, 0.10);
  --border-strong: rgba(11, 11, 11, 0.20);
  --grid: #e1e0d9;
  --axis: #c3c2b7;

  --accent: #2a78d6;
  --accent-hover: #256abf;
  --accent-soft: #e8f1fc;
  --accent-contrast: #ffffff;
  --primary: #256abf;
  --primary-hover: #1c5cab;
  --focus-ring: rgba(42, 120, 214, 0.35);

  --good: #0ca30c;
  --good-text: #006300;
  --good-soft: #e5f4e5;
  --warning: #fab219;
  --warning-text: #7f5400;
  --warning-soft: #fdf3dc;
  --serious: #ec835a;
  --critical: #d03b3b;
  --critical-text: #b3292a;
  --critical-soft: #fbe9e8;

  --brand: #1a8f4a;
  --brand-strong: #12703a;
  --brand-soft: #e2f1e7;

  --toggle-off: #c3c2b7;
  --overlay: rgba(11, 11, 11, 0.42);
  --tooltip-bg: #1f1f1d;
  --tooltip-text: #ffffff;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2352514e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");

  --ill-barn: #c0513e;
  --ill-roof: #8e3a2d;
  --ill-door: #fbeede;
  --ill-silo: #d9d6cc;
  --ill-silo-top: #9f9b8e;
  --ill-fence: #a07850;
  --ill-trunk: #7a5a3a;

  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(11, 11, 11, 0.05);
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.04), 0 4px 14px rgba(11, 11, 11, 0.07);
  --shadow-lg: 0 2px 6px rgba(11, 11, 11, 0.06), 0 16px 40px rgba(11, 11, 11, 0.16);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  --header-h: 56px;
  --container: 1280px;
  --gutter: 24px;
}

/* ---------- Tokens: dark (OS setting, unless the user forced light) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #222220;
    --surface-3: #2c2c2a;
    --input-bg: #121211;
    --text: #ffffff;
    --text-2: #c3c2b7;
    --muted: #898781;
    --link: #6da7ec;
    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.20);
    --grid: #2c2c2a;
    --axis: #383835;
    --accent: #3987e5;
    --accent-hover: #5598e7;
    --accent-soft: #17283e;
    --accent-contrast: #ffffff;
    --primary: #256abf;
    --primary-hover: #2a78d6;
    --focus-ring: rgba(57, 135, 229, 0.45);
    --good: #0ca30c;
    --good-text: #0ca30c;
    --good-soft: #12261a;
    --warning: #fab219;
    --warning-text: #f5c04e;
    --warning-soft: #2c2412;
    --serious: #ec835a;
    --critical: #d03b3b;
    --critical-text: #f07b7b;
    --critical-soft: #331a19;
    --brand: #3fb56b;
    --brand-strong: #5cc983;
    --brand-soft: #16281d;
    --toggle-off: #4a4a46;
    --overlay: rgba(0, 0, 0, 0.62);
    --tooltip-bg: #f3f2ee;
    --tooltip-text: #0b0b0b;
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c3c2b7' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    --ill-barn: #a4483a;
    --ill-roof: #6e2e24;
    --ill-door: #e9dccb;
    --ill-silo: #6b6a64;
    --ill-silo-top: #8d8a80;
    --ill-fence: #8a6a48;
    --ill-trunk: #6a4e33;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.40);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 18px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.45), 0 18px 44px rgba(0, 0, 0, 0.55);
  }
}

/* ---------- Tokens: dark (forced by the theme toggle) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #222220;
  --surface-3: #2c2c2a;
  --input-bg: #121211;
  --text: #ffffff;
  --text-2: #c3c2b7;
  --muted: #898781;
  --link: #6da7ec;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.20);
  --grid: #2c2c2a;
  --axis: #383835;
  --accent: #3987e5;
  --accent-hover: #5598e7;
  --accent-soft: #17283e;
  --accent-contrast: #ffffff;
  --primary: #256abf;
  --primary-hover: #2a78d6;
  --focus-ring: rgba(57, 135, 229, 0.45);
  --good: #0ca30c;
  --good-text: #0ca30c;
  --good-soft: #12261a;
  --warning: #fab219;
  --warning-text: #f5c04e;
  --warning-soft: #2c2412;
  --serious: #ec835a;
  --critical: #d03b3b;
  --critical-text: #f07b7b;
  --critical-soft: #331a19;
  --brand: #3fb56b;
  --brand-strong: #5cc983;
  --brand-soft: #16281d;
  --toggle-off: #4a4a46;
  --overlay: rgba(0, 0, 0, 0.62);
  --tooltip-bg: #f3f2ee;
  --tooltip-text: #0b0b0b;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c3c2b7' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  --ill-barn: #a4483a;
  --ill-roof: #6e2e24;
  --ill-door: #e9dccb;
  --ill-silo: #6b6a64;
  --ill-silo-top: #8d8a80;
  --ill-fence: #8a6a48;
  --ill-trunk: #6a4e33;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.40);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 18px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.45), 0 18px 44px rgba(0, 0, 0, 0.55);
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.25; font-weight: 650; color: var(--text); letter-spacing: -0.005em; }
h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }
p { margin: 0 0 0.75em; }
p:last-child { margin-bottom: 0; }

a { color: var(--link); text-decoration: none; text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { text-decoration: underline; }
p a, .alert a, .auth-switch a, .field-hint a { text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg, canvas, video { max-width: 100%; }
svg { flex-shrink: 0; }
hr { border: 0; height: 1px; background: var(--border); margin: 16px 0; }
code, kbd, pre { font-family: var(--font-mono); font-size: 0.92em; }
kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface);
  font-size: 12px;
  line-height: 1.4;
}
::selection { background: var(--accent-soft); color: var(--text); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.icon { display: inline-block; vertical-align: middle; flex: none; }

/* ==========================================================================
   Layout: shell, header, containers
   ========================================================================== */

#app { min-height: 100vh; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  box-shadow: var(--shadow);
}
.skip-link:focus { top: 8px; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

.logo-mark { display: block; flex: none; }
.logo-mark-bg { fill: var(--brand); }
.logo-mark-leaf { fill: #ffffff; }
.logo-mark-vein { stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; }
.logo-mark-ground { stroke: #ffffff; stroke-width: 1.6; stroke-linecap: round; opacity: 0.55; }

.main-nav { display: flex; align-items: center; gap: 4px; min-width: 0; margin-left: 8px; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-weight: 550;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav-link.is-active { background: var(--accent-soft); color: var(--link); }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 4px; flex: none; }
.header-slot { display: flex; }

.user-menu .btn { padding-left: 4px; gap: 8px; max-width: 240px; }
.user-menu .btn > span:not(.avatar) { overflow: hidden; text-overflow: ellipsis; }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex: none;
}
.avatar--sm { width: 24px; height: 24px; font-size: 11px; }

.app-main {
  display: block;
  min-height: calc(100vh - var(--header-h));
  overflow-x: clip;
  outline: none;
}

.view-host { padding-top: 24px; padding-bottom: 56px; }
.view { min-width: 0; }

@media (max-width: 640px) {
  .header-inner { gap: 8px; }
  .brand-text { display: none; }
  .main-nav { margin-left: 2px; gap: 2px; }
  .nav-link { padding: 0 10px; }
  .user-menu .btn { padding-right: 4px; }
  .user-menu .btn > span:not(.avatar), .user-menu .btn-caret { display: none; }
  .view-host { padding-top: 16px; }
}
@media (max-width: 420px) {
  .nav-link .icon { display: none; }
}

/* Page / section headers */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.section-heading { min-width: 0; flex: 1 1 320px; }
.section-title { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
h1.section-title { font-size: 24px; letter-spacing: -0.015em; }
.section-subtitle { margin: 4px 0 0; color: var(--text-2); max-width: 760px; }
.section-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.page-header { margin-bottom: 24px; }

/* Scenario header (under the app header on #/s/:id routes) */
.scenario-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.scenario-header > .container { padding-top: 14px; }
.sh-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.sh-titles { min-width: 0; flex: 1 1 320px; }
.sh-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
}
.sh-back:hover { color: var(--text); text-decoration: none; }
.sh-name { margin: 2px 0 4px; font-size: 22px; font-weight: 700; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.sh-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; color: var(--text-2); }
.sh-meta-item { display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.sh-side { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding-top: 18px; }
.sh-status:empty { display: none; }
.sh-actions { display: flex; align-items: center; gap: 8px; }
.sh-tabs { margin-top: 10px; margin-bottom: -1px; }

@media (max-width: 640px) {
  .sh-name { font-size: 19px; }
  .sh-side { padding-top: 0; width: 100%; justify-content: space-between; }
  .sh-tabs .icon { display: none; }
  .sh-tabs .tab { padding-inline: 10px; }
}

/* Save status pill */
.save-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
}
.save-status--good .icon { color: var(--good); }
.save-status--warning .status-dot { background: var(--warning); }
.save-status--critical { color: var(--critical-text); background: var(--critical-soft); border-color: transparent; }
.save-status.is-button { cursor: pointer; }
.save-status.is-button:hover { filter: brightness(0.97); }
.save-status-retry { opacity: 0.85; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
@media (max-width: 480px) { .save-status-retry { display: none; } }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 550;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.is-busy { cursor: progress; }
.btn > span { min-width: 0; }

.btn-secondary { background: var(--surface); }

.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--accent-contrast); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.dropdown.is-open > .btn-ghost { background: var(--surface-3); color: var(--text); }

.btn-danger { background: var(--critical); border-color: var(--critical); color: #ffffff; }
.btn-danger:hover:not(:disabled) { filter: brightness(0.92); background: var(--critical); }

.btn-danger-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--critical-soft); color: var(--critical-text); }

.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; gap: 5px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 15px; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-icon.btn-lg { width: 44px; }
.btn-block { display: flex; width: 100%; }
.btn-caret { margin-left: -2px; opacity: 0.7; }

.btn-group { display: inline-flex; flex-wrap: wrap; gap: 8px; }

/* ==========================================================================
   Forms
   ========================================================================== */

.input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.3;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.input::placeholder { color: var(--muted); opacity: 1; }
.input:hover:not(:disabled):not(:focus) { border-color: var(--axis); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.input:disabled { background: var(--surface-2); color: var(--text-2); cursor: not-allowed; }
.input[readonly], .input.is-readonly { background: var(--surface-2); }
.input.is-invalid, .input[aria-invalid="true"] { border-color: var(--critical); }
.input.is-invalid:focus, .input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(208, 59, 59, 0.28); }

textarea.input { height: auto; min-height: 76px; padding: 8px 10px; line-height: 1.45; resize: vertical; }

select.input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
  text-overflow: ellipsis;
  cursor: pointer;
}
select.input:disabled { cursor: not-allowed; }

.input-number { text-align: right; font-variant-numeric: tabular-nums; }

.input-affix { position: relative; display: flex; align-items: center; width: 100%; min-width: 0; }
.input-affix.has-suffix .input { padding-right: calc(var(--suffix-len, 1) * 0.58em + 18px); }
.input-suffix {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  pointer-events: none;
}
.input-affix.has-action .input { padding-right: 42px; }
.input-action {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 32px;
  height: 30px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
}
.input-action:hover { background: var(--surface-3); color: var(--text); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text); }
.field-required { color: var(--critical-text); }
.field-control { min-width: 0; }
.field-hint { font-size: 12.5px; color: var(--text-2); line-height: 1.4; }
.field-error { font-size: 12.5px; color: var(--critical-text); font-weight: 550; }
.field--inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.field--inline .field-label { flex: 1 1 160px; }
.field--inline .field-control { flex: 0 1 auto; }
.field--inline .field-hint, .field--inline .field-error { flex-basis: 100%; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 16px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Checkbox */
.checkbox { display: inline-flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 14px; line-height: 1.4; }
.checkbox-input, .rt-enable, .sc-select {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--primary);
  cursor: pointer;
}
.checkbox-input:disabled, .rt-enable:disabled { cursor: not-allowed; }
.checkbox-text, .toggle-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.checkbox-hint, .toggle-hint { font-size: 12.5px; color: var(--text-2); }
.checkbox.is-disabled, .toggle.is-disabled { cursor: not-allowed; opacity: 0.6; }

/* Toggle (switch) */
.toggle { position: relative; display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; line-height: 1.4; }
.toggle-input { position: absolute; top: 0; left: 0; width: 36px; height: 22px; margin: 0; opacity: 0; cursor: pointer; }
.toggle-track {
  position: relative;
  flex: none;
  width: 36px;
  height: 20px;
  margin-top: 0;
  border-radius: 999px;
  background: var(--toggle-off);
  transition: background-color 0.15s;
}
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s;
}
.toggle-input:checked + .toggle-track { background: var(--primary); }
.toggle-input:checked + .toggle-track .toggle-thumb { transform: translateX(16px); }
.toggle-input:focus-visible + .toggle-track { box-shadow: 0 0 0 3px var(--focus-ring); }
.toggle-input:disabled + .toggle-track { opacity: 0.55; }

/* Segmented control */
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.segmented-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}
.segmented-item:hover:not(:disabled) { color: var(--text); }
.segmented-item.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.segmented--sm .segmented-item { height: 26px; padding: 0 10px; font-size: 12.5px; }

/* Month + year picker */
.month-input { display: flex; gap: 6px; width: 100%; min-width: 0; }
.month-input-month { flex: 1 1 auto; min-width: 0; }
.month-input-year { flex: 0 0 5.9em; min-width: 0; }

/* Chips & months picker */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}
.chip:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.chip.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--link); }
.chip:disabled { cursor: not-allowed; opacity: 0.6; }
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }

.months-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; max-width: 640px; }
.chip--month { padding: 0 4px; border-radius: var(--radius-sm); }
.chip.is-shake { animation: shake 0.3s; }

/* Slider */
.slider { display: flex; flex-direction: column; gap: 6px; min-width: 0; --pct: 50%; }
.slider-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.slider-label { font-size: 13px; font-weight: 600; }
.slider-value { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.slider-hint { font-size: 12px; color: var(--text-2); }
.slider-input { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; margin: 0; background: transparent; cursor: pointer; }
.slider-input:focus-visible { outline: none; }
.slider-input::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--accent) 0 var(--pct), var(--grid) var(--pct) 100%);
}
.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-sm);
}
.slider-input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--focus-ring); }
.slider-input::-moz-range-track { height: 4px; border-radius: 2px; background: var(--grid); }
.slider-input::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
.slider-input::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.slider-input:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--focus-ring); }
.slider.is-disabled { opacity: 0.55; }

/* Choice cards (radio as cards) */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 10px; }
.choice-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.choice-card:hover { background: var(--surface-2); }
.choice-card.is-active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.choice-card:has(.choice-input:focus-visible) { box-shadow: 0 0 0 3px var(--focus-ring); }
.choice-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.choice-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); }
.choice-card.is-active .choice-icon { background: var(--surface); color: var(--accent); }
.choice-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.choice-title { font-size: 14px; font-weight: 650; }
.choice-text { font-size: 12.5px; line-height: 1.4; color: var(--text-2); }

.import-box { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); }
.file-input { max-width: 100%; font-size: 13.5px; color: var(--text-2); }
.file-input::file-selector-button {
  margin-right: 10px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 550;
  cursor: pointer;
}

@media (max-width: 720px) {
  /* ≥16px prevents iOS from zooming into focused fields */
  .input { font-size: 16px; height: 40px; }
  textarea.input { height: auto; }
}

/* ==========================================================================
   Cards, KPI tiles
   ========================================================================== */

.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; padding: 16px 20px 0; }
.card-heading { min-width: 0; flex: 1 1 220px; }
.card-title { margin: 0; font-size: 15px; font-weight: 650; }
.card-subtitle { margin: 2px 0 0; font-size: 13px; color: var(--text-2); }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card-body { padding: 16px 20px 20px; min-width: 0; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card--flush > .card-body { padding: 12px 0 0; }
.card--flush > .card-body > .table-wrap { border: 0; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
@media (max-width: 640px) {
  .card-header { padding: 14px 16px 0; }
  .card-body { padding: 14px 16px 16px; }
  .card-footer { padding: 12px 16px; }
}

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; }
@media (max-width: 480px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

.kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.kpi-label { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; font-weight: 500; line-height: 1.35; color: var(--text-2); min-width: 0; }
/* Long Slovak labels wrap (e.g. „Čistá hodnota na konci“ in the 2-column phone grid) instead of being cut off. */
.kpi-label-text { min-width: 0; overflow-wrap: anywhere; }
.kpi-icon { flex: none; margin-top: 1px; color: var(--muted); }
.kpi-hint { flex: none; margin-top: 1px; display: inline-flex; color: var(--muted); cursor: help; border-radius: 50%; }
.kpi-value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 22px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
  overflow-wrap: anywhere;
}
.kpi-sub { font-size: 12.5px; color: var(--text-2); }
.kpi--good .kpi-value { color: var(--good-text); }
.kpi--good .kpi-tone-icon { color: var(--good); }
.kpi--bad .kpi-value { color: var(--critical-text); }
.kpi--bad .kpi-tone-icon { color: var(--critical); }
.kpi--warning .kpi-tone-icon { color: var(--warning); }
@media (max-width: 480px) {
  .kpi { padding: 12px; }
  .kpi-value { font-size: 18px; }
}

/* ==========================================================================
   Badges, alerts, tooltips
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.badge--neutral { border-color: var(--border); }
.badge--info, .badge--accent { background: var(--accent-soft); color: var(--link); }
.badge--good, .badge--success { background: var(--good-soft); color: var(--good-text); }
.badge--warning { background: var(--warning-soft); color: var(--warning-text); }
.badge--bad, .badge--critical, .badge--danger { background: var(--critical-soft); color: var(--critical-text); }
.badge--outline { background: transparent; border-color: var(--border-strong); }

.alert {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
}
.alert-icon { display: flex; flex: none; margin-top: 1px; }
.alert-content { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.alert-title { font-weight: 650; }
.alert-text { overflow-wrap: anywhere; }
.alert-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.alert-info { background: var(--accent-soft); border-color: rgba(42, 120, 214, 0.25); }
.alert-info .alert-icon { color: var(--accent); }
.alert-success { background: var(--good-soft); border-color: rgba(12, 163, 12, 0.28); }
.alert-success .alert-icon { color: var(--good); }
.alert-warning { background: var(--warning-soft); border-color: rgba(250, 178, 25, 0.45); }
.alert-warning .alert-icon { color: var(--warning-text); }
.alert-critical { background: var(--critical-soft); border-color: rgba(208, 59, 59, 0.3); }
.alert-critical .alert-icon { color: var(--critical); }
.alert-list { display: flex; flex-direction: column; gap: 8px; }

[data-tooltip] { position: relative; }
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: -8px;
  z-index: 30;
  width: max-content;
  max-width: min(280px, 72vw);
  padding: 6px 9px;
  border-radius: 6px;
  background: var(--tooltip-bg);
  color: var(--tooltip-text);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  white-space: normal;
  text-align: left;
  pointer-events: none;
}

/* ==========================================================================
   Tabs
   ========================================================================== */

.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 550;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab-count { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); font-size: 11.5px; color: var(--text-2); }

.tabs--underline { border-bottom: 1px solid transparent; }
.tabs--underline .tab { padding: 10px 12px; border-bottom: 2px solid transparent; }
.tabs--underline .tab.is-active { color: var(--text); border-bottom-color: var(--accent); }

.tabs--pills { gap: 4px; }
.tabs--pills .tab { height: 32px; padding: 0 12px; border-radius: 999px; }
.tabs--pills .tab:hover { background: var(--surface-3); }
.tabs--pills .tab.is-active { background: var(--accent-soft); color: var(--link); }

/* Vertical sub-navigation (e.g. editor sections) */
.subnav { display: flex; flex-direction: column; gap: 2px; }
.subnav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-weight: 550;
  text-decoration: none;
}
.subnav-link:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.subnav-link.is-active { background: var(--accent-soft); color: var(--link); }

/* ==========================================================================
   Tables
   ========================================================================== */

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.table-wrap--scroll-y { max-height: 520px; overflow-y: auto; }

.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 8px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--grid); }
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  border-bottom-color: var(--border-strong);
}
.data-table th:first-child, .data-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  background: var(--surface);
  box-shadow: inset -1px 0 0 var(--grid);
}
.data-table thead th:first-child { z-index: 3; background: var(--surface-2); }
/* Rules below cover row headers (<th scope="row">) as well as <td>, and beat the sticky first
   column's surface background (.data-table th:first-child) where a row fill is intended. */
.data-table tbody tr:hover > th, .data-table tbody tr:hover > td { background: var(--surface-2); }
.data-table tbody tr:last-child > th, .data-table tbody tr:last-child > td { border-bottom: 0; }
.data-table tfoot th, .data-table tfoot td, .data-table tr.is-total > th, .data-table tr.is-total > td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--border-strong); }
.data-table tfoot > tr > :first-child { background: var(--surface-2); }
.data-table tr.is-subtle > th, .data-table tr.is-subtle > td { color: var(--text-2); }
.data-table .text-left { text-align: left; }
.data-table .is-negative { color: var(--critical-text); }
.data-table--compact th, .data-table--compact td { padding: 6px 10px; }
.data-table caption { caption-side: top; text-align: left; padding: 0 0 8px; color: var(--text-2); font-size: 13px; }

/* ==========================================================================
   Modal, toast, dropdown
   ========================================================================== */

body.modal-open { overflow: hidden; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 16px 16px;
  overflow-y: auto;
  background: var(--overlay);
  animation: fade-in 0.15s ease-out;
}
.modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 8vh - 16px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  outline: none;
  animation: modal-in 0.18s ease-out;
}
.modal--sm { max-width: 440px; }
.modal--lg, .modal--wide { max-width: 760px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 6px 20px; }
.modal-title { margin: 0; font-size: 17px; font-weight: 650; }
.modal-close { margin: -4px -4px -4px 0; }
.modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px 20px 18px; }
.modal-message { margin: 0; color: var(--text-2); line-height: 1.55; overflow-wrap: anywhere; }
.modal-footer { display: flex; flex-wrap: wrap-reverse; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); }
@supports (height: 100dvh) {
  .modal { max-height: calc(100dvh - 8vh - 16px); }
}
@media (max-width: 560px) {
  .modal-backdrop { align-items: flex-end; padding: 12px; }
  .modal { max-height: calc(100vh - 24px); }
  .modal-footer .btn { flex: 1 1 auto; }
}

.toast-region {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 10px 12px 14px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  line-height: 1.4;
  pointer-events: auto;
  animation: toast-in 0.2s ease-out;
}
.toast.is-leaving { animation: toast-out 0.18s ease-in forwards; }
.toast-icon { display: flex; flex: none; margin-top: 0; }
.toast--info .toast-icon { color: var(--accent); }
.toast--success .toast-icon { color: var(--good); }
.toast--warning .toast-icon { color: var(--warning); }
.toast--error .toast-icon { color: var(--critical); }
.toast--error { border-left: 3px solid var(--critical); }
.toast-message { flex: 1; min-width: 0; padding-top: 1px; overflow-wrap: anywhere; }
.toast-action { flex: none; padding: 2px 6px; border: 0; border-radius: 4px; background: none; color: var(--link); font-weight: 650; }
.toast-action:hover { background: var(--surface-3); }
.toast-close { display: flex; flex: none; padding: 3px; border: 0; border-radius: 4px; background: none; color: var(--muted); }
.toast-close:hover { background: var(--surface-3); color: var(--text); }
@media (max-width: 560px) {
  .toast-region { left: 12px; right: 12px; bottom: 12px; width: auto; }
}

.dropdown { position: relative; display: inline-flex; }
.dropdown-menu {
  z-index: 1050;
  min-width: 210px;
  max-width: min(320px, calc(100vw - 16px));
  max-height: min(440px, calc(100vh - 80px));
  overflow-y: auto;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: menu-in 0.12s ease-out;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font-size: 14px;
  text-align: left;
}
.dropdown-item:hover:not(:disabled), .dropdown-item:focus-visible { background: var(--surface-3); outline: none; }
.dropdown-item .icon { color: var(--text-2); }
.dropdown-item.is-checked .icon { color: var(--accent); }
.dropdown-item.is-danger { color: var(--critical-text); }
.dropdown-item.is-danger .icon { color: currentColor; }
.dropdown-item:disabled { opacity: 0.5; cursor: not-allowed; }
.dropdown-item-text { display: flex; flex-direction: column; min-width: 0; }
.dropdown-item-hint { font-size: 12px; color: var(--text-2); }
.dropdown-divider { height: 1px; margin: 4px 0; background: var(--border); }
.dropdown-header {
  padding: 8px 10px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   Empty, loading, error states
   ========================================================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}
.empty-state--compact { padding: 24px 16px; }
.empty-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); }
.empty-title { margin: 8px 0 0; font-size: 16px; font-weight: 650; }
.empty-text { margin: 0; max-width: 540px; color: var(--text-2); }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.empty-illustration .ill-bg { fill: var(--brand-soft); }
.empty-illustration .ill-ground { stroke: var(--brand); stroke-width: 2; stroke-linecap: round; opacity: 0.45; fill: none; }
.empty-illustration .ill-stem { stroke: var(--brand); stroke-width: 2.5; stroke-linecap: round; fill: none; }
.empty-illustration .ill-leaf { fill: var(--brand); }
.empty-illustration .ill-leaf--2 { opacity: 0.7; }

.loading-state { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 56px 16px; color: var(--text-2); }

.spinner {
  display: inline-block;
  flex: none;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  opacity: 0.8;
  animation: spin 0.7s linear infinite;
}

.skeleton {
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton-title { height: 18px; width: 60%; }
.skeleton-line { height: 12px; width: 40%; }
.skeleton-block { height: 96px; width: 100%; }

.view-error { max-width: 760px; margin: 24px auto; }
.error-detail {
  margin: 6px 0 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   Record table (ui.recordTable) — desktop grid, cards when narrower than 720px
   ========================================================================== */

.rt { container: rt / inline-size; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rt-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.rt--empty .rt-scroll { display: none; }
.rt-grid { min-width: var(--rt-min, 0); }
.rt-head, .rt-row {
  display: grid;
  grid-template-columns: var(--rt-cols);
  column-gap: 8px;
  align-items: center;
  padding-inline: 8px;
}
.rt-head { background: var(--surface-2); border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.rt-th {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 8px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rt-th--number, .rt-th--money, .rt-th--computed, .rt-th.rt-align-right { justify-content: flex-end; }
.rt-th--checkbox, .rt-th--enabled, .rt-th.rt-align-center { justify-content: center; }
.rt-th-hint { color: var(--muted); }

.rt-row { padding-block: 6px; background: var(--surface); border-bottom: 1px solid var(--grid); }
.rt-body > .rt-row:last-child { border-bottom: 0; border-radius: 0 0 var(--radius) var(--radius); }
.rt-row:hover { background: var(--surface-2); }
.rt-row--expanded { background: var(--surface-2); }
.rt-row--flash { animation: rt-flash 1.4s ease-out; }

.rt-cell { display: flex; align-items: center; min-width: 0; }
.rt-cell > .input, .rt-cell > .input-affix, .rt-cell > .month-input, .rt-cell > .rt-custom, .rt-cell > select { flex: 1 1 auto; min-width: 0; }
.rt-row .input { height: 34px; }
.rt-label { display: none; }
.rt-sticky { position: sticky; z-index: 2; background: inherit; }
.rt-cell--primary.rt-sticky::after,
.rt-head .rt-sticky:not(.rt-th--enabled)::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: -8px;
  width: 8px;
  background: inherit;
}
.rt-head .rt-sticky { position: sticky; }
.rt-cell--enabled, .rt-cell--checkbox { justify-content: center; }
.rt-cell--actions { justify-content: flex-end; gap: 2px; }
.rt-cell--computed {
  justify-content: flex-end;
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rt-computed { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rt-align-right { justify-content: flex-end; text-align: right; }
.rt-align-center { justify-content: center; text-align: center; }
.rt-align-left { justify-content: flex-start; text-align: left; }
.rt-custom { display: flex; align-items: center; gap: 6px; min-width: 0; }

.rt-row--disabled > .rt-cell:not(.rt-cell--enabled):not(.rt-cell--actions) > * { opacity: 0.5; }
.rt-details-toggle .icon { transition: transform 0.15s; }
.rt-row--expanded .rt-details-toggle .icon { transform: rotate(180deg); }
.rt-details {
  position: sticky;
  left: 8px;
  grid-column: 1 / -1;
  width: calc(var(--rt-view-w, 100%) - 18px);
  max-width: 100%;
  margin-top: 8px;
  padding: 12px 4px 6px;
  border-top: 1px dashed var(--border-strong);
}

.rt-empty {
  display: none;
  padding: 20px;
  text-align: center;
  color: var(--text-2);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}
.rt--empty .rt-empty { display: block; }
.rt-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 18px;
  padding: 0 4px;
  font-size: 13.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.rt-footer strong { color: var(--text); font-weight: 650; }
.rt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Read-only: inputs look like plain text */
.rt--readonly .input:disabled {
  background: transparent;
  border-color: transparent;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  opacity: 1;
  cursor: default;
}
.rt--readonly select.input:disabled { background-image: none; padding-right: 10px; }
.rt--readonly .input-suffix { color: var(--text-2); }

@container rt (max-width: 719px) {
  .rt-scroll { overflow: visible; background: transparent; border: 0; border-radius: 0; }
  .rt-grid { min-width: 0; }
  .rt-head { display: none; }
  .rt-body { display: flex; flex-direction: column; gap: 10px; }
  .rt-row, .rt-body > .rt-row:last-child {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
  }
  .rt-sticky { position: static; }
  .rt-cell--primary.rt-sticky::after { display: none; }
  .rt-cell { flex: 1 1 calc(50% - 6px); flex-direction: column; align-items: stretch; gap: 4px; }
  .rt-cell > * { width: 100%; }
  .rt-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); }
  /* Card header: [include checkbox + text … actions], then the first column (the name) on its own
     full-width line with its label. A flex-basis of 0 here used to squeeze the name to a few px
     next to the following field; (0,2,0) also beats .rt-cell--month { flex-basis: 100% }. */
  .rt-cell--enabled { order: -3; flex: 0 0 auto; flex-direction: row; align-items: center; gap: 8px; align-self: center; }
  .rt-cell--enabled > * { width: auto; }
  .rt-cell--actions { order: -2; flex: 0 0 auto; flex-direction: row; align-self: center; margin-left: auto; }
  .rt-cell--actions > * { width: auto; }
  .rt-row > .rt-cell--primary { order: -1; flex: 1 1 100%; min-width: 0; }
  .rt-cell--text:not(.rt-cell--primary), .rt-cell--month, .rt-cell--custom { flex-basis: 100%; }
  .rt-cell--computed { align-items: flex-start; justify-content: flex-start; font-size: 14px; }
  .rt-cell--computed .rt-computed { padding: 2px 0; }
  .rt-cell--checkbox { align-items: flex-start; }
  .rt-cell--checkbox > * { width: auto; }
  .rt-hide-mobile { display: none; }
  .rt-row .input { height: 40px; }
  .rt-details { order: 10; flex-basis: 100%; position: static; width: auto; margin-top: 0; padding: 10px 0 0; }
  .rt-footer { justify-content: flex-start; }
}

@supports not (container-type: inline-size) {
  @media (max-width: 719px) {
    .rt-scroll { overflow: visible; background: transparent; border: 0; }
    .rt-grid { min-width: 0; }
    .rt-head { display: none; }
    .rt-body { display: flex; flex-direction: column; gap: 10px; }
    .rt-row { display: flex; flex-wrap: wrap; gap: 10px 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); }
    .rt-sticky { position: static; }
    .rt-cell { flex: 1 1 calc(50% - 6px); flex-direction: column; align-items: stretch; gap: 4px; }
    .rt-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); }
    .rt-cell--enabled { order: -3; flex: 0 0 auto; flex-direction: row; align-items: center; gap: 8px; }
    .rt-cell--actions { order: -2; flex: 0 0 auto; flex-direction: row; margin-left: auto; }
    .rt-row > .rt-cell--primary { order: -1; flex: 1 1 100%; min-width: 0; }
    .rt-cell--text:not(.rt-cell--primary), .rt-cell--month, .rt-cell--custom { flex-basis: 100%; }
    .rt-hide-mobile { display: none; }
    .rt-details { order: 10; flex-basis: 100%; position: static; width: auto; }
  }
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-width: 0; }
.row-between { justify-content: space-between; }
.row-end { justify-content: flex-end; }
.row-nowrap { flex-wrap: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }

.grid-2, .grid-3, .grid-auto { display: grid; gap: 16px; min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.span-all { grid-column: 1 / -1; }
@media (max-width: 1024px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }

.muted { color: var(--text-2); }
.faint { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.strong { font-weight: 650; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.text-good { color: var(--good-text); }
.text-bad, .is-negative { color: var(--critical-text); }
.text-warning { color: var(--warning-text); }
.divider { height: 1px; margin: 16px 0; background: var(--border); border: 0; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 32px; }

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Key–value list */
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ==========================================================================
   View: auth (login / register)
   ========================================================================== */

.auth-main { display: flex; min-height: 100vh; outline: none; overflow-x: clip; }
.auth-host, .auth-host > .view { display: flex; flex: 1; min-width: 0; }
.auth-layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; min-width: 0; }
.auth-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  min-width: 0;
  padding: 48px clamp(24px, 5vw, 72px);
  background: linear-gradient(160deg, var(--brand-soft) 0%, var(--accent-soft) 100%);
  border-right: 1px solid var(--border);
}
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; }
.auth-headline { margin: 8px 0 0; max-width: 560px; font-size: clamp(26px, 3.2vw, 38px); line-height: 1.12; font-weight: 750; letter-spacing: -0.025em; }
.auth-lead { margin: 0; max-width: 560px; font-size: 16px; line-height: 1.55; color: var(--text-2); }
.auth-features { display: grid; gap: 10px; max-width: 560px; margin: 4px 0 0; padding: 0; list-style: none; }
.auth-features li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.auth-feature-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--brand-strong);
}
.auth-illustration-wrap { max-width: 520px; margin-top: 8px; }
.auth-illustration { display: block; width: 100%; height: auto; }
.auth-panel { display: flex; align-items: center; justify-content: center; min-width: 0; padding: 40px 24px; background: var(--bg); }
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.auth-card-brand { display: none; align-items: center; gap: 10px; margin-bottom: 18px; font-weight: 700; font-size: 16px; }
.auth-title { margin: 0; font-size: 22px; font-weight: 700; }
.auth-subtitle { margin: 6px 0 20px; color: var(--text-2); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .btn-block { margin-top: 6px; }
.auth-error:not(:empty) { margin-bottom: 14px; }
.auth-switch { margin: 20px 0 0; text-align: center; font-size: 14px; color: var(--text-2); }

.ill-sky { fill: var(--surface); opacity: 0.65; }
.ill-sun { fill: var(--warning); opacity: 0.9; }
.ill-bird { fill: none; stroke: var(--text-2); stroke-width: 1.6; stroke-linecap: round; opacity: 0.55; }
.ill-hill-back { fill: var(--brand); opacity: 0.22; }
.ill-hill-front { fill: var(--brand); opacity: 0.38; }
.ill-rows { fill: none; stroke: var(--brand-strong); stroke-width: 2; stroke-linecap: round; opacity: 0.35; }
.ill-barn { fill: var(--ill-barn); }
.ill-roof { fill: var(--ill-roof); }
.ill-door, .ill-window { fill: var(--ill-door); }
.ill-door-cross { fill: none; stroke: var(--ill-barn); stroke-width: 2; }
.ill-silo { fill: var(--ill-silo); }
.ill-silo-top { fill: var(--ill-silo-top); }
.ill-silo-lines { fill: none; stroke: var(--ill-silo-top); stroke-width: 1.5; opacity: 0.6; }
.ill-trunk { fill: var(--ill-trunk); }
.ill-tree { fill: var(--brand); opacity: 0.85; }
.ill-fence { fill: none; stroke: var(--ill-fence); stroke-width: 3; stroke-linecap: round; }

@media (max-width: 900px) {
  .auth-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .auth-panel { order: 1; padding: 24px 16px 32px; align-items: flex-start; }
  .auth-hero { order: 2; padding: 32px 20px 40px; border-right: 0; border-top: 1px solid var(--border); }
  .auth-hero .auth-brand { display: none; }
  .auth-card-brand { display: flex; }
}
@media (max-width: 480px) {
  .auth-card { padding: 22px 18px; border-radius: 12px; }
  .auth-headline { font-size: 24px; }
  .auth-lead { font-size: 15px; }
}

/* ==========================================================================
   View: scenarios list
   ========================================================================== */

.scenarios-content { display: flex; flex-direction: column; gap: 36px; }
.sc-section-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.sc-section-title { margin: 0; font-size: 17px; font-weight: 650; }
.sc-section-text { margin: -4px 0 14px; font-size: 13.5px; max-width: 760px; }
.sc-count {
  padding: 1px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 550;
  color: var(--text-2);
  white-space: nowrap;
}
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }

.sc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sc-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.sc-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.sc-card.is-skeleton { min-height: 230px; gap: 14px; }
.sc-head { display: flex; align-items: flex-start; gap: 10px; }
.sc-select-wrap { display: flex; padding: 4px; margin: -2px -4px 0; cursor: pointer; }
.sc-heading { flex: 1; min-width: 0; }
.sc-title { margin: 0 0 6px; font-size: 16px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.sc-title a { color: var(--text); }
.sc-title a:hover { color: var(--link); }
.sc-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sc-period { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.sc-desc {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-2);
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.sc-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 0;
  padding: 12px;
  background: var(--surface-2);
  border-radius: var(--radius);
}
.sc-stat { min-width: 0; }
.sc-stat:nth-child(5) { grid-column: 1 / -1; }
.sc-stat dt { margin-bottom: 1px; font-size: 12px; color: var(--text-2); }
.sc-stat dd { margin: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-stat dd.sc-stat-main { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.sc-stat dd.is-negative { color: var(--critical-text); }
.sc-nosummary { display: flex; align-items: center; gap: 6px; margin: 0; padding: 12px; border-radius: var(--radius); background: var(--surface-2); font-size: 13px; color: var(--text-2); }
.sc-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.sc-updated { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.sc-footer-actions { display: flex; gap: 6px; }
.sc-empty-shared {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-2);
}
.owner-groups { display: flex; flex-direction: column; gap: 24px; }
.owner-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 14.5px; font-weight: 650; }

.compare-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--border-strong);
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.08);
  animation: slide-up 0.2s ease-out;
}
.compare-bar-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; max-width: calc(var(--container) - 2 * var(--gutter)); margin: 0 auto; }
.compare-bar-info { display: flex; flex-direction: column; flex: 1 1 200px; min-width: 0; }
.compare-bar-hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--text-2); }
.compare-bar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.view.has-compare-bar { padding-bottom: 96px; }

/* ==========================================================================
   View: account
   ========================================================================== */

.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.account-tips { grid-column: 1 / -1; }
.tips-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.tips-list li { display: flex; align-items: flex-start; gap: 10px; color: var(--text-2); }
.tips-list .icon { margin-top: 2px; color: var(--brand); }
@media (max-width: 800px) { .account-grid { grid-template-columns: minmax(0, 1fr); } }

/* ==========================================================================
   Boot splash, boot error, noscript
   ========================================================================== */

.boot-splash {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 100vh;
  padding: 24px;
  text-align: center;
  color: var(--text-2);
}
.boot-logo { width: 48px; height: 48px; }
.boot-title { font-size: 18px; font-weight: 700; color: var(--text); }
.boot-progress { width: 160px; height: 3px; overflow: hidden; border-radius: 3px; background: var(--grid); }
.boot-progress span { display: block; width: 40%; height: 100%; border-radius: 3px; background: var(--accent); animation: boot-bar 1.1s ease-in-out infinite; }
.boot-text { margin: 0; font-size: 14px; }
.boot-slow { max-width: 440px; margin: 0; font-size: 13px; opacity: 0; animation: fade-in 0.3s ease-out 10s forwards; }

.boot-error { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
.boot-error-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 480px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.boot-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.boot-error-card h1 { margin: 4px 0 0; font-size: 20px; }
.boot-error-card p { margin: 0; }
.boot-error-card .btn { align-self: flex-start; margin-top: 4px; }

.noscript {
  max-width: 520px;
  margin: 40px auto;
  padding: 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }
@keyframes slide-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes boot-bar { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@keyframes rt-flash { from { background-color: var(--accent-soft); } to { background-color: var(--surface); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
  :root,
  :root:not([data-theme="light"]),
  :root[data-theme="dark"] {
    color-scheme: light;
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #f4f4f2;
    --surface-3: #ebebe8;
    --text: #000000;
    --text-2: #3a3a38;
    --muted: #6b6a66;
    --border: rgba(0, 0, 0, 0.18);
    --border-strong: rgba(0, 0, 0, 0.3);
    --grid: #dddddd;
    --axis: #bbbbbb;
    --good-text: #006300;
    --critical-text: #a32020;
    --shadow-sm: none;
    --shadow: none;
    --shadow-lg: none;
  }
  html, body { background: #ffffff; }
  .app-header, .skip-link, .sh-tabs, .sh-side, .sh-back, .toast-region, .compare-bar, .modal-backdrop,
  .dropdown-menu, .rt-toolbar, .rt-cell--actions, .rt-cell--enabled, .btn, .dropdown, .sc-select-wrap,
  .boot-splash, .tabs, .segmented {
    display: none !important;
  }
  .app-main { min-height: 0; overflow: visible; }
  .container { max-width: none; padding-inline: 0; }
  .view-host { padding: 12px 0 0; }
  .scenario-header { border: 0; }
  .card, .kpi, .sc-card, .alert, .rt-row, .empty-state, figure { break-inside: avoid; page-break-inside: avoid; }
  .card, .kpi, .sc-card { box-shadow: none; }
  .table-wrap, .rt-scroll { overflow: visible; }
  .rt-grid { min-width: 0; }
  .input { border-color: transparent; background: transparent; }
  a { color: inherit; text-decoration: none; }
  canvas { max-width: 100% !important; height: auto !important; }
}
