/* Additions on top of style.css (copied from the keyboard's). The page is German and runs left to right. */

[hidden] {
  display: none !important;
}

/* One font stack everywhere: Persian and Arabic letters (and the zero-width joiners and marks between them) are drawn
   by Vazir, the owner's font package in assets/fonts/vazir (LICENSE there); everything else by the system font. The
   family has its own name, so the unicode-range applies wherever --m-font is used. */
@font-face {
  font-family: "VazirFa";
  src: url("assets/fonts/vazir/16.1.0/Vazir.woff2") format("woff2"),
    url("assets/fonts/vazir/16.1.0/Vazir.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F;
}

:root {
  --m-font: "VazirFa", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body,
button,
input,
select,
textarea {
  font-family: var(--m-font);
}

.m-devices-card :focus-visible,
.m-device-page :focus-visible,
.m-composer :focus-visible,
.m-fold-toggle:focus-visible,
.m-dialog button:focus-visible,
.m-lightbox button:focus-visible,
.m-center-card button:focus-visible,
.m-center-card a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.m-icon {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Fluent's layers (devices.js) bring their own colour, and no line round them. */
.m-icon .m-ic-paint {
  stroke: none;
}

/* An icon's coloured layers (devices.js): a shape in its tone with the line's colour round it, a shape in its tone
   without an edge, a line in its tone; ink is the text's colour. */
.m-icon .m-ic-fill,
.m-icon .m-ic-dot {
  fill: var(--ic);
}

.m-icon .m-ic-dot {
  stroke: none;
}

.m-icon .m-ic-line {
  stroke: var(--ic);
}

.m-ic-ink {
  --ic: currentColor;
}

.m-ic-paper {
  --ic: var(--icon-paper);
}

.m-ic-sky {
  --ic: var(--icon-sky);
}

.m-ic-orange {
  --ic: var(--icon-orange);
}

.m-ic-red {
  --ic: var(--icon-red);
}

.m-ic-teal {
  --ic: var(--icon-teal);
}

.m-ic-white {
  --ic: var(--icon-white);
}

/* A button that cannot be used shows its icon grey. */
:disabled .m-icon,
[aria-disabled="true"] .m-icon {
  filter: grayscale(1);
}

/* The banner's icons, a little larger. */
.m-gear .m-icon {
  width: 22px;
  height: 22px;
}

/* =========================
   Devices card
========================= */

.m-devices-card {
  flex: 0 1 auto;
  max-height: 40%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.m-devices-header {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.m-devices-title {
  margin: 0;
  font-size: calc(15px * var(--m-text-scale, 1));
  color: var(--text-strong);
}

.m-online-count {
  font-size: calc(12px * var(--m-text-scale, 1));
  color: var(--success);
}

.m-offline-pill {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: calc(11px * var(--m-text-scale, 1));
  white-space: nowrap;
}

.m-install-btn {
  margin-inline-start: auto;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid var(--primary-a34);
  border-radius: 10px;
  background: var(--primary-soft-2);
  color: var(--primary);
  font-size: calc(12px * var(--m-text-scale, 1));
  cursor: pointer;
}

.m-install-btn:hover {
  background: var(--primary-soft);
}

.m-install-hint {
  flex: 0 0 auto;
  margin: 0;
  color: var(--muted);
  font-size: calc(12px * var(--m-text-scale, 1));
  line-height: 1.7;
}

/* Section folding: the controls exist for the single-column layout only. */
.m-fold-toggle {
  display: none;
}

.m-device-list {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  padding-inline-end: 4px; /* Room before the scrollbar. */
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) transparent;
}

.m-device-placeholder {
  padding: 6px 2px;
  color: var(--muted);
  font-size: calc(12px * var(--m-text-scale, 1));
}

.m-device-row {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 6px;
  align-items: stretch;
}

.m-device-open {
  min-width: 0;
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--border-faint);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  text-align: start;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.m-device-open:hover {
  background: var(--card-hover);
  border-color: var(--primary-a22);
}

.m-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot-off);
}

.m-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-ring);
}

.m-kind-icon {
  flex: 0 0 auto;
  color: var(--muted);
}

.m-device-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.m-device-name-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.m-device-name {
  min-width: 0;
  overflow: hidden;
  font-size: calc(13px * var(--m-text-scale, 1));
  white-space: nowrap;
  text-overflow: ellipsis;
}

.m-self-tag {
  flex: 0 0 auto;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: calc(10px * var(--m-text-scale, 1));
  line-height: 1.8;
  white-space: nowrap;
}

.m-device-status {
  overflow: hidden;
  color: var(--muted);
  font-size: calc(11px * var(--m-text-scale, 1));
  white-space: nowrap;
  text-overflow: ellipsis;
}

.m-device-status.online {
  color: var(--success);
}

.m-device-status.expired {
  color: var(--warning);
}

.m-count-badge {
  flex: 0 0 auto;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: calc(11px * var(--m-text-scale, 1));
}

.m-device-remove {
  width: 100%;
  border: 1px solid var(--danger-a22);
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: calc(20px * var(--m-text-scale, 1));
  line-height: 1;
  cursor: pointer;
  transition: background 0.14s ease;
}

.m-device-remove:hover {
  background: var(--danger-soft-strong);
}

.m-device-remove:disabled {
  cursor: wait;
  opacity: 0.55;
}

/* =========================
   Device page
========================= */

body.m-page-open {
  overflow: hidden;
}

.m-device-page {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-1);
  color: var(--text);
}

.m-page-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.m-back-btn {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-soft);
  color: var(--text);
  font-size: calc(13px * var(--m-text-scale, 1));
  cursor: pointer;
}

.m-back-btn:hover {
  background: var(--card-hover);
}

.m-page-title {
  flex: 1 1 auto;
  min-width: 0;
}

.m-page-title h2 {
  margin: 0;
  overflow: hidden;
  color: var(--text-strong);
  font-size: calc(16px * var(--m-text-scale, 1));
  line-height: 1.5;
  text-align: start;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.m-page-status {
  margin: 0;
  color: var(--muted);
  font-size: calc(12px * var(--m-text-scale, 1));
}

.m-page-status.online {
  color: var(--success);
}

.m-page-body {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 14px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.m-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.m-page-actions .action-btn {
  min-height: 42px;
}

.m-page-message {
  margin: 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: calc(13px * var(--m-text-scale, 1));
  line-height: 1.7;
}

.m-items-empty {
  margin: 0;
  padding: 18px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--muted);
  font-size: calc(13px * var(--m-text-scale, 1));
  text-align: center;
}

.m-upload-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Name, then status, then the bar, each on its own line: a long "45 % · 1,2 GB von 1,9 GB" must not squeeze the name
   to nothing on a narrow phone. The cancel button stands beside all three. */
.m-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  font-size: calc(12px * var(--m-text-scale, 1));
}

.m-upload-row.failed {
  border-color: var(--danger-a32);
  background: var(--danger-wash);
}

.m-upload-name {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  overflow: hidden;
  text-align: start;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.m-upload-status {
  grid-column: 1;
  grid-row: 2;
  color: var(--muted);
  line-height: 1.6;
}

.m-upload-row.failed .m-upload-status {
  color: var(--danger);
}

.m-upload-progress {
  grid-column: 1;
  grid-row: 3;
  width: 100%;
  height: 6px;
  accent-color: var(--primary);
}

.m-upload-dismiss {
  grid-column: 2;
  grid-row: 1 / 4;
  align-self: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-soft);
  color: var(--muted);
  font-size: calc(18px * var(--m-text-scale, 1));
  line-height: 1;
  cursor: pointer;
}

.m-item-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.m-item-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--key-shadow);
}

.m-item-text {
  font-size: calc(15px * var(--m-text-scale, 1));
  line-height: 1.8;
  text-align: start;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.m-item-meta {
  color: var(--muted);
  font-size: calc(11px * var(--m-text-scale, 1));
  line-height: 1.6;
}

.m-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.m-item-btn {
  min-height: 38px;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card-soft);
  color: var(--text);
  font-size: calc(13px * var(--m-text-scale, 1));
  text-decoration: none;
  cursor: pointer;
}

.m-item-btn:hover {
  background: var(--card-hover);
}

.m-item-btn.danger {
  border-color: var(--danger-a22);
  background: var(--danger-soft);
  color: var(--danger);
}

.m-item-btn.danger:hover {
  background: var(--danger-soft-strong);
}

.m-thumb {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-soft);
  cursor: zoom-in;
}

.m-thumb-image {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: contain;
}

.m-file-info {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.m-file-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--primary);
}

.m-file-text {
  flex: 1 1 auto;
  min-width: 0;
}

.m-file-name {
  font-size: calc(14px * var(--m-text-scale, 1));
  line-height: 1.6;
  text-align: start;
  overflow-wrap: anywhere;
}

.m-video {
  display: block;
  width: 100%;
  max-height: 320px;
  border-radius: 12px;
  background: var(--video-bg);
}

.m-audio {
  display: block;
  width: 100%;
}

.m-media-note {
  margin: 0;
  color: var(--warning);
  font-size: calc(12px * var(--m-text-scale, 1));
  line-height: 1.7;
}

