/* Zelená zpráva prototype. Borrows the app's tokens and its data-source-card
   language so it can be lifted into the výzkumník shell once settled. */

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  --zz-inspector-width: clamp(20rem, 31vw, 28rem);
  margin: 0;
  background: var(--surface-page);
  color: var(--text);
  font-family: var(--font-sans);
}

button { font: inherit; color: inherit; }

.zz-app {
  display: grid;
  grid-template-columns: clamp(15rem, 21vw, 20rem) minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}

/* ── Rail ──────────────────────────────────────────────────────────── */

.zz-rail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.zz-rail-head { padding: 1.1rem 1rem .9rem; border-bottom: 1px solid var(--border-soft); }

.zz-brand {
  display: block;
  margin-bottom: .9rem;
  color: var(--ink);
  font-size: .82rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-decoration: none;
}

.zz-edition { display: grid; gap: .12rem; margin-bottom: .85rem; }
.zz-edition strong { color: var(--ink); font-size: 1.02rem; font-weight: 620; }
.zz-edition-picker { position: relative; width: fit-content; max-width: 100%; margin: .08rem 0 0 -.4rem; }
.zz-edition-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  min-width: 8.5rem;
  max-width: 100%;
  border: 0;
  border-radius: .45rem;
  padding: .32rem .45rem;
  background: transparent;
  color: var(--muted);
  font-size: .76rem;
  text-align: left;
  cursor: pointer;
}
.zz-edition-trigger:hover,
.zz-edition-trigger[aria-expanded="true"] { background: var(--hover-bg); color: var(--ink); }
.zz-edition-trigger:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.zz-edition-caret {
  width: .42rem;
  height: .42rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-.12rem) rotate(45deg);
  transition: transform var(--dur);
}
.zz-edition-trigger[aria-expanded="true"] .zz-edition-caret { transform: translateY(.1rem) rotate(225deg); }
.zz-edition-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + .25rem);
  left: 0;
  width: max-content;
  min-width: 11.5rem;
  max-width: calc(100vw - 2rem);
  padding: .3rem;
  border: 1px solid var(--border);
  border-radius: .65rem;
  background: var(--surface);
  box-shadow: 0 10px 28px rgb(15 23 42 / .12), 0 2px 6px rgb(15 23 42 / .06);
}
.zz-edition-option {
  display: flex;
  align-items: center;
  width: 100%;
  border: 0;
  border-radius: .42rem;
  padding: .48rem .58rem;
  background: transparent;
  color: var(--text);
  font-size: .76rem;
  text-align: left;
  cursor: pointer;
}
.zz-edition-option:hover,
.zz-edition-option:focus-visible { background: var(--hover-bg); outline: 0; }
.zz-edition-option[aria-selected="true"] { color: var(--ink); font-weight: 650; }

.zz-progress { display: grid; gap: .4rem; }
.zz-progress-bar { height: 4px; border-radius: 999px; background: var(--border-soft); overflow: hidden; }
.zz-progress-bar span { display: block; height: 100%; border-radius: 999px; background: var(--ink); }
.zz-progress-label { color: var(--muted); font-size: .72rem; }

.zz-tree { flex: 1; min-height: 0; padding: .6rem .5rem 1.4rem; overflow-y: auto; }

