/* The data surfaces of the window (src/surfaces/): the frame every surface stands in and the parts they share –
   a list beside a detail, forms, tags, the dialog of a question. Only the tokens of style.css (greys, one blue
   accent, red / amber for errors and warnings) – never a literal black or white.
   A surface with parts of its own keeps them in its own stylesheet beside its file. */

.surface {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}
.surface[hidden] { display: none; }
.surface button { font: inherit; }

/* ----- The frame: the strip of the surfaces, the state of the core ----- */
.sf-top {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  background: var(--titlebar);
  color: var(--titlebar-text);
}
.sf-top button {
  height: 28px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.sf-top button:hover { background: var(--titlebar-hover); }
.sf-top .sf-return { border-color: var(--titlebar-line); }
.sf-top button.is-due { border-color: var(--warning); }
.sf-top button.is-due::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--warning); }
/* The strip never scrolls and never wraps: in a narrow window the frame draws it denser, a step at a time
   (src/surfaces/host_model.js – stripPlan), and the surfaces that still do not fit go into the menu at its end. */
.sf-top { overflow-x: clip; }
.sf-top > * { flex: none; }
.sf-tabs { display: flex; gap: 2px; }
.sf-top.is-dense { gap: 6px; }
.sf-top.is-dense button { padding: 0 7px; }
.sf-top.is-dense .sf-chip { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
/* (The densest step: the state of the core is its dot alone – its words are its tooltip.) */
.sf-chip.is-dot { padding: 2px 7px; }
.sf-chip.is-dot::before { margin-right: 0; }
.sf-chip.is-dot.is-none::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--titlebar-line); }
.sf-more { position: relative; display: flex; }
.sf-more-menu {
  position: absolute;
  top: 32px;
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--titlebar-line);
  border-radius: 4px;
  background: var(--titlebar);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.sf-top .sf-more-menu button { text-align: left; }
.sf-top .sf-tabs button.is-active { background: var(--titlebar-hover); border-color: var(--titlebar-line); font-weight: 600; }
.sf-core { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sf-user { opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-chip {
  padding: 2px 9px;
  border-radius: 10px;
  border: 1px solid var(--titlebar-line);
  white-space: nowrap;
}
.sf-chip.is-ok::before, .sf-chip.is-warn::before, .sf-chip.is-off::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--ok);
}
.sf-chip.is-warn::before { background: var(--warning); }
.sf-chip.is-off::before { background: var(--error); }