/* The first few kilobytes of a text file; the whole file opens in its own tab. */
.m-text-preview {
  max-height: 11.5em;
  margin: 0;
  padding: 10px 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-soft);
  font-family: Consolas, "Courier New", monospace, var(--m-font);
  font-size: calc(12px * var(--m-text-scale, 1));
  line-height: 1.6;
  text-align: start;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  unicode-bidi: plaintext;
}

/* The upload list moves between the send panel and this device's page; the slot itself takes no room. */
.m-upload-slot {
  display: contents;
}

/* =========================
   Send panel (single column only)
========================= */

.m-composer {
  display: none;
}

.m-composer-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.m-composer-title {
  margin: 0;
  color: var(--text-strong);
  font-size: calc(17px * var(--m-text-scale, 1));
}

/* The copied textarea rules are for the typing box (big text, a fixed height); here each paragraph takes its own
   direction (unicode-bidi: plaintext), German or Persian. */
textarea.m-composer-text {
  flex: 0 0 auto;
  /* A third of the screen; with the keyboard up the screen shrinks, and the box with it, so Save stays in view. */
  min-height: clamp(170px, 34dvh, 320px);
  padding: 12px 14px;
  border-radius: 14px;
  font-family: var(--m-font);
  font-size: calc(18px * var(--m-text-scale, 1));
  line-height: 1.8;
  direction: inherit;
  text-align: start;
  unicode-bidi: plaintext;
  resize: vertical;
}

.m-composer-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}

.m-composer-actions .action-btn {
  width: 100%;
  min-height: 52px;
  font-size: calc(15px * var(--m-text-scale, 1));
}

.m-composer-actions .action-btn:disabled {
  cursor: wait;
  opacity: 0.6;
}

.m-composer-note {
  margin: 0;
  color: var(--muted);
  font-size: calc(12px * var(--m-text-scale, 1));
  line-height: 1.7;
}

.m-composer-recent {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.m-composer-recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
}

.m-composer-recent-title {
  margin: 0;
  color: var(--muted);
  font-size: calc(13px * var(--m-text-scale, 1));
  font-weight: 400;
}

/* Recent cards are a glance; this device's page shows them whole. */
.m-composer .m-item-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.m-composer .m-video {
  max-height: 200px;
}

/* =========================
   Dropping files
========================= */

.m-drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border: 3px dashed var(--primary);
  background: var(--drop-overlay);
  pointer-events: none;
}

.m-drop-message {
  margin: 0;
  color: var(--primary);
  font-size: calc(20px * var(--m-text-scale, 1));
  text-align: center;
}

/* =========================
   Dialogs, lightbox, toasts
========================= */

/* With the keyboard up the dialog must fit what is left, so that Save stays on screen. */
.m-dialog {
  max-height: calc(100dvh - 28px);
}

.m-dialog h2 {
  margin: 0;
}

.m-confirm-title {
  font-size: calc(17px * var(--m-text-scale, 1));
  overflow-wrap: anywhere;
}

.m-confirm-message {
  margin: 0;
  font-size: calc(14px * var(--m-text-scale, 1));
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.m-dialog-error {
  margin: 0;
  padding: 8px 12px;
  border-radius: 11px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: calc(13px * var(--m-text-scale, 1));
  line-height: 1.7;
}

.m-danger-btn {
  min-height: 42px;
  padding: 9px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--danger-fill);
  color: var(--on-fill);
  font-size: calc(13px * var(--m-text-scale, 1));
  cursor: pointer;
}

.m-danger-btn:disabled,
.template-editor-save:disabled,
.template-editor-cancel:disabled {
  cursor: wait;
  opacity: 0.6;
}

.m-dialog .template-editor-actions {
  flex-wrap: wrap;
}

/* dir="auto" decides here, against any direction the copied textarea rules set: a card may hold German or Persian. */
.template-editor-field textarea.m-item-editor-text {
  /* 197px is the rest of the dialog: on a small phone with the keyboard up the box gives way, not the Save button. */
  min-height: clamp(90px, calc(100dvh - 197px), 220px);
  font-size: calc(16px * var(--m-text-scale, 1));
  direction: inherit;
  text-align: start;
  unicode-bidi: plaintext;
}

.m-no-press {
  pointer-events: none;
}

/* The list scrolls and the close button stays. The top is fixed, because a centred dialog would grow around its
   middle when the cards arrive, and a press meant for the close button could land on a card. */
.m-import-dialog {
  margin: 14px auto auto;
}

.m-import-dialog[open] {
  display: flex;
  overflow: hidden;
}

.m-import-panel {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}

.m-import-message {
  margin: 0;
  color: var(--muted);
  font-size: calc(13px * var(--m-text-scale, 1));
  line-height: 1.7;
}

.m-import-list {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.m-import-list:empty {
  display: none;
}

.m-import-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.m-import-device {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: calc(13px * var(--m-text-scale, 1));
  font-weight: 400;
}

.m-import-device-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.m-import-card {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

/* The list scrolls; its cards and groups keep their full height instead of being squeezed to fit it, which cut their
   text and pushed the path line over it. */
.m-import-list > *,
.m-import-group > * {
  flex-shrink: 0;
}

.m-import-list {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) transparent;
}

.m-import-card:hover {
  background: var(--card-hover);
}

.m-import-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.m-import-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  font-size: calc(14px * var(--m-text-scale, 1));
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.m-lightbox {
  width: min(960px, calc(100% - 20px));
  max-height: calc(100vh - 20px);
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--card);
  color: var(--text);
}

.m-lightbox::backdrop {
  background: var(--backdrop-strong);
}

.m-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.m-lightbox-name {
  min-width: 0;
  font-size: calc(13px * var(--m-text-scale, 1));
  overflow-wrap: anywhere;
}

.m-lightbox-image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 110px);
  margin: 0 auto;
  object-fit: contain;
}