.zz-chapter-head {
  display: flex;
  align-items: baseline;
  gap: .45rem;
  width: 100%;
  padding: .5rem .55rem;
  border: 0;
  border-radius: .55rem;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.zz-chapter-head:hover { background: var(--hover-bg); }
.zz-chapter-caret { color: var(--muted); font-size: .8rem; transition: transform .15s ease; }
.zz-chapter.is-open .zz-chapter-caret { transform: rotate(90deg); }
.zz-chapter-num { color: var(--muted); font-size: .74rem; font-weight: 700; min-width: 1.1rem; }
.zz-chapter-title { flex: 1; color: var(--ink); font-size: .8rem; font-weight: 600; line-height: 1.35; }

/* The tree is navigation only -- no status markers on the chapters. */

.zz-chapter-body { display: none; padding: .1rem 0 .35rem .55rem; }
.zz-chapter.is-open .zz-chapter-body { display: block; }

/* A chapter with no subsections navigates straight to itself. */
.zz-chapter-leaf { padding-left: 1.5rem; }
.zz-chapter-leaf.is-current { background: var(--active-bg); }

.zz-section {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  padding: .38rem .5rem;
  border: 0;
  border-radius: .5rem;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.zz-section:hover { background: var(--hover-bg); }
.zz-section.is-current { background: var(--active-bg); }
.zz-section-num { color: var(--muted); font-size: .7rem; font-variant-numeric: tabular-nums; min-width: 2.4rem; }
.zz-section-title {
  flex: 1;
  min-width: 0;
  color: var(--text);
  font-size: .78rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.zz-section.is-current .zz-section-title { color: var(--ink); font-weight: 600; }

/* ── Header ────────────────────────────────────────────────────────── */

.zz-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.zz-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.6rem;
  padding: 1.15rem clamp(1.25rem, 3vw, 2.6rem) 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.zz-head-copy { flex: 1; min-width: 0; padding-bottom: 1rem; }
.zz-crumb { color: var(--muted); font-size: .74rem; font-weight: 600; letter-spacing: .04em; }
.zz-head h1 {
  margin: .18rem 0 0;
  color: var(--ink);
  font-size: 1.4rem;
  font-weight: 620;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zz-tabs { display: flex; gap: .3rem; align-self: flex-end; flex: none; }
.zz-tab {
  position: relative;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: .55rem .9rem .8rem;
  background: transparent;
  color: var(--muted);
  font-size: .86rem;
  cursor: pointer;
}
.zz-tab:hover { color: var(--ink); }
.zz-tab.is-active { border-bottom-color: var(--ink); color: var(--ink); font-weight: 560; }
.zz-tab-count {
  margin-left: .25rem;
  border-radius: 999px;
  padding: .05rem .38rem;
  background: var(--active-bg);
  color: var(--muted);
  font-size: .7rem;
  font-variant-numeric: tabular-nums;
}

.zz-tab-count:empty { display: none; }

.zz-btn { border: 1px solid transparent; border-radius: 999px; padding: .5rem 1.05rem; font-size: .82rem; cursor: pointer; }
.zz-btn:disabled { opacity: .35; cursor: default; }
.zz-btn-primary { background: var(--ink); color: #fff; }
.zz-btn-ghost { border-color: var(--border-input); background: var(--surface); color: var(--text); }
.zz-btn-ghost:hover { background: var(--hover-bg); }

.zz-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ── Podklady ──────────────────────────────────────────────────────── */

.zz-view-podklady { overflow-y: auto; }
.zz-view-inner { width: 100%; padding: 1.8rem clamp(1.25rem, 3vw, 2.6rem) 4rem; }
.zz-view-lead { margin: 0 0 1.3rem; color: var(--muted); font-size: .82rem; line-height: 1.6; max-width: 46rem; }

.zz-workspace {
  width: 100%;
}

.zz-layer-workspace {
  display: grid;
  gap: 1rem;
  width: 100%;
  min-width: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.zz-podklady-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .8rem;
  min-height: 2.1rem;
}
.zz-content-groups { display: grid; gap: 1rem; }
.zz-readonly-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 2rem;
}
.zz-readonly-values .zz-metric-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .18rem 1rem;
}
.zz-readonly-values .zz-metric-source,
.zz-readonly-values .zz-metric-formula { grid-column: 1; grid-row: 2; }
.zz-readonly-values .zz-metric-value { grid-column: 2; grid-row: 1 / span 2; }
.zz-workspace-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .8rem;
}
.zz-data-layer {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.45rem 1.6rem 1.6rem;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(15 23 42 / .025);
}
.zz-data-layer + .zz-data-layer {
  margin-top: 0;
}
.zz-automatic-layer,
.zz-derived-layer { background: #fbfcfd; }
.zz-workspace-heading,
.zz-input-workspace-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1.5rem;
}
.zz-workspace-heading h2,
.zz-input-workspace-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: .96rem;
  font-weight: 620;
  letter-spacing: -.01em;
}
.zz-content-source-link { color: inherit; text-decoration: none; }
.zz-content-source-link:hover { text-decoration: underline; }
.zz-content-source-link:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 3px; }
.zz-workspace-heading p,
.zz-input-workspace-head p {
  margin: .28rem 0 0;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.5;
}
.zz-workspace-heading .zz-btn { flex: none; display: inline-flex; align-items: center; gap: .42rem; }
.zz-workspace-heading .zz-icon { width: .9rem; height: .9rem; fill: none; stroke: currentColor; stroke-width: 1.9; }
.zz-workspace-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .8rem;
}
.zz-refresh-meta {
  color: var(--muted);
  font-size: .72rem;
  text-decoration: none;
}
.zz-refresh-meta:hover { color: var(--ink); text-decoration: underline; }
.zz-refresh-meta:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 3px; }
.zz-metric-list { border-top: 1px solid var(--border-soft); }
.zz-metric-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 1rem;
  align-items: center;
  padding: .72rem 0;
  border-bottom: 1px solid var(--border-soft);
}
.zz-metric-list button.zz-metric-row {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.zz-metric-list button.zz-metric-row:hover { background: var(--hover-bg); }
.zz-metric-row > div { display: grid; gap: .16rem; }
.zz-metric-row strong { color: var(--ink); font-size: .8rem; font-weight: 610; }
.zz-metric-row span { color: var(--muted); font-size: .7rem; line-height: 1.4; }
.zz-readonly-values .zz-metric-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .18rem 1rem;
}
.zz-metric-formula {
  color: var(--muted) !important;
  font-size: .76rem !important;
  font-variant-numeric: tabular-nums;
}
.zz-metric-source {
  min-width: 0;
  overflow: hidden;
  color: var(--muted) !important;
  font-size: .76rem !important;
  line-height: 1.4;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
a.zz-metric-source:hover { color: var(--ink) !important; text-decoration: underline; }
a.zz-metric-source:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.zz-metric-value { color: var(--ink) !important; font-size: .8rem !important; font-weight: 620; font-variant-numeric: tabular-nums; text-align: right; }
.zz-metric-action { border: 0; background: transparent; color: var(--muted); font-size: .72rem; cursor: pointer; }
.zz-metric-action:hover { color: var(--ink); text-decoration: underline; }
.zz-metric-row.is-overridden .zz-metric-value { color: #7c5f18 !important; }
.zz-auto-sources { display: grid; gap: 1rem; }
.zz-auto-source-block { display: grid; gap: .7rem; }
.zz-auto-source {
  display: flex;
  align-items: baseline;
  gap: .65rem;
  width: fit-content;
  color: inherit;
  text-decoration: none;
}
.zz-auto-source:hover .zz-auto-source-name { text-decoration: underline; }
.zz-auto-source:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.zz-auto-source-name { color: var(--ink); font-size: .86rem; font-weight: 620; line-height: 1.35; }
.zz-auto-source-issue { color: #8b5f15; font-size: .7rem; line-height: 1.4; }
.zz-auto-source.has-error .zz-auto-source-issue { color: #9f3434; }
.zz-workspace-heading .zz-btn.is-error { border-color: #dba5a5; color: #9f3434; }
.zz-input-workspace {
  width: 100%;
  min-width: 0;
  overflow: visible;
}
.zz-input-workspace-head { margin-bottom: 1.45rem; padding: 0; }
.zz-form-segment + .zz-form-segment { margin-top: 1.6rem; }
.zz-form-segment-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: .65rem;
  padding: 0;
}
.zz-form-segment-head h3 { margin: 0; color: var(--ink); font-size: .93rem; font-weight: 630; }
.zz-form-segment-head p { max-width: 48rem; margin: .28rem 0 0; color: var(--muted); font-size: .77rem; line-height: 1.5; }
.zz-form-segment-head > span { flex: none; color: var(--faint); font-size: .72rem; font-variant-numeric: tabular-nums; }
.zz-inline-warning { margin: 0 1.3rem .9rem; color: #7c5f18; font-size: .74rem; line-height: 1.45; }
.zz-inline-warning.is-error { color: #a03838; }

.zz-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: .8rem;
}

.zz-source-audit {
  grid-column: 1 / -1;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(15 23 42 / .04);
}

.zz-audit-head {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border-soft);
  padding: .9rem 1rem;
}
.zz-audit-head > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: .45rem .6rem; flex: none; }
.zz-audit-head strong { color: var(--ink); font-size: .9rem; }
.zz-audit-head span { color: var(--muted); font-size: .68rem; }
.zz-audit-head .zz-audit-status {
  border-radius: 999px;
  padding: .12rem .42rem;
  background: #fff3d6;
  color: #8a5b00;
  font-weight: 650;
}
.zz-audit-head .zz-audit-status.is-manual { background: #f1f3f5; color: #64748b; }
.zz-audit-head p { max-width: 48rem; margin: 0; color: var(--muted); font-size: .72rem; line-height: 1.45; }
.zz-audit-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.zz-audit-group { min-width: 0; padding: .85rem 1rem 1rem; }
.zz-audit-group + .zz-audit-group { border-left: 1px solid var(--border-soft); }
.zz-audit-group h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin: 0 0 .6rem;
  color: #334155;
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.zz-audit-group h3 span { border-radius: 999px; padding: .08rem .38rem; background: #eef1f4; font-size: .66rem; }
.zz-audit-group.is-available h3 span { background: #e8f4ed; color: #267247; }
.zz-audit-group.is-candidate h3 span { background: #fff3d6; color: #8a5b00; }
.zz-audit-group ul { display: grid; gap: .52rem; margin: 0; padding: 0; list-style: none; }
.zz-audit-group li { display: grid; gap: .12rem; min-width: 0; }
.zz-audit-group li strong { color: #344152; font-size: .75rem; line-height: 1.3; overflow-wrap: anywhere; }
.zz-audit-group li em { color: #8a5b00; font-size: .67rem; font-style: normal; }
.zz-audit-group li small, .zz-audit-group > p { margin: 0; color: var(--muted); font-size: .68rem; line-height: 1.35; }

.zz-source-coverage {
  justify-self: start;
  border-radius: 999px;
  padding: .12rem .45rem;
  background: #eef1f4;
  color: #64748b;
  font-size: .64rem;
  font-weight: 650;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.zz-source-coverage.is-available { background: #e8f4ed; color: #267247; }

@media (max-width: 880px) {
  .zz-audit-head { display: block; }
  .zz-audit-head p { margin-top: .45rem; }
  .zz-audit-groups { grid-template-columns: 1fr; }
  .zz-audit-group + .zz-audit-group { border-top: 1px solid var(--border-soft); border-left: 0; }
}

/* Same language as .data-source-card in the app. */
.zz-source-card {
  display: grid;
  align-content: start;
  gap: .45rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .85rem .95rem .9rem;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(15 23 42 / .04);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.zz-source-card:hover {
  background: #f7f8f9;
  border-color: #bfc7d1;
  box-shadow: 0 2px 7px rgb(15 23 42 / .06);
}
/* An absent source is an empty slot, not a failure: dashed outline, no badge,
   and the action it is waiting for written on it. */
.zz-source-card.is-missing {
  border-style: dashed;
  border-color: var(--border-input);
  background: transparent;
  box-shadow: none;
}
.zz-source-card.is-missing:hover { background: var(--surface); border-color: var(--border-card-hover); }
.zz-source-card.is-missing .zz-source-name { color: var(--muted); }
.zz-source-card.is-missing:hover .zz-source-name { color: #273548; }
.zz-source-card.has-warning { border-color: #dec98c; }
.zz-source-card.has-error { border-color: #d8a5a5; background: #fffafa; }

.zz-source-name { color: #273548; font-size: .88rem; font-weight: 600; line-height: 1.3; }
.zz-source-card:hover .zz-source-name { color: var(--ink); }
.zz-source-description { color: var(--muted); font-size: .78rem; line-height: 1.5; }
.zz-source-presentation-warning {
  border-left: 2px solid #c99b34;
  padding-left: .55rem;
  color: #735914;
  font-size: .7rem;
  line-height: 1.4;
}
.zz-source-card.has-error .zz-source-presentation-warning { border-left-color: #bd5f5f; color: #8b3030; }

.zz-source-slot {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-top: .35rem;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 550;
}
.zz-source-card.is-missing:hover .zz-source-slot { color: var(--ink); }

.zz-icon {
  width: .9rem;
  height: .9rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zz-source-needs { display: flex; flex-wrap: wrap; gap: .28rem; margin-top: .25rem; }
.zz-need {
  border: 1px solid var(--border-soft);
  border-radius: .3rem;
  padding: .1rem .4rem;
  background: var(--surface);
  color: var(--muted);
  font-size: .7rem;
}

/* ── Koncept: the document ─────────────────────────────────────────── */

.zz-view-navrh { position: relative; }

.zz-doc-actions {
  position: absolute;
  z-index: 4;
  top: calc(100% + .7rem);
  right: clamp(1.25rem, 3vw, 2.6rem);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: max-content;
  margin: 0;
  gap: .55rem;
}
.zz-doc-actions[hidden] { display: none; }
.zz-concept-action { display: flex; align-items: center; }


.zz-doc-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.9rem 1.5rem 4rem;
  transition: padding-right 220ms cubic-bezier(.22, 1, .36, 1);
}
.zz-main.is-inspector-open .zz-doc-scroll {
  padding-right: calc(var(--zz-inspector-width) + 1.5rem);
}

/* A stack of actual A4 sheets. JavaScript flows top-level report blocks across
   these pages; the dimensions and margins match the export profile. */
.zz-doc {
  width: min(210mm, 100%);
  margin: 0 auto;
  color: #1c2431;
  font-size: .95rem;
  line-height: 1.85;
  text-align: justify;
  hyphens: auto;
}
.zz-doc-page {
  width: 100%;
  margin: 0 0 1.35rem;
  border: 1px solid var(--border-soft);
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 1px 3px rgb(15 23 42 / .07), 0 10px 30px rgb(15 23 42 / .05);
  overflow: hidden;
}
.zz-doc-page:last-child { margin-bottom: 0; }

.zz-doc-title {
  margin: 0 0 1.5rem;
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 650;
  text-align: left;
  hyphens: none;
}

.zz-doc p { margin: 0 0 1.15rem; }
.zz-doc p:last-child { margin-bottom: 0; }
.zz-doc.is-last { color: #55606f; }
.zz-doc [data-zz-edit-block] { outline: none; }
.zz-doc [data-zz-edit-block]:focus-visible {
  border-radius: 2px;
  box-shadow: 0 0 0 2px rgb(75 102 83 / .14);
}

/* Report tables are page objects, not browser data grids. Their fixed column
   model mirrors the Word export: a generous label, a narrow unit, and equal
   value columns. Notes and sources sit below the grid at full measure. */
.zz-doc-table-block {
  margin: .55rem 0 1.55rem;
  text-align: left;
  hyphens: none;
}

.zz-doc-table-block figcaption {
  margin: 0 0 .42rem;
  color: #18231d;
  font-size: .82rem;
  font-weight: 680;
  line-height: 1.35;
}

.zz-doc-table-frame {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}
.zz-doc-table-frame:focus-visible {
  outline: 2px solid #557563;
  outline-offset: 3px;
}

.zz-doc-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border-top: 1px solid #9eada3;
  border-bottom: 1px solid #9eada3;
  color: #202a24;
  font-size: .69rem;
  line-height: 1.25;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.zz-doc-table-block.is-wide .zz-doc-table { font-size: .64rem; }

/* A near-fit table may tighten slightly to remain a single publication object.
   This is applied only after measuring an A4 page, never as the default style. */
.zz-doc-table-block.is-condensed { margin-bottom: .8rem; }
.zz-doc-table-block.is-condensed .zz-doc-table { font-size: .64rem; }
.zz-doc-table-block.is-condensed .zz-doc-table :is(th, td) { padding: .17rem .26rem; }
.zz-doc-table-block.is-condensed .zz-table-notes {
  gap: .08rem;
  margin-top: .28rem;
  font-size: .63rem;
  line-height: 1.3;
}

.zz-doc-table col.zz-col-label { width: 35%; }
.zz-doc-table col.zz-col-unit { width: 8%; }
.zz-doc-table col.is-change { width: 10%; }
.zz-doc-table-block.is-wide .zz-doc-table col.zz-col-label { width: 28%; }
.zz-doc-table-block.is-wide .zz-doc-table col.zz-col-unit { width: 7%; }
.zz-doc-table-block.is-wide .zz-doc-table col.is-change { width: 8%; }

.zz-doc-table :is(th, td) {
  border-right: 1px solid #d7ded9;
  border-bottom: 1px solid #d7ded9;
  padding: .22rem .3rem;
  vertical-align: top;
}
.zz-doc-table :is(th, td):last-child { border-right: 0; }

.zz-doc-table thead th {
  border-bottom-color: #9eada3;
  background: #edf3ef;
  color: #17231c;
  font-weight: 700;
  line-height: 1.18;
  text-align: center;
  overflow-wrap: normal;
}

.zz-doc-table tbody th[scope="row"] { color: #202a24; font-weight: 560; }
.zz-doc-table .zz-col-label { overflow-wrap: anywhere; text-align: left; }
.zz-doc-table .zz-col-unit { text-align: center; white-space: nowrap; }
.zz-doc-table .zz-col-value,
.zz-doc-table .is-right { text-align: right; white-space: nowrap; }
.zz-doc-table thead th.is-right {
  overflow-wrap: normal;
  white-space: normal;
}
.zz-doc-table thead th.is-period {
  padding-inline: .18rem;
  font-size: .9em;
  white-space: nowrap;
}
.zz-doc-table .is-center { text-align: center; }
.zz-doc-table .is-current { background: #f3f8f4; }
.zz-doc-table .is-change { background: #f5f7f8; }
.zz-doc-table thead .is-current { background: #dfece2; }
.zz-doc-table thead .is-change { background: #e9edef; }

.zz-doc-table .zz-table-group th {
  border-top: 1px solid #aab7ae;
  border-bottom-color: #aab7ae;
  padding-block: .28rem;
  background: #f1f5f2;
  color: #24352a;
  font-style: italic;
  font-weight: 700;
  text-align: center;
}
.zz-doc-table .zz-table-subhead th {
  border-bottom-color: #aebbb2;
  background: #f5f7f5;
  color: #344239;
  font-weight: 680;
  text-align: center;
}
.zz-doc-table tr.is-key-row > :first-child { font-weight: 720; }
.zz-doc-table tr.is-subrow > :first-child { padding-left: .9rem; font-weight: 450; }

.zz-table-notes {
  display: grid;
  gap: .12rem;
  margin-top: .38rem;
  color: #4d5b52;
  font-size: .67rem;
  line-height: 1.38;
  text-align: left;
}
.zz-table-notes p,
.zz-doc-page > .zz-table-note,
.zz-doc-page > .zz-table-source,
.zz-doc-page > .zz-table-credit { margin: 0; }
.zz-table-notes strong,
.zz-table-note strong,
.zz-table-source strong,
.zz-table-credit strong { color: #314139; font-weight: 700; }
.zz-table-source { margin-top: .18rem !important; }
.zz-table-credit { margin-top: .18rem !important; }

/* Wide matrices stay within the A4 sheet, matching the exported page rather
   than turning the preview into a separate browser-only canvas. */
.zz-doc.has-wide-tables { width: min(210mm, 100%); }

.zz-chart {
  position: relative;
  width: 100%;
  min-height: 320px;
  margin: .55rem 0 1.6rem;
  overflow: visible;
}
.zz-chart figcaption {
  margin: 0 0 .45rem;
  color: #18231d;
  font-size: .82rem;
  font-weight: 680;
  line-height: 1.35;
  text-align: left;
}
.zz-chart-plot { width: 100%; height: 320px; }
.zz-chart-plot .vega-embed,
.zz-chart-plot .vega-embed > div,
.zz-chart-plot svg { max-width: 100%; }
.zz-chart-error { color: #b91c1c; font-size: .8rem; }

.zz-doc-empty { display: grid; justify-items: center; gap: 1rem; padding: 3rem 0; text-align: center; }
.zz-doc-empty p { margin: 0; color: var(--muted); }

/* A section with no template yet, in either view. */
.zz-blank {
  display: grid;
  justify-items: start;
  gap: .55rem;
  max-width: 34rem;
  border: 1px dashed var(--border-input);
  border-radius: .8rem;
  padding: 1.4rem 1.5rem;
  text-align: left;
  hyphens: none;
}
.zz-blank p { margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.6; }
.zz-blank strong { color: var(--ink); font-weight: 600; }
.zz-blank .zz-btn { margin-top: .35rem; }

/* Unmarked, always: the page has to read exactly as it will in Word. A figure
   shows itself only under the cursor, as a solid highlight and nothing else. */
.zz-fig {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background .12s ease;
}
.zz-fig:hover { background: #e6edf7; }

/* ── Drawer ────────────────────────────────────────────────────────── */

.zz-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: min(var(--zz-inspector-width), 100vw);
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: -12px 0 32px rgb(15 23 42 / .08);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(calc(100% + 40px));
  transition:
    transform 220ms cubic-bezier(.22, 1, .36, 1),
    opacity 150ms ease,
    visibility 0s linear 220ms;
}
.zz-drawer.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
  transition-delay: 0s;
}

.zz-drawer-action {
  display: grid;
  place-items: center;
  position: absolute;
  z-index: 2;
  left: -34px;
  top: 50%;
  width: 34px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: 10px 0 0 10px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transform: translateY(-50%);
  box-shadow: -5px 0 14px rgb(15 23 42 / .04);
}
.zz-drawer-action:hover { background: var(--hover-bg); color: var(--ink); }
.zz-drawer-action svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.zz-drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 1.4rem 1.35rem 2rem; }

.zz-drawer-title { margin: 0; color: var(--ink); font-size: 1.15rem; font-weight: 620; font-variant-numeric: tabular-nums; }
.zz-drawer-label { margin: .2rem 0 1.15rem; color: var(--muted); font-size: .82rem; line-height: 1.55; }
.zz-drawer-block { margin-bottom: 1.2rem; }
.zz-drawer-block h4 {
  margin: 0 0 .45rem;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.zz-drawer-note { margin: 0; font-size: .8rem; line-height: 1.6; }
.zz-presentation-warning { border-left: 3px solid #c99b34; padding-left: .7rem; }
.zz-presentation-warning.is-error { border-left-color: #bd5f5f; }
.zz-bad { color: #b91c1c; }

.zz-drawer-source {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .7rem .85rem;
  background: var(--surface-inset);
}
.zz-drawer-source.is-missing { border-style: dashed; border-color: #e7c9c9; background: #fdfafa; }
.zz-drawer-source-name { color: #273548; font-size: .84rem; font-weight: 600; }
.zz-drawer-source-origin { margin-top: .18rem; color: var(--muted); font-family: var(--font-mono); font-size: .71rem; }

/* The uploaded file, with the way to put a new one over it. */
.zz-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .7rem .85rem;
  background: var(--surface-inset);
}
.zz-file-main { min-width: 0; }
.zz-file-name { color: #273548; font-family: var(--font-mono); font-size: .76rem; overflow-wrap: anywhere; }
.zz-file-meta { margin-top: .2rem; color: var(--muted); font-size: .74rem; }
.zz-file-replace { flex: none; padding: .34rem .8rem; font-size: .76rem; }

.zz-btn .zz-icon { margin-right: .4rem; vertical-align: -.12em; }
.zz-btn-primary { display: inline-flex; align-items: center; }

.zz-mini { width: 100%; border-collapse: collapse; font-size: .76rem; }
.zz-mini th {
  border-bottom: 1px solid var(--border);
  padding: .35rem .45rem;
  color: var(--muted);
  font-size: .69rem;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}
.zz-mini td { border-bottom: 1px solid var(--border-soft); padding: .32rem .45rem; }

.zz-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.zz-table th,
.zz-table td {
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  padding: 5px 8px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.zz-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-inset);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  /* The workbook grid centres its headings because they are column letters.
     These are real labels, so each one sits over its own column instead. */
  text-align: left;
}
/* `.zz-table th` sets the default alignment and outranks a bare class. */
.zz-table th.zz-numcell { text-align: right; }

/* Only the header sticks. No table in the app freezes a column -- the chat's
   md-table and the datasource sheet both pin the header row alone -- and the
   workbook grid's frozen gutter is a row-number column, not a data one. */
.zz-table .zz-rowlabel { color: var(--ink); }

.zz-numcell { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.zz-unit { color: var(--muted); white-space: nowrap; }
.zz-group td { background: var(--surface-inset); font-weight: 600; }
.zz-table tbody tr:hover td { background: var(--hover-bg); }

/* The exact cells the figure was read from. */
.zz-table td.is-hit { background: #e6edf7; color: var(--ink); font-weight: 600; }
.zz-table tr:hover td.is-hit { background: #dbe6f4; }
.zz-rowlabel.is-hit-row { font-weight: 600; }
.zz-table tbody tr:hover .zz-rowlabel.is-hit-row { background: #dbe6f4; }

@media (max-width: 900px) {
  .zz-app { grid-template-columns: minmax(0, 1fr); }
  .zz-rail { display: none; }
  .zz-drawer { width: calc(100vw - 52px); }
  .zz-main.is-inspector-open .zz-doc-scroll { padding-right: 1.5rem; }
}

.zz-blank-list { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem; }
.zz-blank-link {
  border: 1px solid var(--border-soft);
  border-radius: .35rem;
  padding: .05rem .38rem;
  background: var(--surface);
  color: var(--text);
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.zz-blank-link:hover { border-color: var(--border-card-hover); color: var(--ink); }

/* Already in the catalogue: available, but not an uploaded file either. */
.zz-source-card.is-catalogue { border-color: #cfe0d3; background: #fbfdfc; }
.zz-source-card.is-catalogue:hover { background: #f4faf6; border-color: #b6d4c2; }
.zz-source-card.is-catalogue .zz-source-slot { color: #15803d; }

/* The request that produced a pinned extract, shown under its table. Rendered
   as label/value rows rather than raw JSON: the point is that an author can
   read which dimension was filtered, not that the payload is reproduced. */
.zz-query {
  display: grid;
  gap: 0.35rem;
  font-size: 0.82rem;
}
.zz-query > div {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 0.6rem;
  align-items: baseline;
}
.zz-query span { color: var(--zz-muted, #667); }
.zz-query code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  color: var(--zz-ink, #1a2230);
  word-break: break-word;
}

/* Optional source refresh stays inside the compact inspector content. */
.zz-drawer-actions { display: flex; margin-top: 1rem; }
.zz-drawer-refresh {
  position: static;
  width: auto;
  height: auto;
  gap: .4rem;
  grid-auto-flow: column;
  align-items: center;
  padding: .45rem .65rem;
  border: 0;
  border-radius: .45rem;
  font: inherit;
  font-size: .76rem;
  transform: none;
  box-shadow: none;
}
.zz-drawer-refresh .zz-icon {
  width: .85rem;
  height: .85rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.zz-drawer-refresh .zz-when { color: var(--faint); font-variant-numeric: tabular-nums; }
.zz-drawer-refresh:hover .zz-when { color: var(--muted); }

/* Above the drafted text: when it was written, and whether the podklady have
   moved since. Muted when in step, marked when not -- a chapter that is older
   than its data is the one thing a reader must not miss. */
/* Bullets in the drafted text, matching the Word "List Bullet" style the
   export uses. */
.zz-doc-list { margin: 0 0 1rem; padding-left: 1.3rem; }
.zz-doc-list li { margin: 0 0 .35rem; }

.zz-chart.is-reference .zz-chart-plot {
  min-height: 0;
  height: auto;
}

.zz-reference-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.zz-source-gap {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 15px;
  border: 1px solid #bdd8c5;
  border-radius: 10px;
  background: #f3faf5;
  color: #31543b;
}

.zz-source-gap.has-gaps {
  border-color: #e4d19c;
  background: #fff9e9;
  color: #654f1f;
}

.zz-source-gap span { font-size: 13px; line-height: 1.45; }

/* ── Direct manual entry ───────────────────────────────────────────── */

.zz-source-card.is-manual,
.zz-source-card-manual {
  border-color: #d8d2e7;
  background: #fcfbff;
}
.zz-source-card.is-manual:hover,
.zz-source-card-manual:hover { border-color: #bbb0d3; background: #f8f6fc; }
.zz-source-card.is-manual .zz-source-slot,
.zz-source-card-manual .zz-source-slot { color: #67558d; }

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

.zz-manual-form {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: var(--surface);
}

.zz-manual-intro {
  display: grid;
  gap: .25rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border-soft);
  background: #faf9fc;
}
.zz-manual-intro strong { color: var(--ink); font-size: .84rem; }
.zz-manual-intro span { max-width: 55rem; color: var(--muted); font-size: .74rem; line-height: 1.5; }

.zz-edit-table input,
.zz-edit-table textarea,
.zz-manual-field input,
.zz-manual-field textarea {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid var(--border-input);
  border-radius: 6px;
  padding: .42rem .5rem;
  background: #fff;
  color: var(--ink);
  font: inherit;
  line-height: 1.35;
}

.zz-edit-scroll { flex: 1; min-height: 0; overflow: auto; }
.zz-edit-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.zz-edit-table th,
.zz-edit-table td {
  min-width: 7.5rem;
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  padding: 5px;
  vertical-align: top;
}
.zz-edit-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-inset);
}
.zz-edit-table th:first-child,
.zz-edit-table td:first-child { min-width: 15rem; }
.zz-edit-table .zz-fixed-cell {
  padding: .72rem .6rem;
  background: #fbfcfe;
  color: var(--ink);
  font-weight: 500;
  text-align: left;
}
.zz-edit-table td.zz-fixed-cell { color: var(--muted); font-weight: 400; }
.zz-edit-table input { min-width: 6rem; font-size: 12px; }
.zz-edit-table textarea { min-width: 18rem; resize: vertical; font-size: 12px; }
.zz-edit-table .zz-explanation-head { min-width: 18rem; color: var(--muted); text-align: left; }

.zz-manual-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: rgb(255 255 255 / .96);
  box-shadow: 0 -5px 14px rgb(15 23 42 / .05);
}
.zz-manual-actions .zz-manual-message { flex: 1; color: var(--muted); font-size: .75rem; }

.zz-manual-values { width: 100%; min-width: 0; }
.zz-manual-field-list { display: grid; gap: .7rem; padding: .85rem 1rem 1.2rem; }
.zz-manual-field {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: .72rem .8rem .8rem;
  background: #fff;
}
.zz-manual-field.is-ready { border-color: #bdd8c5; background: #fbfefc; }
.zz-manual-field.is-invalid { border-color: #dba5a5; background: #fffafa; }
.zz-manual-field legend { padding: 0 .35rem; color: var(--muted); font-size: .67rem; font-weight: 650; }
.zz-field-context { margin: 0 0 .65rem; color: #3d4858; font-size: .78rem; line-height: 1.5; }
.zz-field-grid {
  display: grid;
  grid-template-columns: 7rem minmax(8rem, .55fr) minmax(14rem, 1.45fr);
  gap: .65rem;
  align-items: start;
}
.zz-field-grid label { display: grid; gap: .28rem; color: var(--muted); font-size: .68rem; font-weight: 650; }
.zz-field-grid input,
.zz-field-grid textarea { font-size: .8rem; font-weight: 400; resize: vertical; }
.zz-field-previous { display: grid; gap: .25rem; }
.zz-field-previous span { color: var(--muted); font-size: .68rem; }
.zz-field-previous strong { color: #67558d; font-size: .9rem; font-variant-numeric: tabular-nums; }
.zz-manual-empty { padding: 1.2rem; color: #31543b; }

.zz-manual-form :focus-visible,
.zz-source-card:focus-visible,
  .zz-drawer-action:focus-visible {
  outline: 2px solid #67558d;
  outline-offset: 2px;
}
.zz-manual-form [aria-invalid="true"] { border-color: #b91c1c; box-shadow: 0 0 0 2px rgb(185 28 28 / .08); }

@media (max-width: 700px) {
  .zz-field-grid { grid-template-columns: 1fr; }
  .zz-field-explanation { grid-column: 1; }
  .zz-manual-actions { flex-wrap: wrap; }
  .zz-manual-actions .zz-manual-message { min-width: 100%; order: -1; }
}

@media (max-width: 480px) {
  .zz-source-grid { grid-template-columns: minmax(0, 1fr); }
  .zz-view-inner { padding-inline: 1rem; }
}

@media (max-width: 900px) {
  .zz-readonly-values { grid-template-columns: minmax(0, 1fr); }
  .zz-doc.has-wide-tables { width: 100%; }
  .zz-doc-table-block.is-wide .zz-doc-table { min-width: 0; font-size: .58rem; }
}

/* Inline editing workspace. Forms share one quiet surface; only automatic
   sources keep the card treatment because opening their source detail is the
   primary interaction. */
.zz-inline-form {
  min-height: 0;
  min-width: 0;
  background: transparent;
}

.zz-form-help {
  margin: 0;
  padding: .72rem 1.3rem;
  color: var(--muted);
  font-size: .74rem;
  line-height: 1.45;
}

.zz-inline-table-form .zz-edit-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  scrollbar-width: thin;
}
.zz-inline-table-form .zz-edit-table {
  width: 100%;
  min-width: 56rem;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12.5px;
  line-height: 1.45;
}
.zz-inline-table-form .zz-edit-table th,
.zz-inline-table-form .zz-edit-table td {
  min-width: 0;
  border-right: 0;
  border-bottom: 1px solid #eceff2;
  padding: .5rem .7rem;
  white-space: normal;
  overflow-wrap: anywhere;
}
.zz-inline-table-form .zz-edit-table th:first-child,
.zz-inline-table-form .zz-edit-table td:first-child {
  width: 20rem;
  max-width: 20rem;
  padding-left: .7rem;
}
.zz-inline-table-form .zz-edit-table th:nth-child(2),
.zz-inline-table-form .zz-edit-table td:nth-child(2) {
  width: 5rem;
  max-width: 5rem;
}
.zz-inline-table-form .zz-edit-table td:not(:first-child) {
  overflow-wrap: normal;
  word-break: normal;
}
.zz-inline-table-form .zz-edit-table td.zz-fixed-cell:not(:first-child) { white-space: nowrap; }
.zz-inline-table-form .zz-edit-table th:nth-child(n + 3),
.zz-inline-table-form .zz-edit-table td:nth-child(n + 3) { text-align: right; }
.zz-inline-table-form .zz-edit-table th:last-child,
.zz-inline-table-form .zz-edit-table td:last-child { padding-right: .7rem; }
.zz-inline-table-form .zz-edit-table th {
  position: static;
  border-bottom-color: #d2d7dc;
  background: #f7f8fa;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 650;
  text-align: left;
}
.zz-inline-table-form .zz-edit-table tbody tr:last-child td { border-bottom: 0; }
.zz-inline-table-form .zz-edit-table tbody tr:last-child th { border-bottom: 0; }
.zz-inline-table-form .zz-edit-table .zz-fixed-cell {
  background: transparent;
  line-height: 1.45;
}
.zz-inline-table-form .zz-content-table-row.is-calculated th,
.zz-inline-table-form .zz-content-table-row.is-calculated td { background: #f6f8f9; }
.zz-inline-table-form .zz-content-table-row.is-automatic th,
.zz-inline-table-form .zz-content-table-row.is-automatic td { background: #f8fafb; }
.zz-inline-table-form .zz-content-table-row th > span:first-child { display: block; font-weight: 650; }
.zz-table-row-context {
  display: block;
  margin-top: .18rem;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 400;
  line-height: 1.35;
  text-decoration: none;
}
a.zz-table-row-context:hover { color: var(--ink); text-decoration: underline; }
.zz-readonly-cell {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.zz-readonly-cell output { font: inherit; }
.zz-inline-table-form .zz-edit-table input,
.zz-inline-table-form .zz-edit-table textarea {
  width: 100%;
  min-width: 0;
  border-color: transparent;
  border-radius: 5px;
  padding: .32rem .28rem;
  background: transparent;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.zz-inline-table-form .zz-edit-table input:hover,
.zz-inline-table-form .zz-edit-table textarea:hover { border-color: var(--border-input); background: #f8fafb; }
.zz-inline-table-form .zz-edit-table input:focus,
.zz-inline-table-form .zz-edit-table textarea:focus {
  border-color: var(--border-focus);
  background: #fff;
  outline: 2px solid rgb(169 183 198 / .18);
}
.zz-inline-table-form .zz-edit-table tbody tr:hover td { background: #fbfcfd; }
.zz-inline-table-form .zz-edit-table textarea { min-width: 15rem; min-height: 2.15rem; }
.zz-inline-table-form .zz-edit-table .zz-explanation-head { min-width: 15rem; }

.zz-inline-form .zz-manual-actions {
  position: static;
  justify-content: flex-end;
  padding: .85rem 0 0;
  border-top: 0;
  background: transparent;
  box-shadow: none;
}
.zz-inline-form .zz-manual-message { min-height: 1rem; }

.zz-values-segment .zz-form-segment-head { padding-bottom: 1rem; }
.zz-value-groups { border-top: 1px solid var(--border-soft); }
.zz-value-group + .zz-value-group { border-top: 1px solid var(--border-soft); }
.zz-value-group > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .85rem;
  padding: .78rem 0;
  color: var(--text);
  font-size: .79rem;
  line-height: 1.45;
  cursor: pointer;
  list-style: none;
}
.zz-value-group > summary::-webkit-details-marker { display: none; }
.zz-value-group > summary:hover { background: #fbfcfe; color: var(--ink); }
.zz-value-group > summary::after {
  content: '›';
  color: var(--faint);
  font-size: 1rem;
  transform: rotate(90deg);
  transition: transform var(--dur);
}
.zz-value-group[open] > summary::after { transform: rotate(-90deg); }
.zz-value-group-body { border-top: 1px solid var(--border-soft); background: #fbfcfe; }
.zz-value-row { padding: 1rem 1.3rem 1.1rem; }
.zz-value-row + .zz-value-row { border-top: 1px solid var(--border-soft); }
.zz-value-label { display: block; margin: 0 0 .65rem; color: var(--ink); font-size: .82rem; font-weight: 620; }
.zz-value-controls {
  display: grid;
  grid-template-columns: 7rem minmax(9rem, .55fr) minmax(16rem, 1.45fr);
  gap: .75rem;
  align-items: start;
}
.zz-value-controls label {
  display: grid;
  gap: .32rem;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 580;
}
.zz-value-row input,
.zz-value-row textarea {
  width: 100%;
  border: 1px solid var(--border-input);
  border-radius: var(--r-sm);
  padding: .52rem .62rem;
  background: #fff;
  color: var(--ink);
  font: 400 .82rem/1.35 var(--font-sans);
}
.zz-value-row textarea { min-height: 2.45rem; resize: vertical; }
.zz-value-row .zz-field-previous strong { color: var(--ink); font-size: .88rem; font-weight: 620; }
.zz-value-row input:focus,
.zz-value-row textarea:focus { border-color: var(--border-focus); outline: 2px solid rgb(169 183 198 / .2); }
.zz-value-row.is-ready .zz-field-previous strong { color: var(--green-deep); }

@media (max-width: 900px) {
  .zz-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .45rem 1rem;
    padding: .9rem 1rem 0;
  }
  .zz-head-copy { grid-column: 1 / -1; padding-bottom: .1rem; }
  .zz-crumb {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .zz-head h1 {
    font-size: 1.2rem;
    line-height: 1.25;
    white-space: normal;
  }
  .zz-tabs { grid-column: 1; align-self: end; }
}

@media (max-width: 760px) {
  .zz-view-inner { padding: 1.25rem 1rem 3rem; }
  .zz-layer-workspace { border-radius: var(--r-lg); }
  .zz-data-layer { padding: 1.15rem 1.1rem 1.25rem; }
  .zz-workspace-heading,
  .zz-input-workspace-head,
  .zz-form-segment-head { display: block; }
  .zz-workspace-actions {
    justify-content: space-between;
    width: 100%;
    margin-top: .8rem;
  }
  .zz-form-segment-head > span { display: block; margin-top: .4rem; }
  .zz-auto-sources { grid-template-columns: minmax(0, 1fr); }
  .zz-value-controls { grid-template-columns: 1fr; }
  .zz-value-group > summary { grid-template-columns: minmax(0, 1fr) auto; }
  .zz-metric-row { grid-template-columns: minmax(0, 1fr) auto; }
  .zz-readonly-values .zz-metric-row { grid-template-columns: minmax(0, 1fr) auto; }
  .zz-readonly-values .zz-metric-formula { grid-column: 1; grid-row: 2; }
  .zz-readonly-values .zz-metric-value { grid-column: 2; grid-row: 1 / span 2; }
  .zz-metric-action { grid-column: 2; }
}

@media (max-width: 560px) {
  .zz-head { grid-template-columns: minmax(0, 1fr); }
  .zz-tabs { grid-column: 1; }
  .zz-doc-actions { right: 1rem; }
  .zz-concept-action .zz-btn { padding-inline: .8rem; font-size: .76rem; }
}

@page {
  size: A4 portrait;
  margin: 16mm 14mm 16mm;
}

@page zz-landscape {
  size: A4 landscape;
  margin: 14mm 16mm;
}

@media print {
  html, body { height: auto; overflow: visible; background: #fff; }
  .zz-app { display: block; height: auto; overflow: visible; }
  .zz-rail,
  .zz-head,
  .zz-view-podklady,
  .zz-doc-actions,
  .zz-drawer { display: none !important; }
  #zz-view-navrh,
  #zz-view-navrh[hidden],
  .zz-doc-scroll { display: block !important; height: auto; overflow: visible; padding: 0; }
  .zz-doc,
  .zz-doc.has-wide-tables {
    width: auto;
    max-width: none;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    font-size: 9.5pt;
    line-height: 1.45;
  }
  .zz-doc-page {
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0;
    border: 0;
    padding: 0 !important;
    box-shadow: none;
    overflow: visible;
  }
  .zz-doc-title { break-after: avoid; }
  .zz-doc-table-frame { overflow: visible; }
  .zz-doc-table { font-size: 7.1pt; }
  .zz-doc-table-block.is-wide {
    page: zz-landscape;
    break-before: page;
    break-after: page;
  }
  .zz-doc-table-block.is-wide .zz-doc-table { min-width: 0; font-size: 6.5pt; }
  .zz-doc-table thead { display: table-header-group; }
  .zz-doc-table tr { break-inside: avoid; }
  .zz-doc-table-block figcaption { break-after: avoid; }
  .zz-table-notes { break-inside: avoid; font-size: 6.6pt; }
  .zz-chart,
  .zz-reference-image { max-width: 100%; break-inside: avoid; }
}