.sf-conflicts {
  margin: 8px 12px 0;
  padding: 8px 12px;
  border: 1px solid var(--warning);
  border-radius: 4px;
  background: var(--surface);
}
.sf-conflicts h3 { margin: 0 0 2px; font-size: 13px; color: var(--warning); }
.sf-conflicts p { margin: 0 0 6px; color: var(--muted); }
.sf-conflicts ul { margin: 0; padding: 0; list-style: none; }
.sf-conflicts li { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.sf-conflicts li button { margin-left: auto; }
.sf-notice {
  margin: 8px 12px 0;
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.sf-notice.is-ok { border-color: var(--ok); }
.sf-notice.is-error { border-color: var(--error); color: var(--error); }

/* ----- A surface: a list beside a detail ----- */
.sf-stage { flex: 1; min-height: 0; display: flex; }
/* (The room of the surface that shows – every mounting of a surface gets its own: src/surfaces/host_model.js.) */
.sf-room { flex: 1; min-width: 0; min-height: 0; display: flex; }
.sf-body { flex: 1; min-width: 0; min-height: 0; display: flex; padding: 10px 12px 12px; gap: 10px; }
.sf-list, .sf-detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.sf-list { width: 340px; flex: none; }
.sf-detail { flex: 1; min-width: 0; overflow: auto; padding: 0 16px 16px; }
.sf-list-head { display: flex; gap: 6px; padding: 8px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.sf-search { flex: 1; min-width: 0; }
.sf-filter { display: flex; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.sf-filter button, .sf-tabs.is-sub button {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.sf-filter button.is-active, .sf-tabs.is-sub button.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.sf-rows { flex: 1; margin: 0; padding: 0; list-style: none; overflow: auto; }
.sf-row { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-bottom: 1px solid var(--border); cursor: pointer; }
.sf-row:hover { background: var(--hover); }
.sf-row.is-selected { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.sf-row.is-muted strong { color: var(--muted); font-weight: 500; }
.sf-row-sub { color: var(--muted); font-size: 12px; }
.sf-number { color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.sf-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.sf-tag {
  display: inline-block;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  line-height: 17px;
  white-space: nowrap;
}
.sf-tag.is-ok { border-color: var(--ok); color: var(--ok); }
.sf-tag.is-warn { border-color: var(--warning); color: var(--warning); }
.sf-empty { padding: 18px 12px; color: var(--muted); }
.sf-check { display: flex; align-items: center; gap: 6px; padding: 6px 10px; color: var(--muted); }

.sf-detail-head { display: flex; align-items: center; gap: 8px; padding: 12px 0 8px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.sf-detail-head h2 { margin: 0; font-size: 17px; font-weight: 600; margin-right: auto; }
.sf-tabs.is-sub { flex-wrap: wrap; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.sf-note { margin: 0 0 8px; color: var(--muted); }
.sf-pane { display: flex; flex-direction: column; gap: 14px; }
.sf-pane h4, .sf-group h4, .sf-design h4 { margin: 0; font-size: 13px; font-weight: 600; }

/* ----- Forms ----- */
.sf-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; align-items: end; max-width: 760px; }
.sf-form h4 { grid-column: 1 / -1; }
.sf-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; border: 0; padding: 0; margin: 0; }
.sf-field.is-wide { grid-column: 1 / -1; }
fieldset.sf-field { flex-direction: row; flex-wrap: wrap; gap: 2px 18px; }
fieldset.sf-field > legend { margin-bottom: 3px; }
fieldset.sf-field .sf-check { padding: 2px 0; color: var(--text); }
.sf-field > span, .sf-field > legend { color: var(--muted); font-size: 12px; padding: 0; }
.sf-field input[type="text"], .sf-field input[type="password"], .sf-field input[type="date"], .sf-field input[type="search"], .sf-field select, .sf-field textarea, .sf-search {
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}
.sf-field textarea { height: auto; padding: 6px 8px; resize: vertical; }
.sf-field input:disabled, .sf-field select:disabled, .sf-field textarea:disabled { background: var(--surface-2); color: var(--muted); }
.sf-field input:focus-visible, .sf-field select:focus-visible, .sf-field textarea:focus-visible, .sf-search:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.sf-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sf-actions button, .sf-detail-head button, .sf-conflicts button, .sf-list-head button {
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.sf-actions button:hover, .sf-detail-head button:hover, .sf-conflicts button:hover { background: var(--hover); }
.surface button.primary { background: var(--chrome); border-color: var(--chrome); color: var(--chrome-text); }
.surface button.primary:hover { background: var(--accent-strong); }
.surface button.primary.is-danger { background: var(--error); border-color: var(--error); }
/* (A step that cannot be undone, offered beside the others – the erasure of personal data: named by its colour, not filled.) */
.sf-detail-head button.is-danger { border-color: var(--error); color: var(--error); }
.sf-link { border: 0; background: none; color: var(--accent-ink); cursor: pointer; padding: 0 4px; }
.sf-link:hover { text-decoration: underline; }
.sf-inline { display: inline-flex; gap: 6px; margin-left: 10px; }

/* ----- The parts of an order ----- */
.sf-proposal { padding: 8px 10px; border: 1px solid var(--warning); border-radius: 4px; background: var(--surface-2); }
.sf-notes, .sf-cards, .sf-files, .sf-revisions, .sf-log ul, .sf-lines { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.sf-notes li, .sf-cards li, .sf-design { padding: 8px 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); }
.sf-notes p { margin: 4px 0 0; white-space: pre-wrap; }
.sf-note-head, .sf-cards li, .sf-files li, .sf-design header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.sf-note-head .sf-link, .sf-cards .sf-link { margin-left: auto; }
.sf-files li { padding: 4px 0; border-bottom: 1px solid var(--border); }
.sf-files li > span:first-child { margin-right: auto; }
.sf-group { display: flex; flex-direction: column; gap: 6px; }
.sf-design { display: flex; flex-direction: column; gap: 6px; }
.sf-design header h4 { margin-right: auto; }
.sf-revisions li { display: flex; flex-direction: column; gap: 1px; padding: 4px 0 4px 10px; border-left: 2px solid var(--border); }
.sf-log summary { cursor: pointer; color: var(--muted); }
.sf-log li.is-local { color: var(--warning); }
.sf-log code { font-family: var(--font-mono); }

/* ----- A question of a surface (never alert / confirm) ----- */
.sf-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  background: rgba(20, 28, 40, 0.35);
}
.sf-overlay[hidden] { display: none; }
.sf-dialog {
  width: min(520px, calc(100vw - 40px));
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow-strong);
}
.sf-dialog form { display: flex; flex-direction: column; gap: 10px; }
.sf-dialog h3 { margin: 0; font-size: 15px; font-weight: 600; }
/* (The lines of a comparison: a group and, indented under it, what changed.) */
.sf-dialog .sf-lines { max-height: 50vh; overflow: auto; gap: 2px; }
.sf-dialog .sf-lines li { white-space: pre-wrap; }
.sf-dialog .sf-actions { justify-content: flex-end; }

/* ----- The surfaces of the money: tables of numbers, rows of a document, sums ----- */
.sf-form .is-wide, .sf-note.is-wide { grid-column: 1 / -1; }
.sf-form .sf-inline.is-wide { display: flex; gap: 12px; align-items: end; }
.sf-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sf-table th { text-align: left; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); padding: 4px 8px 4px 0; }
.sf-table td { border-bottom: 1px solid var(--border); padding: 3px 8px 3px 0; vertical-align: top; }
.sf-table td.is-number, .sf-table th.is-number { text-align: right; }
.sf-table tr.is-total td { font-weight: 600; border-top: 1px solid var(--line); border-bottom: 0; }
.sf-table tr.is-sub td { color: var(--muted); font-size: 12px; border-bottom: 0; padding-top: 1px; padding-bottom: 1px; }
.sf-table tr.is-missing td { color: var(--error); }
.sf-table input[type="text"] { width: 84px; padding: 2px 6px; border: 1px solid var(--input-border); border-radius: 4px; background: var(--input-bg); color: var(--text); font: inherit; }
.sf-sum { font-size: 15px; font-weight: 600; }
.sf-warn { color: var(--warning); }
.sf-bad { color: var(--error); }

/* ----- The accounts: the surface Uživatelé a zařízení and the dialogs of the session (src/surfaces/users.js) ----- */
.sf-dialog-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; }
.sf-dialog-links .sf-link { padding: 0; }
.sf-dialog .sf-bad { margin: 0; }
.sf-dialog-picture { align-self: center; width: 208px; height: 208px; border: 1px solid var(--border); border-radius: 4px; image-rendering: pixelated; }
.sf-dialog-text { width: 100%; padding: 8px 10px; border: 1px solid var(--input-border); border-radius: 4px; background: var(--surface-2); color: var(--text); font-family: var(--font-mono); font-size: 13px; line-height: 1.5; resize: none; }
.sf-ended p { color: var(--text); }
.us-pane, .us-ended { max-width: 1280px; }
.us-pane { padding-top: 12px; }
.us-pane button:not(.sf-link) { height: 26px; padding: 0 10px; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; white-space: nowrap; }
.us-pane button:not(.sf-link):not(.primary) { background: var(--surface); color: var(--text); }
.us-pane button:not(.sf-link):not(.primary):hover { background: var(--hover); }
.us-pane button:disabled { opacity: 0.55; cursor: default; }
.us-pane .sf-actions button { height: 28px; }
.us-ended { margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--warning); border-radius: 4px; background: var(--surface-2); }
.us-ended p { margin: 0 0 8px; }
.us-card { display: flex; flex-direction: column; gap: 10px; max-width: 760px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-2); }
.us-card h4 { margin: 0; font-size: 14px; font-weight: 600; }
.us-card .sf-note { margin: 0; }
.us-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 0; }
.us-facts dt { color: var(--muted); }
.us-facts dd { margin: 0; overflow-wrap: anywhere; }
.us-head { display: flex; align-items: center; gap: 10px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.us-head h4 { margin-right: auto; }
.us-month { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.us-month select, .us-table select { height: 26px; padding: 0 6px; border: 1px solid var(--input-border); border-radius: 4px; background: var(--input-bg); color: var(--text); font: inherit; }
.us-table { font-size: 13px; }
.us-table th, .us-table td { white-space: nowrap; }
.us-table td { padding: 5px 14px 5px 0; vertical-align: middle; }
.us-table td:first-child { white-space: normal; min-width: 180px; }
.us-table select { min-width: 132px; }
.us-table td strong + .sf-tag, .us-table td .sf-tag + .sf-tag { margin-left: 6px; }
.us-table .us-actions { text-align: right; white-space: nowrap; }
.us-table .us-actions button + button { margin-left: 6px; }
.us-table .us-when { white-space: nowrap; color: var(--muted); }
.us-table tr.us-warn td:nth-child(2) { color: var(--warning); }
.us-table tr.us-operator td { background: var(--surface-2); }
.us-table .us-access { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; white-space: normal; max-width: 420px; }
.us-table .us-access.is-over { color: var(--warning); }
.us-second { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.us-usages { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.us-usage { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); }
.us-usage p { margin: 0; }
.us-usage-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.us-usage-head strong { min-width: 90px; }
.us-meter { height: 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.us-meter span { display: block; height: 100%; background: var(--ok); }
.us-usage.is-warn .us-meter span { background: var(--warning); }
.us-usage.is-full .us-meter span { background: var(--error); }
.us-safety { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; max-width: 860px; }
.us-safety li { padding: 6px 10px 6px 12px; border: 1px solid var(--border); border-left-width: 3px; border-radius: 4px; background: var(--surface); }
.us-safety li.is-ok { border-left-color: var(--ok); }
.us-safety li.is-warn { border-left-color: var(--warning); }
.us-safety li.is-bad { border-left-color: var(--error); }
.us-companies { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; max-width: 860px; }
.us-companies li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); }
.us-company { display: flex; flex-direction: column; gap: 2px; min-width: 0; margin-right: auto; }

/* ----- The client portal on the side of the workshop: the tab Klient of an order, the section of the settings ----- */
.cl-in { display: flex; flex-direction: column; gap: 18px; max-width: 980px; }
.cl-pane button:not(.sf-link):not(.cl-photo) { height: 26px; padding: 0 10px; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; white-space: nowrap; }
.cl-pane button:not(.sf-link):not(.cl-photo):not(.primary) { background: var(--surface); color: var(--text); }
.cl-pane button:not(.sf-link):not(.cl-photo):not(.primary):hover { background: var(--hover); }
.cl-pane button:disabled { opacity: 0.55; cursor: default; }
.cl-pane .sf-form .sf-actions button { height: 28px; }
.cl-off { padding: 14px 16px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-2); max-width: 760px; }
.cl-off .sf-note { margin: 6px 0 0; }
.cl-banner { display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 10px; border: 1px solid var(--warning); border-radius: 4px; background: var(--surface-2); }
.cl-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); }
.cl-summary .sf-tag { font-size: 12px; line-height: 20px; padding: 0 10px; }
.cl-summary-actions { margin-left: auto; display: flex; gap: 6px; }
.cl-head { display: flex; align-items: center; gap: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.cl-head h4 { margin-right: auto; }
.cl-cards { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 8px; }
.cl-cards > li { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); min-width: 0; }
.cl-cards > li.is-muted { background: var(--surface-2); }
.cl-cards.is-plain > li { border-style: dashed; }
.cl-cards.is-wide { grid-template-columns: minmax(0, 760px); }
.cl-card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.cl-card-head button { margin-left: auto; }
.cl-rights { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 16px; }
.cl-rights .sf-check { padding: 0; color: var(--text); }
.cl-links { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.cl-links .sf-link { padding: 0; }
.cl-more summary { cursor: pointer; color: var(--muted); }
.cl-more .sf-files { margin-top: 6px; }
.cl-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cl-field { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; align-items: center; padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; min-width: 0; }
.cl-field.is-on { border-color: var(--accent); background: var(--accent-soft); }
.cl-field input { grid-row: 1 / span 2; }
.cl-field strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cl-step { grid-template-columns: minmax(0, 1fr) 170px auto; max-width: none; }
.cl-step .sf-field.is-wide, .cl-step .sf-actions { grid-column: auto; }
.cl-table td { padding-top: 5px; padding-bottom: 5px; vertical-align: middle; }
.cl-table tr.is-shared td:first-child { font-weight: 600; }
.cl-changes { display: block; }
.cl-paper { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.cl-cell-actions { text-align: right; white-space: nowrap; }
.cl-cell-actions button { margin-left: 6px; }
.cl-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cl-photos { display: flex; flex-wrap: wrap; gap: 6px; }
.cl-photo { padding: 0; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-2); cursor: pointer; line-height: 0; }
.cl-photo img { display: block; width: 120px; height: 90px; object-fit: cover; border-radius: 3px; }
.cl-replies { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.cl-replies li { padding: 2px 0 2px 10px; border-left: 2px solid var(--border); }
.cl-replies li.is-ours { border-left-color: var(--accent); }
.sf-field input[type="color"] { width: 64px; height: 28px; padding: 2px; border: 1px solid var(--input-border); border-radius: 4px; background: var(--input-bg); }
.cl-preview { width: 320px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
.cl-preview-top { padding: 10px 14px; color: var(--accent-text); font-size: 14px; }
.cl-preview-body { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; }
.cl-preview-field { padding: 5px 8px; border: 1px solid var(--input-border); border-radius: 4px; color: var(--muted); }

/* ---------- The surface Poptávky and the tab Zadání of an order (stage 3 – src/surfaces/inquiries.js, order/tabs_inquiry.js) ---------- */
.sf-stage[data-surface="inquiries"] .sf-filter { flex-wrap: wrap; }
.sf-stage[data-surface="inquiries"] .sf-filter button { white-space: nowrap; }
/* (A message has many buttons: its subject stands on a line of its own, the buttons under it.) */
.sf-stage[data-surface="inquiries"] .sf-detail-head { flex-wrap: wrap; }
.sf-stage[data-surface="inquiries"] .sf-detail-head h2 { flex-basis: 100%; overflow-wrap: anywhere; }
.iq-group { padding: 6px 10px 2px; color: var(--muted); font-size: 12px; font-weight: 600; border-top: 1px solid var(--border); }
.iq-put { display: flex; flex-direction: column; gap: 10px; max-width: 900px; }
.iq-put textarea { width: 100%; font-family: var(--font-mono); font-size: 12px; }
.iq-drop { padding: 12px; border: 1px dashed var(--input-border); border-radius: 4px; background: var(--surface-2); }
.iq-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.iq-drop p { margin: 0 0 8px; color: var(--muted); }
.iq-notices { margin: 0 0 10px; padding: 8px 10px 8px 26px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-2); color: var(--muted); }
.iq-notices li.is-warn { color: var(--text); }
.iq-warn { padding: 6px 10px; border: 1px solid var(--warning); border-radius: 4px; color: var(--text); }
.iq-texts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.iq-texts section { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.iq-texts h4 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 600; }
.iq-text { margin: 0; padding: 8px 10px; width: 100%; min-height: 220px; max-height: 420px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid var(--border); border-radius: 4px;
  background: var(--surface-2); color: var(--text); font-family: var(--font-mono); font-size: 12px; line-height: 1.45; }
textarea.iq-text { background: var(--input-bg); border-color: var(--input-border); resize: vertical; }
.iq-seen summary { cursor: pointer; color: var(--muted); }
.iq-seen .iq-text { min-height: 0; margin-top: 6px; }
.iq-reply { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); max-width: 900px; }
.iq-reply.is-muted { opacity: 0.6; }
.iq-reply textarea, .iq-reply-subject { width: 100%; }
.sf-offscreen { position: fixed; left: -9999px; top: 0; }
.iq-pane .sf-form { max-width: none; }
.iq-sections { display: flex; flex-direction: column; gap: 10px; max-width: 900px; }
.iq-section { display: flex; flex-direction: column; gap: 4px; }
.iq-section header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.iq-section header h4 { margin: 0; font-size: 13px; font-weight: 600; }
.iq-section header .sf-link { margin-left: auto; }
.iq-section textarea { width: 100%; resize: vertical; }
.iq-section-title { min-width: 260px; }
/* What an AI agent wrote: apart from the text of a person – from AI, to be checked until a person changes or confirms it. */
.iq-section-ai { padding: 8px 10px; border: 1px solid var(--border); border-left: 3px solid var(--warning); border-radius: 4px; background: var(--surface); }
.iq-section-ai[data-ai="checked"] { border-left-color: var(--ok); }
.iq-section-ai .iq-ai-note { margin: 0; }
.iq-asks { padding: 6px 10px; border: 1px dashed var(--warning); border-radius: 4px; }
.iq-asks h5 { margin: 0 0 4px; font-size: 12px; font-weight: 600; }
.iq-asks ul { margin: 0; padding-left: 18px; }
.iq-asks li { margin: 2px 0; }
.iq-asks { display: flex; flex-direction: column; gap: 8px; }
.iq-brief { display: flex; flex-direction: column; gap: 14px; }
.iq-intake { max-width: 820px; }
.iq-intake h4 { margin: 16px 0 6px; font-size: 13px; font-weight: 600; }
.iq-address { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.iq-address input { flex: 1 1 320px; min-width: 0; height: 28px; padding: 0 8px; border: 1px solid var(--input-border); border-radius: 4px; background: var(--surface-2); color: var(--text); font-family: var(--font-mono); }
.iq-list-foot { padding: 8px; border-top: 1px solid var(--border); background: var(--surface-2); }
.iq-list-foot button { flex: 1; }
.iq-list-foot button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-ink); }
.iq-address .sf-note { flex-basis: 100%; margin: 0; }
.iq-guide { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; max-width: 760px; }
.iq-senders { display: flex; flex-direction: column; gap: 6px; }
.iq-senders h4 { margin-bottom: 0; }