.m-toasts {
  position: fixed;
  inset-inline: 12px;
  bottom: 16px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.m-toast {
  max-width: min(420px, 100%);
  padding: 9px 16px;
  border-radius: 12px;
  background: var(--toast-bg);
  color: var(--toast-text);
  font-size: calc(13px * var(--m-text-scale, 1));
  line-height: 1.7;
  overflow-wrap: anywhere;
  box-shadow: 0 10px 28px var(--shade-28);
}

/* =========================
   Login and offline pages
========================= */

body.m-center-body {
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 16px;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.m-center-card {
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
}

.m-center-card h1 {
  margin: 0;
  font-size: calc(24px * var(--m-text-scale, 1));
  text-align: center;
}

.m-login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.m-center-card .template-editor-field .m-password-input {
  direction: ltr;
  font-size: calc(26px * var(--m-text-scale, 1));
  letter-spacing: 0.4em;
  text-align: center;
}

.m-center-card .template-editor-field .m-email-input,
.m-center-card .template-editor-field .m-name-input {
  font-size: calc(16px * var(--m-text-scale, 1));
}

.m-login-request {
  width: 100%;
}

.m-login-submit {
  width: 100%;
  min-height: 46px;
  font-size: calc(15px * var(--m-text-scale, 1));
}

.m-login-message {
  margin: 0;
  padding: 8px 12px;
  border-radius: 11px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: calc(13px * var(--m-text-scale, 1));
  line-height: 1.7;
}

.m-login-message-ok {
  background: var(--success-soft);
  color: var(--success);
}

.m-center-note {
  margin: 0;
  color: var(--muted);
  font-size: calc(12px * var(--m-text-scale, 1));
  line-height: 1.8;
  text-align: center;
}

.m-offline-retry {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* =========================
   AI workspace
========================= */

.m-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.m-tabs {
  display: none;
}

/* ---------- The banner, and the tabs as sheets: one per conversation (one patient, one task) ---------- */

/* The title at the start, wrapping on a narrow screen; the header's tools (the Persian keyboard, then the settings)
   at the end, one size and style. */
.m-site-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.m-site-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: var(--text-strong);
  font-size: calc(18px * var(--m-text-scale, 1));
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.m-head-tools {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
}

/* The keyboard button while its panel is open. */
.m-head-tool[aria-expanded="true"],
.m-head-tool[aria-expanded="true"]:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.m-gear {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--control);
  color: var(--muted);
  cursor: pointer;
}

.m-gear:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.m-gear:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* --m-sheet-radius: the sheet's corners, which the row of tabs starts after. */
.m-sheet {
  --m-sheet-radius: var(--radius-lg);
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* The tab heads sit on the sheet's top edge; the shown tab covers the edge and joins its sheet. The first tab starts
   where the sheet's rounded top-left corner has ended, so its side meets a straight edge, at every width. «+» and
   «Alle Dokumente» stay beside the last row. */
.m-sheet-tabs {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin-bottom: -1px;
  padding-inline: calc(var(--m-sheet-radius) + 4px) 6px;
}

/* Too many tabs for one row wrap into rows above each other, like stacked folder tabs, never a row that scrolls
   sideways. Each tab has its own bottom line: in the last row it lies on the sheet's edge, in a row above it closes
   that tab. The order stays as it is: the shown tab is marked where it stands, also in a row above. */
.m-conv-tabs {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 3px;
  padding-top: 6px;
}

.m-conv-tab {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 240px;
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  background: var(--card-soft);
  color: var(--muted);
}

.m-conv-tab:hover {
  background: var(--card-hover);
  color: var(--text);
}

.m-conv-tab.active {
  border-bottom: 0;
  padding-bottom: 1px;
  background: var(--card);
  color: var(--text);
  box-shadow: inset 0 3px 0 var(--primary);
}

.m-conv-tab-btn {
  min-width: 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-block: 4px;
  padding-inline: 12px 2px;
  border: 0;
  border-radius: 12px 12px 0 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: calc(13px * var(--m-text-scale, 1));
  cursor: pointer;
}

.m-conv-tab.active .m-conv-tab-btn {
  font-weight: 700;
}

.m-conv-tab-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Waiting for Claude's name: what shows meanwhile is a placeholder, the date or the old name. */
.m-conv-tab.waiting .m-conv-tab-title {
  font-style: italic;
}

/* A tab where a scenario is written: a small diamond before its name, in the colours of a box's scenario tag. */
.m-conv-tab-scenario .m-conv-tab-btn::before {
  content: "";
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 8px;
  height: 8px;
  margin-inline: 1px;
  border: 1.5px solid var(--primary);
  border-radius: 2px;
  background: var(--primary-soft);
  transform: rotate(45deg);
}

.m-conv-tab-busy {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--busy);
  animation: m-conv-busy 1.2s ease-in-out infinite;
}

@keyframes m-conv-busy {
  50% {
    opacity: 0.3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .m-conv-tab-busy {
    animation: none;
  }
}

.m-conv-tab-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin-inline-end: 3px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  opacity: 0.65;
  cursor: pointer;
}

.m-conv-tab-close:hover,
.m-conv-tab-close:focus-visible {
  opacity: 1;
  background: var(--ink-hover);
}

.m-conv-tab-btn:focus-visible,
.m-conv-tab-close:focus-visible,
.m-conv-new:focus-visible,
.m-conv-all:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.m-conv-new {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.m-conv-new:hover,
.m-conv-all:not(:disabled):hover {
  background: var(--primary-soft);
}

.m-conv-all {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  margin-bottom: 3px;
  margin-inline-start: auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.m-sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--m-sheet-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.m-sheet-body.m-no-tab > * {
  display: none;
}

/* One column for every kind of tab, with its own scroll on wide screens. */
.m-sheet-body > .main-column {
  flex: 1 1 auto;
}

/* Wide screens: the page takes the whole width; the column of transfer tools (belonging to no tab) on the left at full
   height, the banner and the sheets beside it. The column keeps its old class name, right-column. */
@media (min-width: 981px) {
  .page {
    width: calc(100% - 28px);
    grid-template-columns: 320px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .page > .right-column {
    grid-row: 1 / span 2;
    grid-column: 1 / 2;
  }

  .page > .m-site-head {
    grid-row: 1;
    grid-column: 2 / 3;
  }

  .page > .m-sheet {
    grid-row: 2;
    grid-column: 2 / 3;
  }
}

.m-sheet .m-ai {
  padding-top: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* ---------- What a new tab is for ---------- */

.m-ask {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 8px;
}

.m-ask-title {
  margin: 0;
  color: var(--text-strong);
  font-size: calc(17px * var(--m-text-scale, 1));
}

.m-ask-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

/* ---------- The boxes: the general box on top, then under «Ausgabe» the type's own, one under another ---------- */

.m-boxes {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* «Ausgabe»: a thin heading with a line to the end, so the type's boxes read as one group after the general box. */
.m-boxes-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: var(--m-fs-ctl-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.m-boxes-title::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--border-strong);
}

.m-box {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.4s, border-color 0.4s;
}

.m-box-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* The title keeps the start and takes the free space, so its count and «Schreibt …» sit beside the buttons at the
   end. */
.m-box-title {
  flex-grow: 1;
  margin: 0;
  min-width: 0;
  color: var(--text-strong);
  font-size: var(--m-fs-ctl);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.m-box-count,
.m-box-writing {
  font-size: var(--m-fs-ctl-sm);
  white-space: nowrap;
}

.m-box-count {
  color: var(--muted);
  unicode-bidi: isolate;
}

.m-box-count.m-box-over {
  color: var(--danger);
  font-weight: 700;
}

.m-box-writing {
  color: var(--primary);
}

/* The scenario a box was filled from, after its title: its name on a light tag, cut short with an ellipsis. */
.m-box-scenario {
  min-width: 0;
  max-width: 16em;
  overflow: hidden;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: var(--m-fs-ctl-sm);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.m-box-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* The tools keep the head's end, also when they wrap under a long title. */
.m-box-head > .m-box-tools {
  margin-inline-start: auto;
}

.m-box-fixed {
  background: var(--card-soft);
}

.m-box-fixed > .m-letter-text {
  background: var(--card-soft);
}

.m-box-busy {
  border-color: var(--primary-a45);
}

.m-box-chips {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.m-box-chip {
  min-width: 0;
  max-width: 100%;
  min-height: 26px;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding-inline: 10px 2px;
  border-radius: 999px;
  background: var(--primary-soft-2);
  color: var(--text);
  font-size: var(--m-fs-ctl-sm);
}

.m-box-chip-kind {
  color: var(--muted);
}

.m-box-chip-text {
  min-width: 0;
  max-width: 320px;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.m-box-chip-text {
  cursor: pointer;
}

button.m-box-chip-text:hover {
  color: var(--primary);
}

.m-box-chip-remove {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: calc(15px * var(--m-text-scale, 1));
  line-height: 1;
  cursor: pointer;
}

.m-box-chip.m-box-chip-problem {
  background: var(--danger-soft);
}

.m-box-chip-note {
  flex-basis: 100%;
  padding-inline-end: 8px;
  color: var(--danger);
}

/* The general box («Allgemeine Angaben»): the owner's own information for all boxes, then the cards of the general
   part of the draft. It is not one of the boxes Claude writes, and looks it: tinted, a strong accent edge at the
   start, more room in and around it. Its title row: the mark, the title (ai.js's #aiDraftTitle), the tools at the
   end, as every box's are; the box's own parts join the draft's grid, under the title row. */
.m-kind-boxes .m-ai-draft {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-block: 2px 10px;
  padding: calc(var(--m-pad-box) + 4px);
  padding-inline-start: calc(var(--m-pad-box) + 6px);
  border: 1px solid var(--primary-a24);
  border-inline-start: 5px solid var(--primary);
  border-radius: var(--m-r-box);
  background: var(--primary-soft-2);
  box-shadow: 0 4px 14px var(--primary-a08);
}

.m-box-general {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.m-kind-boxes .m-box-general {
  display: contents;
}

.m-kind-boxes .m-ai-draft > *,
.m-kind-boxes .m-box-general > * {
  grid-column: 1 / -1;
}

.m-kind-boxes .m-box-general > .m-box-general-mark {
  grid-column: 1;
  grid-row: 1;
}

.m-kind-boxes .m-ai-draft-title {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  color: var(--primary-strong);
  font-size: calc(15px * var(--m-text-scale, 1));
  font-weight: 700;
  overflow-wrap: anywhere;
}

.m-kind-boxes .m-box-general > .m-box-general-tools {
  grid-column: 3;
  grid-row: 1;
  justify-content: flex-end;
}

.m-box-general-mark {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--m-r-ctl);
  background: var(--primary);
  color: var(--on-primary);
}

.m-box-general-mark .m-icon {
  width: 18px;
  height: 18px;
}

/* Inside the tint the owner's text and the tools stay white, as fields and buttons are elsewhere. */
.m-box-general .m-letter-text {
  min-height: 88px;
  background: var(--field);
}

.m-kind-boxes .m-ai-draft .m-ai-cards {
  gap: 8px;
}

/* A file dragged over a box lands in it. */
.m-drop-target {
  outline: 2px dashed var(--primary);
  outline-offset: 2px;
}

/* Claude's latest answer, the earlier messages folded under it. */
.m-ai-answer-host {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.m-ai-answer-host:empty {
  display: none;
}

.m-ai-earlier {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.m-ai-earlier-head {
  min-height: var(--m-h-sm);
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: var(--m-fs-ctl-sm);
  cursor: pointer;
}

.m-ai-earlier-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 8px;
}

/* ---------- The history of a box ---------- */

.m-history-entry {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--m-pad-box);
  border: 1px solid var(--border);
  border-radius: var(--m-r-box);
  background: var(--card);
}

.m-history-head {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: var(--m-fs-ctl-sm);
}

.m-history-by {
  color: var(--primary);
  font-weight: 700;
}

.m-history-text {
  margin: 0;
  max-height: 260px;
  overflow: auto;
  font-family: var(--m-font); /* Not the monospace of pre: Vazir draws the Persian, the system font the German. */
  font-size: var(--m-fs-ctl-sm);
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-align: start;
  unicode-bidi: plaintext;
}

.m-history-empty {
  color: var(--muted);
}

/* A box Claude has just written lights up for a moment. */
.m-p-box.m-letter-fresh {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* The owner's change that Claude has not seen yet. */
.m-p-box.m-p-unsent > .m-letter-text {
  border-color: var(--warning-edge);
}

.m-p-box.m-p-by-claude > .m-letter-text {
  background: var(--field-tint);
}

input.m-letter-text {
  min-height: 36px;
  resize: none;
  field-sizing: fixed;
}

.m-letter-text[readonly] {
  background: var(--card-soft);
}

/* letter.js sets each box's dir from its own text, over any direction the copied textarea rule sets. */
.m-letter-text[dir="ltr"] {
  direction: ltr;
  text-align: left;
}

.m-letter-text[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

.m-letter-text {
  flex: none;
  unicode-bidi: plaintext;
  width: 100%;
  min-height: 72px;
  field-sizing: content; /* Grows with its text where the browser can; letter.js sizes it elsewhere. */
  resize: vertical;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--field);
  color: var(--text);
  font-family: var(--m-font);
  font-size: calc(14px * var(--m-text-scale, 1));
  line-height: 1.55;
}

/* A box's text that shows bold (bold.js): an editable field with a textarea's look, its line breaks kept as typed,
   growing with its text. Its bold is the field's own weight and 700. */
.m-rich-text {
  box-sizing: border-box;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-weight: 400;
  cursor: text;
}

.m-rich-text b,
.m-history-text b,
.m-var-view b {
  font-weight: 700;
}

.m-rich-text[contenteditable="false"] {
  background: var(--card-soft);
  cursor: default;
}

.m-letter-over {
  margin: 0;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: var(--warning-soft-2);
  color: var(--warning);
  font-size: calc(13px * var(--m-text-scale, 1));
}

.m-letter-over[hidden] {
  display: none;
}

/* What went wrong with one box, said in that box. */
.m-box-note {
  margin: 0;
  padding: 4px 8px;
  border-radius: var(--m-r-ctl);
  background: var(--danger-a08);
  color: var(--danger);
  font-size: var(--m-fs-ctl-sm);
}

.m-letter-conflict {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: var(--warning-soft-2);
}

.m-letter-conflict[hidden] {
  display: none;
}

.m-letter-conflict-text {
  margin: 0;
  flex: 1 1 100%;
  color: var(--warning);
  font-size: calc(13px * var(--m-text-scale, 1));
}

.m-letter-status {
  margin: 0;
  color: var(--muted);
  font-size: calc(12px * var(--m-text-scale, 1));
}

.m-letter-status:empty {
  display: none;
}

.m-ai-letter-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0;
  color: var(--primary);
  font-size: calc(13px * var(--m-text-scale, 1));
}

/* The preview's model, beside its label, before the buttons. */
.template-editor-field.m-preview-model {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.m-preview-model .m-ai-select {
  flex: 1 1 220px;
}

.m-ai :focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.m-ai {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* The send bar floats at the bottom of this column, in its own room at the end: nothing ends up under it. */
  padding: 16px 16px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  color: var(--text);
}




.m-ai-select {
  min-width: 0;
  max-width: 100%;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: calc(14px * var(--m-text-scale, 1));
}


.m-ai-warning {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: calc(14px * var(--m-text-scale, 1));
  line-height: 1.8;
}

.m-ai-history {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.m-ai-history:empty {
  display: none;
}

.m-ai-turn {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.m-ai-turn-user {
  background: var(--primary-soft-2);
}

.m-ai-turn-user.left-out {
  opacity: 0.75;
}

.m-ai-text-swap {
  align-self: flex-start;
}

.m-ai-turn-note {
  margin: 0;
  color: var(--muted);
  font-size: calc(13px * var(--m-text-scale, 1));
}

.m-ai-turn-answer {
  background: var(--card);
}

.m-ai-turn-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}

.m-ai-turn-label {
  margin: 0;
  color: var(--primary);
  font-size: calc(13px * var(--m-text-scale, 1));
  font-weight: 700;
}

.m-ai-turn-cost {
  color: var(--muted);
  font-size: calc(11px * var(--m-text-scale, 1));
}

.m-ai-turn-cards {
  margin: 0;
  padding-inline-start: 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: calc(13px * var(--m-text-scale, 1));
  line-height: 1.7;
}

.m-ai-turn-card {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* A sent card is a reminder of what went; a long prompt shows two lines. */
.m-ai-turn-card-text {
  display: -webkit-inline-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  vertical-align: top;
}

.m-ai-turn-card > * + * {
  margin-inline-start: 6px;
}

.m-ai-turn-patches {
  color: var(--muted);
  font-size: calc(12px * var(--m-text-scale, 1));
}

.m-ai-answer {
  min-width: 0;
  font-size: calc(15px * var(--m-text-scale, 1));
  line-height: 1.95;
  overflow-wrap: anywhere;
}

.m-ai-p,
.m-ai-h,
.m-ai-li {
  margin: 0 0 8px;
  text-align: start;
  white-space: pre-wrap;
  unicode-bidi: plaintext;
}

.m-ai-h {
  font-size: calc(16px * var(--m-text-scale, 1));
  font-weight: 700;
}

.m-ai-li {
  padding-inline-start: 10px;
}

.m-ai-pre {
  margin: 0 0 8px;
  padding: 10px 12px;
  overflow-x: auto;
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--code-text);
  font-family: Consolas, "Courier New", monospace;
  font-size: calc(13px * var(--m-text-scale, 1));
  line-height: 1.6;
  text-align: left;
}

.m-ai-code {
  padding: 0 4px;
  border-radius: 5px;
  background: var(--card-soft);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
}

.m-ai-turn-status {
  margin: 0;
  color: var(--muted);
  font-size: calc(13px * var(--m-text-scale, 1));
  line-height: 1.7;
}

.m-ai-turn-error {
  color: var(--danger);
}

/* Claude's questions under its answer: a group per question, its suggestions one under the other and «Sonstiges» last
   with its own field; once answered or past, each question with what was answered. */
.m-ai-questions {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.m-ai-question {
  min-width: 0;
  margin: 0;
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--border-strong);
  border-radius: var(--m-r-box);
}

/* A question of several lines inside the box, not on its border: a floated legend is an ordinary item. */
.m-ai-question legend {
  float: left;
  width: 100%;
  max-width: 100%;
  margin: 0 0 2px;
  padding: 0;
  color: var(--text-strong);
  font-size: calc(14px * var(--m-text-scale, 1));
  font-weight: 700;
  line-height: 1.7;
  overflow-wrap: anywhere;
  unicode-bidi: plaintext;
}

/* A question left without an answer at «Antworten senden»; the error line under the questions says so. */
.m-ai-question.m-choice-missing {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger);
}

.m-ai-question.m-choice-missing legend {
  color: var(--danger);
}

.m-ai-question-option {
  min-width: 0;
  min-height: var(--m-h-sm);
  padding-block: 3px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: calc(14px * var(--m-text-scale, 1));
  line-height: 1.7;
  cursor: pointer;
}

.m-ai-question-option input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--primary);
}

.m-ai-question-option span {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: start;
  unicode-bidi: plaintext;
}

.m-ai-question-other {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
}

.m-ai-question-other .m-ai-question-option {
  flex: none;
}

.m-ai-question-other .m-ai-line-input {
  flex: 1 1 180px;
}

.m-ai-questions-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.m-ai-questions-send {
  min-height: var(--m-h);
}

.m-ai-question-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.m-ai-question-item {
  min-width: 0;
  padding: 2px 0;
  padding-inline-start: 10px;
  border-inline-start: 3px solid var(--border-strong);
}

.m-ai-question-text,
.m-ai-question-answer {
  margin: 0;
  font-size: calc(14px * var(--m-text-scale, 1));
  line-height: 1.7;
  overflow-wrap: anywhere;
  text-align: start;
  unicode-bidi: plaintext;
}

.m-ai-question-text {
  color: var(--text-strong);
  font-weight: 700;
}

.m-ai-question-none {
  color: var(--muted);
}

.m-ai-draft {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.m-ai-draft-title {
  margin: 0;
  color: var(--text-strong);
  font-size: calc(15px * var(--m-text-scale, 1));
}

.m-ai-cards {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.m-ai-cards:empty {
  display: none;
}

.m-ai-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--key-shadow);
}

.m-ai-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.m-ai-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.m-ai-card-number {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-size: calc(12px * var(--m-text-scale, 1));
}

.m-ai-card-kind {
  flex: 0 0 auto;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--card-soft);
  color: var(--muted);
  font-size: calc(12px * var(--m-text-scale, 1));
  line-height: 1.9;
}

.m-ai-card-name {
  min-width: 0;
  overflow: hidden;
  font-size: calc(13px * var(--m-text-scale, 1));
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.m-ai-card-tools {
  margin-inline-start: auto;
  display: flex;
  gap: 4px;
}

.m-ai-icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-soft);
  color: var(--text);
  font-size: calc(16px * var(--m-text-scale, 1));
  line-height: 1;
  cursor: pointer;
}

.m-ai-icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.m-ai-icon-btn.danger {
  border-color: var(--danger-a22);
  background: var(--danger-soft);
  color: var(--danger);
}

/* The text opens the editor. Long text is cut to a few lines here; the editor shows it whole. */
.m-ai-card-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  overflow: hidden;
  width: 100%;
  padding: 8px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: 11px;
  background: var(--card-soft);
  color: var(--text);
  font: inherit;
  font-size: calc(15px * var(--m-text-scale, 1));
  line-height: 1.8;
  text-align: start;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  unicode-bidi: plaintext;
  cursor: text;
}

.m-ai-card-text:hover {
  border-color: var(--primary);
}

.m-ai-card-hint {
  margin: 0;
  color: var(--muted);
  font-size: calc(13px * var(--m-text-scale, 1));
}

.m-ai-card-problem {
  margin: 0;
  color: var(--danger);
  font-size: calc(13px * var(--m-text-scale, 1));
  line-height: 1.7;
}

.m-ai-patches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.m-ai-patch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px 2px 10px;
  border-radius: 999px;
  background: var(--teal-a12);
  color: var(--teal-text);
  font-size: calc(12px * var(--m-text-scale, 1));
}

.m-ai-patch-remove {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: calc(15px * var(--m-text-scale, 1));
  line-height: 1;
  cursor: pointer;
}

.m-ai-patch-add {
  min-height: 30px;
  padding: 2px 12px;
  border: 1px dashed var(--teal-a50);
  border-radius: 999px;
  background: transparent;
  color: var(--teal-text);
  font: inherit;
  font-size: calc(12px * var(--m-text-scale, 1));
  cursor: pointer;
}

/* ---------- The send bar: floating at the bottom centre of the conversation's column ---------- */
/* It is the column's last child and sticks to the bottom of what is in view: on a wide screen in the column's own
   scroll (the column's bottom padding keeps it off the edge: a sticky box stays inside its scroller's padding), on a
   phone in the page's, with or without the on-screen keyboard (the viewport shrinks with it). Scrolled to the end, it
   stands in its own room after the last content, so it never covers it; a short tab gets it at the column's foot.
   The error shows inside it, just above the buttons. */
.m-send-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  align-self: center;
  width: fit-content;
  max-width: min(680px, 100%);
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: 0 10px 30px var(--shade-16), 0 2px 6px var(--shade-08);
}

.m-send-bar > .m-dialog-error {
  overflow-wrap: anywhere;
}

/* The toasts stand just over the bar, not on it, wherever it is (pinned at the bottom, or resting under a short
   conversation) and however tall (an error line in it, a note under its buttons): ai.js keeps the distance from the
   window's bottom edge to the bar's top in --m-send-bar-gap, 0px while the bar is not on screen. */
.m-toasts {
  bottom: max(16px, calc(var(--m-send-bar-gap, 0px) + 8px));
}

.m-send-bar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
}

/* «Senden» and, with more than one model, its arrow: one button in two parts; the arrow's menu opens above it. */
.m-send-split {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  gap: 1px;
}

.m-send-split:has(> .m-send-more:not([hidden])) > .m-ai-send {
  border-start-end-radius: 0;
  border-end-end-radius: 0;
}

.m-send-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  inset-inline-start: 0;
  z-index: 25;
  min-width: max(100%, 240px);
  max-width: min(360px, calc(100vw - 32px));
  max-height: min(60vh, 360px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--m-r-box);
  box-shadow: 0 14px 36px var(--shade-20);
}

/* ai.js puts it below the arrow when there is more room there (the bar in its own place high on a short page). */
.m-send-menu[data-place="below"] {
  top: calc(100% + 8px);
  bottom: auto;
}

.m-send-menu-item {
  width: 100%;
  min-height: var(--m-h);
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 0;
  border-radius: var(--m-r-ctl);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--m-fs-ctl);
  text-align: start;
  cursor: pointer;
}

.m-send-menu-item:hover,
.m-send-menu-item:focus {
  background: var(--card-hover);
  color: var(--primary);
}

.m-send-menu-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.m-send-menu-item:disabled {
  opacity: 0.45;
  cursor: default;
}

.m-ai-send:disabled,
.m-send-more:disabled {
  cursor: default;
  opacity: 0.5;
}

.m-ai-send-note {
  max-width: 260px;
  color: var(--muted);
  font-size: calc(13px * var(--m-text-scale, 1));
  line-height: 1.4;
}

.m-ai-send-note:empty {
  display: none;
}

.m-ai-pick-title {
  font-size: calc(14px * var(--m-text-scale, 1));
  font-weight: 700;
}

/* A group of the patches' category in the picker («Allgemein» and any group the owner adds): a small heading over its
   entries, the first thing of its .m-import-group. */
.m-pick-group {
  margin: 0;
  color: var(--muted);
  font-size: var(--m-fs-ctl-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

.m-ai-preview-btn {
  min-height: 40px;
}

/* How a new tab gets its name. */
.m-ai-naming {
  margin: 0;
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.m-ai-naming[hidden] {
  display: none;
}

.m-ai-naming legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: calc(13px * var(--m-text-scale, 1));
}

.m-ai-naming-option {
  min-height: 36px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  font-size: calc(14px * var(--m-text-scale, 1));
  cursor: pointer;
}

.m-ai-naming-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

/* A choice's words stay beside its radio and wrap there on a narrow screen; the hint goes on its own line. */
.m-ai-naming-option > span:not(.m-ai-naming-hint) {
  flex: 1 1 0;
  min-width: 0;
}

/* «Eigener Name» keeps its words on one line, with the field beside it. */
.m-doc-own .m-ai-naming-option > span {
  flex: none;
}

.m-ai-naming-hint {
  flex-basis: 100%;
  padding-inline-start: 26px;
  color: var(--muted);
  font-size: calc(12px * var(--m-text-scale, 1));
  line-height: 1.7;
}

.m-ai-naming-hint:empty {
  display: none;
}

/* The preview of the next message: exactly the text Claude gets, line by line in its own direction. */
.m-ai-preview-dialog {
  width: min(900px, calc(100% - 20px));
}

.m-ai-preview {
  min-height: 0;
  max-height: calc(100dvh - 240px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.m-ai-preview-part {
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-soft);
}

.m-ai-preview-card {
  background: var(--card);
}

.m-ai-preview-part .m-ai-preview-part {
  margin-top: 8px;
}

.m-ai-preview-head {
  margin: 0;
  color: var(--text-strong);
  font-size: calc(13px * var(--m-text-scale, 1));
  font-weight: 700;
}

summary.m-ai-preview-head {
  min-height: 28px;
  cursor: pointer;
}

.m-ai-preview-text {
  margin: 6px 0 0;
  color: var(--text);
  font-family: var(--m-font);
  font-size: calc(13px * var(--m-text-scale, 1));
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-align: start;
  unicode-bidi: plaintext;
}

.m-ai-preview-more,
.m-ai-preview-file {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: calc(12px * var(--m-text-scale, 1));
  line-height: 1.7;
}

.m-ai-preview-problem {
  margin: 6px 0 0;
  color: var(--danger);
  font-size: calc(13px * var(--m-text-scale, 1));
}

/* The card editor: the Persian keyboard works in its box. */
.m-ai-text-dialog {
  width: min(820px, calc(100% - 20px));
}

.m-ai-typing-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.m-ai-mode {
  display: flex;
  gap: 6px;
}

.m-ai-typing-hint {
  color: var(--muted);
  font-size: calc(12px * var(--m-text-scale, 1));
}

.template-editor-field textarea.m-ai-text-input {
  min-height: clamp(120px, calc(100dvh - 300px), 420px);
  font-size: calc(18px * var(--m-text-scale, 1));
  direction: inherit;
  text-align: start;
  unicode-bidi: plaintext;
}

.m-ai-help {
  margin: 0;
  color: var(--muted);
  font-size: calc(12px * var(--m-text-scale, 1));
  line-height: 1.8;
}

/* =========================
   Persian typing side panel (opened from the header's keyboard button)
========================= */

/* At the end side, over the conversation: the column of transfer tools at the start stays in view. */
.m-typing-panel {
  position: fixed;
  top: 14px;
  bottom: 14px;
  inset-inline-end: 14px;
  z-index: 45;
  width: min(760px, calc(100vw - 420px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 48px var(--shade-24);
  animation: m-typing-in 0.18s ease-out;
}

/* Wide screens: under the page's header, so its keyboard button (which closes the panel again) and the gear stay in
   view. sections.js measures where the header ends; until then, where a one-line header ends (the page's margin,
   the header with its border and padding, the page's gap). */
@media (min-width: 981px) {
  .m-typing-panel {
    top: var(--m-typing-top, calc(var(--m-h) + 46px));
  }
}

/* In from the end side. */
@keyframes m-typing-in {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .m-typing-panel {
    animation: none;
  }
}

.m-typing-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.m-typing-panel-title {
  margin: 0;
  margin-inline-end: auto;
  font-size: calc(16px * var(--m-text-scale, 1));
}

/* The hero holds only the language card now. */
.m-typing-panel .hero {
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 0;
}

.m-typing-panel .workspace {
  flex: 1 0 auto;
  overflow: visible;
}

.m-typing-panel .editor-card {
  min-height: 360px;
}

/* =========================
   Single column: the phone flow starts at the send panel, and the rest folds to its titles
========================= */

@media (max-width: 980px) {
  /* The list comes first on screen but after the keyboard in the document, so an anchor below it would throw it upward. */
  .page {
    overflow-anchor: none;
  }

  /* iOS zooms the page into a field whose text is under 16 px; there the fields keep 16 px. */
  @supports (-webkit-touch-callout: none) {
    input:not([type="checkbox"]):not([type="radio"]),
    textarea,
    select {
      font-size: 16px !important; /* Above the class rules, which set smaller sizes. */
    }
  }

  .right-column {
    display: contents;
  }

  .m-composer {
    order: -4;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
  }

  .m-devices-card {
    order: -3;
    flex: 0 0 auto;
    max-height: none;
  }

  .templates-search-card {
    order: -2;
  }

  .templates-boxes {
    order: -1;
    flex: 0 0 auto;
  }

  .m-device-list {
    max-height: 40vh;
  }

  .m-device-row {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .m-devices-title,
  .templates-title {
    display: none;
  }

  .templates-header {
    justify-content: flex-start;
    margin-bottom: 0;
  }

  .templates-search-card .template-search {
    margin: 8px 0 0;
  }

  .m-fold-toggle {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 2px;
    border: 0;
    background: transparent;
    color: var(--text-strong);
    font-size: calc(15px * var(--m-text-scale, 1));
    text-align: start;
    cursor: pointer;
  }

  /* Two sides of a square, turned: closed it points right, the way the text reads; open it points down. */
  .m-fold-chevron {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    margin: 0 4px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
  }

  .m-fold-toggle[aria-expanded="true"] .m-fold-chevron {
    transform: rotate(45deg);
  }

  /* Two tabs: the AI workspace, or the transfer sections. */
  .m-tabs {
    position: sticky;
    top: 0;
    z-index: 30;
    order: -10;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 6px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
  }

  .m-tab {
    min-height: 44px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: calc(15px * var(--m-text-scale, 1));
    cursor: pointer;
  }

  .m-tab[aria-selected="true"] {
    background: var(--primary-fill);
    color: var(--on-fill);
  }

  .m-site-head {
    order: -11;
  }

  /* The sheets under the AI tab; the transfer tools belong to no sheet. */
  .m-sheet {
    order: -9;
  }

  body[data-m-tab="transfer"] .m-sheet {
    display: none;
  }

  .m-sheet-body {
    overflow: visible;
  }

  .m-conv-tab {
    max-width: 210px;
  }

  .m-conv-tab-btn {
    min-height: 40px;
  }

  .m-conv-tab-close {
    width: 34px;
    height: 34px;
  }

  .m-conv-new {
    width: 40px;
    height: 40px;
  }

  .m-conv-all {
    width: 40px;
    height: 40px;
  }

  body[data-m-tab="ai"] .m-composer,
  body[data-m-tab="ai"] .m-devices-card,
  body[data-m-tab="ai"] .templates-search-card,
  body[data-m-tab="ai"] .templates-boxes,
  body[data-m-tab="transfer"] .main-column {
    display: none !important;
  }

  .m-ask-choices {
    grid-template-columns: minmax(0, 1fr);
  }

  .m-ai {
    overflow: visible;
    padding: 14px 12px 12px;
  }

  /* A page of its own, over everything. */
  .m-typing-panel {
    inset: 0;
    width: auto;
    border-radius: 0;
    z-index: 55;
  }

  body[data-m-collapsed~="devices"] [data-m-fold="devices"],
  body[data-m-collapsed~="templates"] [data-m-fold="templates"] {
    display: none !important;
  }
}

/* A narrow phone: «+» and «Alle Dokumente» take a row of their own above the tabs, where they stand when no tab is
   open, so every row of tabs has the sheet's whole width and holds two tabs at least. */
@media (max-width: 480px) {
  .m-sheet-tabs {
    flex-wrap: wrap;
  }

  .m-conv-tabs {
    order: 1;
    flex: 1 1 100%;
  }

  .m-conv-tab {
    max-width: calc(50% - 2px);
  }
}

/* =========================
   One scale for controls and boxes
   Every button has one of three heights: small inside a box (copy, undo, card tools), standard for a section, a
   dialog or the tab row, large for the one main action (send). Every button and field has one corner radius,
   every box another, and all boxes the same padding. On a phone the heights grow for fingers. These rules come
   last on purpose: they settle the sizes the older rules above set one by one.
========================= */

:root {
  --m-h-sm: 30px;
  --m-h: 36px;
  --m-h-lg: 42px;
  --m-r-ctl: 10px;
  --m-r-box: 14px;
  --m-pad-box: 12px;
  --m-fs-ctl: calc(14px * var(--m-text-scale, 1));
  --m-fs-ctl-sm: calc(13px * var(--m-text-scale, 1));
  --m-field: #fbfcfe;
}

@media (max-width: 980px) {
  :root {
    --m-h-sm: 36px;
    --m-h: 42px;
    --m-h-lg: 48px;
  }
}

/* ---------- Buttons: one shape ---------- */

.action-btn,
.template-editor-save,
.template-editor-cancel,
.m-danger-btn,
.m-item-btn,
.m-ai-icon-btn,
.template-dialog-close,
.m-gear,
.m-conv-new,
.m-conv-all,
.m-install-btn,
.m-ai-patch-add {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--m-r-ctl);
  font-family: var(--m-font);
  line-height: 1.2;
  white-space: nowrap;
}

/* Standard: a section's buttons, the dialogs, the banner. */
.action-btn,
.template-editor-save,
.template-editor-cancel,
.m-danger-btn {
  min-height: var(--m-h);
  padding: 0 16px;
  font-size: var(--m-fs-ctl);
}

/* Small: inside a box or a list. */
.m-item-btn,
.m-install-btn {
  min-height: var(--m-h-sm);
  padding: 0 12px;
  font-size: var(--m-fs-ctl-sm);
}

/* Squares. */
.m-ai-icon-btn,
.m-conv-new,
.m-conv-all {
  width: var(--m-h-sm);
  height: var(--m-h-sm);
  min-height: 0;
  padding: 0;
}

.m-gear,
.template-dialog-close {
  width: var(--m-h);
  height: var(--m-h);
  min-height: 0;
  padding: 0;
}

/* Colours: primary is filled, everything else white with a border, danger only in its text and border. */
.action-btn,
.template-editor-save {
  border: 1px solid var(--primary-fill);
  background: var(--primary-fill);
  color: var(--on-fill);
  box-shadow: none;
}

.action-btn.secondary,
.template-editor-cancel,
.m-item-btn,
.m-ai-icon-btn,
.template-dialog-close,
.m-gear {
  border: 1px solid var(--border-strong);
  background: var(--control);
  color: var(--text);
  box-shadow: none;
}

.action-btn.secondary:hover,
.template-editor-cancel:hover,
.m-item-btn:hover,
.m-ai-icon-btn:not(:disabled):hover,
.template-dialog-close:hover,
.m-gear:hover {
  border-color: var(--primary-a45);
  background: var(--card-hover);
}

.action-btn.danger,
.m-item-btn.danger,
.m-ai-icon-btn.danger {
  border-color: var(--danger-a35);
  background: var(--control);
  color: var(--danger);
}

.action-btn.danger:hover,
.m-item-btn.danger:hover,
.m-ai-icon-btn.danger:not(:disabled):hover {
  border-color: var(--danger);
  background: var(--danger-faint);
}

.m-danger-btn {
  border: 1px solid var(--danger-fill);
}

.action-btn:disabled,
.m-item-btn:disabled,
.m-ai-icon-btn:disabled,
.m-conv-all:disabled,
.template-editor-save:disabled,
.template-editor-cancel:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

/* The page's buttons do not jump on hover; only colour says where the pointer is. */
.action-btn:hover,
.template-editor-save:hover,
.template-editor-cancel:hover,
.template-dialog-close:hover {
  transform: none;
}

/* ---------- Fields: one shape ---------- */

.m-ai-select,
.template-editor-field input,
.template-editor-field textarea,
.m-letter-text,
.m-ai-card-text {
  border: 1px solid var(--border-strong);
  border-radius: var(--m-r-ctl);
}

/* One line fields are as tall as a standard button. */
.m-ai-select,
.template-editor-field input,
.template-search {
  min-height: var(--m-h);
  padding-block: 4px;
  border-radius: var(--m-r-ctl);
  font-size: calc(14px * var(--m-text-scale, 1));
}

.template-add-button {
  border-radius: var(--m-r-box);
}

.m-letter-text,
.m-ai-card-text {
  background: var(--m-field);
}

.m-letter-text {
  padding: 8px 10px;
  resize: none;
}

.m-letter-text:focus,
.m-ai-card-text:focus-visible {
  border-color: var(--primary-a60);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.m-ai-card-text {
  padding: 8px 10px;
}

.m-ai-card-text:hover {
  border-color: var(--primary-a45);
}

/* ---------- Boxes: one shape ---------- */

.m-ai-turn,
.m-ai-card,
.m-box,
.m-ai-warning {
  border: 1px solid var(--border);
  border-radius: var(--m-r-box);
  padding: var(--m-pad-box);
  box-shadow: none;
}

.m-ai-card,
.m-box,
.m-ai-turn-answer {
  background: var(--card);
}

.m-box.m-box-fixed {
  background: var(--card-soft);
}

/* A box whose content only is fixed: a lighter tint than a fixed one, its text still editable. */
.m-box.m-box-content-fixed {
  background: var(--box-tint);
}

.m-ai-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.m-ai-card,
.m-box,
.m-ai-turn {
  gap: 8px;
}

/* A box's title row: the title, then its small buttons, all one height. */
.m-ai-card-head,
.m-box-head {
  min-height: var(--m-h-sm);
}

.m-ai-card-number {
  width: 24px;
  height: 24px;
}

.m-ai-card-kind {
  line-height: 22px;
}

.m-ai-card-tools {
  gap: 6px;
}

.m-ai-icon-btn {
  font-size: calc(15px * var(--m-text-scale, 1));
}

.m-ai-patches {
  gap: 6px;
}

/* The text gets the start padding, the remove button the end. */
.m-ai-patch {
  min-height: 26px;
  padding: 0;
  padding-inline: 10px 2px;
}

.m-ai-patch-remove {
  width: 22px;
  height: 22px;
}

.m-ai-patch-add {
  min-height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: var(--m-fs-ctl-sm);
}

/* A sent message: each card's number, kind and text on one line, the text wrapping under itself. */
.m-ai-turn-cards {
  padding-inline-start: 0;
  list-style: none;
  counter-reset: m-turn-card;
}

.m-ai-turn-card {
  counter-increment: m-turn-card;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: baseline;
  gap: 2px 8px;
}

.m-ai-turn-card::before {
  content: counter(m-turn-card, decimal) ".";
  color: var(--muted);
}

.m-ai-turn-card > * + * {
  margin-inline-start: 0;
}

.m-ai-turn-card .m-ai-card-kind {
  align-self: baseline;
}

.m-ai-turn-cards {
  gap: 8px;
}

.m-ai-turn-card-text {
  display: -webkit-box;
}

.m-ai-turn-patches {
  grid-column: 3;
}

/* The answer's buttons: small, in one row. */
.m-ai-turn .m-item-actions {
  gap: 6px;
}

/* ---------- A box's tools: small squares with an icon ---------- */

.m-box-icon {
  box-sizing: border-box;
  flex: none;
  width: var(--m-h-sm);
  height: var(--m-h-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--m-r-ctl);
  background: var(--control);
  color: var(--muted);
  cursor: pointer;
}

.m-box-icon .m-icon {
  width: 18px;
  height: 18px;
}

.m-box-icon:not(:disabled):hover {
  border-color: var(--primary-a45);
  background: var(--card-hover);
  color: var(--text);
}

.m-box-icon:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.m-box-icon:disabled {
  opacity: 0.4;
  cursor: default;
}

/* The ways to attach stand a little apart from the box's own tools. */
.m-box-icon:not(.m-box-add) + .m-box-add,
.m-fix-switch + .m-box-add {
  margin-inline-start: 6px;
}

/* ---------- A box's fix: a switch of three (Frei, Inhalt, Fix), its thumb sliding under the one chosen ---------- */

.m-fix-switch {
  --m-fix-seg: calc(var(--m-h-sm) - 4px);
  position: relative;
  flex: none;
  box-sizing: border-box;
  display: inline-grid;
  grid-template-columns: repeat(3, var(--m-fix-seg));
  height: var(--m-h-sm);
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--m-r-ctl);
  background: var(--card-soft);
}

.m-fix-option {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: calc(var(--m-r-ctl) - 3px);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.m-fix-option .m-icon {
  width: 16px;
  height: 16px;
}

.m-fix-option:hover {
  color: var(--text);
}

.m-fix-option:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

/* The chosen option stays as it is under the pointer too (a phone keeps :hover after the tap). */
.m-fix-option[aria-checked="true"],
.m-fix-option[aria-checked="true"]:hover {
  color: var(--primary);
  cursor: default;
}

.m-fix-switch[data-mode="full"] .m-fix-option[aria-checked="true"] {
  color: var(--on-fill);
}

/* One segment wide, under the first option; data-mode moves it under the second or the third. */
.m-fix-thumb {
  position: absolute;
  top: 2px;
  bottom: 2px;
  inset-inline-start: 2px;
  width: var(--m-fix-seg);
  border-radius: calc(var(--m-r-ctl) - 3px);
  background: var(--thumb);
  box-shadow: 0 1px 2px var(--shade-blue-18);
  pointer-events: none;
  transition: transform 150ms ease, background-color 150ms ease;
}

.m-fix-switch[data-mode="content"] .m-fix-thumb {
  transform: translateX(100%);
  background: var(--thumb-content);
}

.m-fix-switch[data-mode="full"] .m-fix-thumb {
  transform: translateX(200%);
  background: var(--primary-fill);
}

@media (prefers-reduced-motion: reduce) {
  .m-fix-thumb {
    transition: none;
  }
}

/* ---------- What the tab is for, and the instruction of its type ---------- */

/* In the column that scrolls the boxes (.m-ai) the row keeps its height when it wraps (the patient bar beside it). */
.m-type-bar {
  flex-shrink: 0;
  min-height: var(--m-h-sm);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.m-type-name {
  min-width: 0;
  color: var(--text-strong);
  font-size: var(--m-fs-ctl);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.m-type-edit {
  margin-inline-start: auto;
}

.m-type-edit .m-icon {
  width: 16px;
  height: 16px;
}

.m-type-dialog {
  width: min(820px, calc(100% - 20px));
}

/* The patient's values beside the type's name (letter.js fills it). */
.m-patient-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

/* ---------- A new document: its name and type; the patient's values a scenario asks for ---------- */

.m-doc-dialog,
.m-patient-dialog {
  width: min(480px, calc(100% - 20px));
}

/* «Neues Dokument»: the type first, in a grid of equal cells, then how the name comes; the own name's field beside
   its choice, under it when the row is narrow. */
.m-doc-set {
  min-width: 0;
  margin: 0;
  padding: var(--m-pad-box);
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: var(--m-r-box);
}

.m-doc-set legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: calc(13px * var(--m-text-scale, 1));
}

/* The types in the list's order, row by row: three columns, two on a phone. Every cell as wide as the others and, with
   rows of 1fr, as high as the tallest label makes its row. */
.m-doc-types {
  min-width: 0;
  padding-top: 4px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 8px;
}

@media (max-width: 480px) {
  .m-doc-types {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* A cell: the radio at the start, the label beside it at the start too, wrapping inside the cell. */
.m-doc-type {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  min-height: var(--m-h-sm);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--m-r-ctl);
  background: var(--control);
  font-size: var(--m-fs-ctl);
  line-height: 1.35;
  text-align: start;
  cursor: pointer;
}

.m-doc-type span {
  flex: 1 1 0;
  min-width: 0;
  overflow-wrap: anywhere;
  /* One-word names such as «Notfallprotokoll» break at a German hyphenation point on a phone, not at a letter. */
  -webkit-hyphens: auto;
  hyphens: auto;
}

.m-doc-type input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
}

/* The choice shows in its border and colours only: a bolder label could wrap anew and make its row taller. */
.m-doc-type:has(input:checked) {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.m-doc-type:has(input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.m-doc-own {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
}

.m-doc-own .m-ai-naming-option {
  flex: none;
}

.m-doc-name {
  flex: 1 1 160px;
}

/* A one-line field outside the editor's labelled fields: the own name, a question's «Sonstiges». */
.m-ai-line-input {
  box-sizing: border-box;
  min-width: 0;
  min-height: var(--m-h);
  padding: 4px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--m-r-ctl);
  background: var(--field);
  color: var(--text);
  font-size: calc(14px * var(--m-text-scale, 1));
  text-align: start;
  outline: none;
  box-shadow: none;
}

.m-ai-line-input:focus {
  border-color: var(--primary-a56);
  box-shadow: 0 0 0 3px var(--primary-a08);
}

.m-ai-line-input:disabled {
  background: var(--card-soft);
  color: var(--muted);
  cursor: default;
}

/* A group of options in a row: the patient's radios. */
.m-choice-set {
  min-width: 0;
  margin: 0;
  padding: var(--m-pad-box);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  border: 1px solid var(--border);
  border-radius: var(--m-r-box);
}

.m-choice-set legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: calc(13px * var(--m-text-scale, 1));
}

/* A question of the patient dialog left unanswered at «Weiter» (scenarios.js); the dialog's error line names it. */
.m-choice-set.m-choice-missing {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger);
}

.m-choice-set.m-choice-missing legend {
  color: var(--danger);
  font-weight: 700;
}

.m-choice-option {
  min-height: var(--m-h-sm);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: calc(14px * var(--m-text-scale, 1));
  cursor: pointer;
}

.m-choice-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

/* ---------- «Medikamente»: entries of the medication list for a box (letter.js) ---------- */

/* In a box's tools it belongs to what brings text in (variables.css): the gap before that group comes before it when
   «Aus Szenario» is hidden, and none comes between it and the ways to attach. */
.m-box-from-scenario[hidden] + .m-box-from-medications {
  margin-inline-start: 6px;
}

.m-box-icon.m-box-from-medications:not([hidden]) + .m-box-add {
  margin-inline-start: 0;
}

@media (max-width: 980px) {
  .m-box-head .m-box-from-scenario[hidden] + .m-box-from-medications {
    margin-inline-start: 4px;
  }
}

@media (max-width: 480px) {
  .m-box-head .m-box-tools.m-box-tools-many > .m-box-from-scenario[hidden] + .m-box-from-medications {
    margin-inline-start: 2px;
  }
}

.m-med-pick-dialog {
  width: min(640px, calc(100% - 28px));
}

.m-med-pick-list {
  gap: 6px;
}

/* An entry: its checkbox, then its name and strength over the start of its text. */
.m-choice-option.m-med-pick-option {
  min-height: 44px;
  padding: 8px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
}

.m-med-pick-option:hover,
.m-med-pick-option:has(input:checked) {
  border-color: var(--primary-a30);
  background: var(--card-hover);
}

.m-med-pick-option:focus-within {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.m-choice-option.m-med-pick-option input {
  flex-shrink: 0;
  margin-top: 1px;
}

.m-med-pick-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.m-med-pick-name {
  font-size: calc(13px * var(--m-text-scale, 1));
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* The start of the text the box takes: two lines at most. */
.m-med-pick-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-size: calc(12px * var(--m-text-scale, 1));
  line-height: 1.6;
  overflow-wrap: anywhere;
  text-align: start;
  unicode-bidi: plaintext;
}

.template-editor-field textarea.m-type-instruction {
  min-height: clamp(160px, calc(100dvh - 260px), 520px);
  font-size: calc(15px * var(--m-text-scale, 1));
  line-height: 1.7;
  direction: inherit;
  text-align: start;
  unicode-bidi: plaintext;
}

/* ---------- Every conversation: a row each, its card and its delete icon ---------- */

.m-all-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.m-all-row > .m-import-card {
  flex: 1 1 auto;
  min-width: 0;
}

.m-all-delete {
  flex: none;
}

.m-all-delete .m-icon {
  width: 18px;
  height: 18px;
}

/* ---------- The draft: a chat's add icons, and the send bar's buttons ---------- */
/* A chat's four add icons in a row, as a box's tools. The one heavy button is «Senden», large, in the floating bar
   with its arrow and «Vorschau». */

.m-ai-add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.m-send-bar-row > button,
.m-send-split > button {
  min-height: var(--m-h-lg);
}

.m-ai-send {
  min-width: 132px;
  padding: 0 28px;
  font-size: calc(15px * var(--m-text-scale, 1));
  font-weight: 700;
  box-shadow: 0 6px 16px var(--primary-a22);
}

/* The arrow: as tall as «Senden», square, the same colour, a thin light line between them. */
.m-send-more {
  width: var(--m-h-lg);
  min-width: var(--m-h-lg);
  padding: 0;
  border-start-start-radius: 0;
  border-end-start-radius: 0;
  border-inline-start-color: var(--on-fill-line);
  box-shadow: 0 6px 16px var(--primary-a22);
}

.m-send-more svg {
  transition: transform 0.15s ease;
}

/* Open above, the arrow turns towards the menu. */
.m-send-more[aria-expanded="true"]:has(+ .m-send-menu:not([data-place="below"])) svg {
  transform: rotate(180deg);
}

.m-send-bar-row .m-ai-preview-btn {
  padding: 0 18px;
  font-size: var(--m-fs-ctl);
}

/* ---------- Banner, tab row ---------- */

.m-site-head {
  min-height: calc(var(--m-h) + 16px);
  padding: 8px;
  padding-inline: 16px 10px;
}

.m-site-title {
  font-size: calc(17px * var(--m-text-scale, 1));
}

.m-conv-tab-btn {
  min-height: var(--m-h);
  font-size: var(--m-fs-ctl);
}

.m-conv-tab-close {
  width: 26px;
  height: 26px;
}

.m-conv-new,
.m-conv-all {
  margin-bottom: calc((var(--m-h) - var(--m-h-sm)) / 2);
}

.m-conv-new {
  font-size: 18px;
}

.m-ask-choice {
  min-height: var(--m-h-lg);
  white-space: normal;
}

/* A thin scrollbar on the tab's column, as in the lists beside it. */
.m-ai {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) transparent;
}

/* The sidebar's titles start where the others do; a device's remove button is a square like the others. */
@media (min-width: 981px) {
  .templates-header {
    justify-content: flex-start;
  }

  .templates-title {
    text-align: start;
  }
}

.m-device-remove {
  align-self: center;
  height: var(--m-h);
}

textarea.m-composer-text {
  resize: none;
  border-radius: var(--m-r-ctl);
}

/* ---------- Dialogs: the tab's window, the editor ---------- */

.template-editor-actions > * {
  min-height: var(--m-h);
}

.template-editor-actions .m-item-btn {
  padding: 0 16px;
  font-size: var(--m-fs-ctl);
}

.m-ai-typing-bar .mode-btn,
.m-ai-typing-bar .m-item-btn {
  min-height: var(--m-h-sm);
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--m-r-ctl);
  background: var(--control);
  box-shadow: none;
  font-size: var(--m-fs-ctl-sm);
}

.m-ai-typing-bar .mode-btn.active {
  border-color: var(--primary-fill);
  background: var(--primary-fill);
  color: var(--on-fill);
}

/* The same buttons under any other field while it is typed in: app.js sets top and left from the field. Over the
   side panels and toasts, under the drop overlay. */
.m-typing-switch {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 65;
  width: max-content;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border-strong);
  border-radius: calc(var(--m-r-ctl) + 4px);
  background: var(--card);
  box-shadow: 0 8px 24px var(--shade-16), 0 2px 6px var(--shade-08);
}

.m-typing-switch-away {
  visibility: hidden;
}

/* The naming choices, evenly apart. */
.m-ai-naming {
  padding: var(--m-pad-box);
  border-radius: var(--m-r-box);
}

.m-ai-naming-option {
  min-height: 0;
  padding-block: 6px;
}

/* The transfer panel's two main actions, and a device's remove button, in the same family. */
.m-composer-actions .action-btn {
  min-height: var(--m-h-lg);
}

.m-device-row {
  grid-template-columns: minmax(0, 1fr) var(--m-h);
}

.m-device-remove {
  border-color: var(--danger-a35);
  border-radius: var(--m-r-ctl);
  background: var(--control);
}

.m-device-remove:hover {
  border-color: var(--danger);
  background: var(--danger-faint);
}

/* ---------- Phone: less space above the work ---------- */

@media (max-width: 980px) {
  .page {
    gap: 10px;
  }

  .m-site-head {
    min-height: 0;
    border-radius: 16px;
  }

  /* The long title wraps, smaller, beside the two buttons. */
  .m-site-title {
    font-size: calc(15px * var(--m-text-scale, 1));
    line-height: 1.25;
  }

  .m-head-tools {
    gap: 6px;
  }

  .m-tabs {
    padding: 4px;
    border-radius: 14px;
  }

  .m-tab {
    min-height: var(--m-h);
    border-radius: 10px;
  }

  .m-conv-tab-btn {
    min-height: var(--m-h);
  }

  .m-conv-tab-close {
    width: 32px;
    height: 32px;
  }

  .m-conv-new,
  .m-conv-all {
    width: var(--m-h-sm);
    height: var(--m-h-sm);
  }

  .m-ai,
  .m-sheet .m-ai {
    gap: 12px;
    padding: 8px 10px 12px;
  }

  /* The bar sits a little above the screen's edge (and the home bar of a phone without buttons); its note, when
     there is one, under the buttons. */
  .m-send-bar {
    bottom: max(10px, env(safe-area-inset-bottom));
    padding: 6px;
    border-radius: 16px;
  }

  .m-ai-send-note {
    flex-basis: 100%;
    max-width: none;
    text-align: center;
  }

  .m-ai-send {
    min-width: 116px;
    padding: 0 22px;
  }

  /* A box's tools go under its title, still at the end; the general box's too. A little closer together there, and
     the fix switch's segments a little narrower, so that its row fits a phone. */
  .m-box-head > .m-box-tools {
    flex-basis: 100%;
    justify-content: flex-end;
    gap: 4px;
  }

  .m-box-head .m-fix-switch + .m-box-add {
    margin-inline-start: 4px;
  }

  .m-fix-switch {
    --m-fix-seg: calc(var(--m-h-sm) - 8px);
  }

  .m-kind-boxes .m-box-general > .m-box-general-tools {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .m-kind-boxes .m-ai-draft {
    padding: var(--m-pad-box);
    padding-inline-start: calc(var(--m-pad-box) + 2px);
    border-inline-start-width: 4px;
  }

  .m-site-head {
    padding: 6px;
    padding-inline: 14px 6px;
  }

  .m-composer {
    padding: var(--m-pad-box) 10px;
  }
}
