/* ---- a short chip is always ONE line (the owner, 29. 11. 2026; the same as INTECHI CRM public/css/shared.css): the chip is as wide as its
   words and never shrinks (flex: none, width: max-content), so the row around it lets its TEXT wrap instead and the chip stays on the same
   axis; only a text longer than the whole place wraps inside the chip, which is then a rounded box (the radius of one line), never an oval. ---- */
html.sd .badge,
html.sd .pay-chip,
html.sd .chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  white-space: normal;
  height: auto;
  min-height: 24px;
  border-radius: 13px;
  overflow-wrap: anywhere;
}
html.sd summary:has(> .pay-chip) {
  flex-wrap: nowrap;
  align-items: center;
}
html.sd summary > .pay-chip {
  margin-left: auto;
}
html.sd .badge.is-long,
html.sd .agent-say-chip {
  padding-top: 3px;
  padding-bottom: 3px;
  border-radius: 10px;
}
/* pieces of information side by side as their own elements (the owner, 29. 11. 2026: never joined by „·“), on one axis, wrapping as wholes */
html.sd .parts {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
  min-width: 0;
}

/* the numbers of the menu and of the bell are round dots, not chips (the owner, 30. 11. 2026: „bylo hezké kulaté“; the same as INTECHI CRM
   public/css/shared.css); the number of the bell sits IN THE CORNER of the button, never over half of the bell */
html.sd .bell-badge.bell-badge {
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  box-sizing: border-box;
  display: inline-block;
  line-height: 20px;
  border-radius: 10px;
  text-align: center;
}
html.sd .bell-badge.bell-badge[hidden] {
  display: none;
}

/* no white button anywhere (the owner, 30. 11. 2026; the same as INTECHI CRM 1.138.1 shared.css): a button without its own colour of an action
   takes the blue of an ordinary action (also the buttons the scripts build, the chat); the actions of ACTIONS (src/views/buttonTone.ts) keep
   their colours, Zrušit and Zavřít are the only grey ones (action close) */
html.sd .btn.secondary:not(.ia):not(.primary):not([data-act]) {
  background: var(--sd-action-blue-bg);
  border-color: var(--sd-action-blue-line);
  color: var(--sd-action-blue-ink);
}
html.sd .btn.secondary:not(.ia):not(.primary):not([data-act]):hover {
  background: var(--sd-action-blue-hover);
}
/* the state and the date of a reminder are two pieces with a gap, never joined by „·“ (the owner, 29. 11. 2026) */
.reminder-when > span + span {
  margin-left: 8px;
}
/* „Přidat do kopie“ in a row of a reminder opens as a small window over the row, never stretching it (the owner, 30. 11. 2026) */
.reminder-actions .cc-add,
.mail-actions .cc-add {
  position: relative;
}
html.sd .reminder-actions details.cc-add[open],
html.sd .mail-actions details.cc-add[open] {
  display: inline-block;
  flex-basis: auto;
  width: auto;
}
.reminder-actions .cc-add[open] > summary,
.mail-actions .cc-add[open] > summary {
  margin-bottom: 0;
}
html.sd .reminder-actions details.cc-add[open] > .cc-panel,
html.sd .mail-actions details.cc-add[open] > .cc-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  width: min(420px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  background: var(--card, #fff);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
}

/* the history of the e-mails (the owner, 30. 11. 2026): the files of an e-mail side by side, each with the picture of its kind, never joined by
   a comma; Přidat do kopie and Poslat znovu as two pictures in one row; an open text keeps the state and the buttons at the top of the row */
.mail-files-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 6px 0;
}
.mail-files-label {
  display: inline-flex;
  align-items: center;
}
.mail-files-line .file-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
form.mail-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}
html.sd table.stm tr:has(details[open]) > td {
  vertical-align: top;
}
/* a file whose row has the eye: its name and its picture open the same window (public/js/viewer.js) */
tr:has(a[data-view]) .file-name,
li:has(a[data-view]) .file-name,
tr:has(a[data-view]) .file-thumb,
li:has(a[data-view]) .file-thumb {
  cursor: pointer;
}
html.sd form.mail-actions > details,
html.sd form.mail-actions > .btn {
  align-self: center;
  margin: 0;
}

/* an account chip with the logo of its bank (Výpisy and the other pickers of an account; the owner, 1. 12. 2026: „nalepené na okraje“):
   the round logo kept its 26 px in a chip of 24 px, so it was squeezed and touched the edges. It is a 22 px circle inside the chip with
   the same ring of space on the top, the bottom and the left, the words keep the padding of every chip on the right. */
html.sd .chip:has(> .acct-tag > .bank-logo) {
  padding: 3px 14px 3px 4px;
}
html.sd .chip > .acct-tag > .bank-logo {
  width: 22px;
  min-width: 22px;
  height: 22px;
  padding: 0;
  font-size: 9px;
}
/* the further e-mails of a contact stand under its main e-mail, on its left edge (the owner, 1. 12. 2026: „srovnat“) */
html.sd .co-mail > .cc-add {
  align-self: flex-start;
  margin: 0;
}
html.sd .co-mail > .cc-add[open] {
  align-self: stretch;
}