/* ---------- The surface Ke kontrole (src/surfaces/review.js): proposals to decide, the runs of the AI agents ---------- */
.rv-body { display: flex; flex-direction: column; gap: 18px; padding: 14px 18px; overflow: auto; }
.rv-section { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rv-section h3 { margin: 0; font-size: 14px; font-weight: 600; }
.rv-section h4 { margin: 0 0 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
.rv-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.rv-proposal { display: flex; flex-direction: column; gap: 4px; }
.rv-line { display: flex; align-items: baseline; gap: 10px; }
.rv-link { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; text-align: left; }
.rv-link:hover { text-decoration: underline; }
.rv-note { margin: 0; color: var(--muted); }
.rv-table tbody tr { cursor: pointer; }
.rv-table tbody tr:hover td { background: var(--surface-2); }
.rv-table tbody tr.is-selected td { background: var(--accent-soft); }
.rv-table td { padding-top: 5px; padding-bottom: 5px; vertical-align: middle; }
.rv-detail { padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.rv-block { display: flex; flex-direction: column; }
.rv-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.rv-facts { display: grid; grid-template-columns: max-content 1fr; gap: 2px 14px; margin: 0; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.rv-facts dt { color: var(--muted); }
.rv-facts dd { margin: 0; }

/* ---------- Nastavení dílny: the guides of the assistant (src/surfaces/setup/guides.js) ---------- */

.ag-after {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.ag-after legend {
  padding: 0 4px;
  font-weight: 600;
}

.ag-after .sf-row-sub {
  margin: 0 0 6px;
}

.ag-after-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  cursor: pointer;
}

.ag-list {
  margin: 12px 0 20px;
  padding: 0;
  list-style: none;
}

.ag-guide {
  border: 1px solid var(--border);
  border-bottom: 0;
  background: var(--surface);
}

.ag-guide:last-child {
  border-bottom: 1px solid var(--border);
}

.ag-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ag-head:hover,
.ag-guide.is-open .ag-head {
  background: var(--surface-2);
}

.ag-head .sf-row-sub {
  margin-left: auto;
}

.ag-form {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.ag-form textarea {
  width: 100%;
  font: inherit;
  line-height: 1.45;
}

.ag-new {
  border: 1px solid var(--border);
}
