:root {
  --bg: #fff;
  --fg: #1d1d1d;
  --muted: #666;
  --accent: #8b3a62;
  --max-width: 40rem;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
}
.site-header {
  background: var(--accent);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.site-brand {
  display: flex; align-items: center; gap: 0.75rem;
  color: #fff; text-decoration: none; font-weight: 600; font-size: 1.15rem;
}
.site-brand:hover { text-decoration: none; opacity: 0.92; }
.site-logo { display: block; height: 2.5rem; width: auto; border-radius: 50%; background: #fff; }
.site-name { color: #fff; text-decoration: none; font-weight: 600; font-size: 1.25rem; }

.site-auth { display: flex; align-items: center; gap: 1rem; font-size: 0.9rem; }
.site-auth .user-name { color: rgba(255, 255, 255, 0.92); }
.auth-link { color: #fff; text-decoration: none; opacity: 0.92; }
.auth-link:hover { opacity: 1; text-decoration: underline; }
.auth-admin { border: 1px solid rgba(255, 255, 255, 0.5); padding: 0.2rem 0.6rem; border-radius: 3px; }
.auth-form { margin: 0; display: inline; }
.auth-button {
  background: none; border: 1px solid rgba(255, 255, 255, 0.4); color: #fff;
  padding: 0.2rem 0.6rem; border-radius: 3px; cursor: pointer;
  font: inherit; font-size: 0.85rem;
}
.auth-button:hover { background: rgba(255, 255, 255, 0.15); }

.site-main { max-width: var(--max-width); margin: 2rem auto; padding: 0 1.5rem; }
.site-footer { text-align: center; color: var(--muted); font-size: 0.875rem; padding: 2rem 1rem; }
a { color: var(--accent); }
.profile-card {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  padding: 1.5rem;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 1rem 0 0.5rem;
}
.profile-avatar {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.profile-summary { min-width: 0; flex: 1; }
.profile-name { margin: 0 0 0.15rem; font-size: 1.4rem; word-break: break-word; }
.profile-email { margin: 0 0 0.6rem; color: var(--muted); word-break: break-all; font-size: 0.95rem; }

.profile-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.profile-tag {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}
.profile-tag-super { background: var(--accent); border-color: var(--accent); color: #fff; }

.profile-meta-line { margin: 0 0 1.5rem; color: var(--muted); font-size: 0.9rem; }

.profile-section { margin: 1.75rem 0; }
.profile-section h2 { margin-bottom: 0.4rem; font-size: 1.15rem; }
.profile-section p { margin: 0.5rem 0; }
.profile-form { margin-top: 0.75rem; }
/* ==========================================================================
   Mail (read-only INBOX MVP)
   --------------------------------------------------------------------------
   2-pane layout: vlevo seznam účtů, vpravo zprávy nebo detail. Šířku sidebaru
   držíme úzkou (16rem), na malých displejích se zalamuje pod sebe.
   ========================================================================== */
/* Mail UI vyžaduje víc horizontálního místa než zbytek webu (50rem max-width).
   Přes :has() override-ujeme kontejner jen na mail stránkách — bez nutnosti
   přidávat třídu do base.php. */
.site-main:has(.mail-app) { max-width: 80rem; }
.mail-app {
  display: grid;
  grid-template-columns: 16rem 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}
@media (max-width: 700px) {
  .mail-app { grid-template-columns: 1fr; }
}
.mail-sidebar {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fafafa;
  padding: 0.75rem;
  height: fit-content;
}
.mail-sidebar-title {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.mail-account-list { list-style: none; padding: 0; margin: 0; }
.mail-account-list > li { margin: 0 0 0.4rem; }
.mail-account-list .mail-account {
  display: block;
  padding: 0.45rem 0.6rem;
  border-radius: 4px;
  text-decoration: none;
  color: var(--fg);
  font-size: 0.95rem;
  line-height: 1.3;
  font-weight: 600;
}
.mail-account-list .mail-account:hover { background: rgba(0,0,0,0.04); text-decoration: none; }
.mail-account-list > li.is-selected > .mail-account {
  background: rgba(29, 111, 165, 0.12);
  color: var(--accent);
}

/* Folder tree pro vybraný účet. Indent přes CSS variable --depth (set inline style). */
.mail-folder-list {
  list-style: none;
  padding: 0;
  margin: 0.15rem 0 0.5rem;
  font-size: 0.9rem;
}
.mail-folder { margin: 0; }
.mail-folder > a,
.mail-folder > .mail-folder-label {
  display: block;
  padding: 0.32rem 0.6rem 0.32rem calc(0.85rem + var(--depth, 0) * 0.85rem);
  border-radius: 3px;
  text-decoration: none;
  color: var(--fg);
  line-height: 1.25;
}
.mail-folder > a:hover { background: rgba(0,0,0,0.04); text-decoration: none; }
.mail-folder > .mail-folder-label {
  color: var(--muted);
  cursor: default;
}
.mail-folder.is-current > a {
  background: var(--accent);
  color: #fff;
}
/* Special folder ikonky přes CSS pseudo-element. SVG inline jako data URI,
   stroke je currentColor — zděděné z parent <a>, takže bíle na modrém pozadí
   u .is-current a tmavě jinde. */
.mail-folder > a::before,
.mail-folder > .mail-folder-label::before {
  content: '';
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: 0.4em;
  vertical-align: -0.15em;
  background-color: currentColor;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-size: contain;
          mask-size: contain;
  opacity: 0.85;
}
/* Inbox = inbox tray icon */
.mail-folder-inbox > a::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M2 9V3h12v6'/><path d='M2 9h3l1 2h4l1-2h3v4H2z'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M2 9V3h12v6'/><path d='M2 9h3l1 2h4l1-2h3v4H2z'/></svg>");
}
/* Sent = paper plane */
.mail-folder-sent > a::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M14 2L2 7l5 2 2 5z'/><path d='M14 2L7 9'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M14 2L2 7l5 2 2 5z'/><path d='M14 2L7 9'/></svg>");
}
/* Drafts = pencil */
.mail-folder-drafts > a::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M11 1.5L14.5 5L5 14.5H1.5V11L11 1.5Z'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M11 1.5L14.5 5L5 14.5H1.5V11L11 1.5Z'/></svg>");
}
/* Trash = bin */
.mail-folder-trash > a::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M2 4H14'/><path d='M12.5 4L12 14H4L3.5 4'/><path d='M6 4V2H10V4'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M2 4H14'/><path d='M12.5 4L12 14H4L3.5 4'/><path d='M6 4V2H10V4'/></svg>");
}
/* Junk = stop sign */
.mail-folder-junk > a::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='8' cy='8' r='6'/><path d='M5 8h6'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='8' cy='8' r='6'/><path d='M5 8h6'/></svg>");
}
/* Archive = box */
.mail-folder-archive > a::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M2 4h12v3H2z'/><path d='M3 7v6h10V7'/><path d='M6 10h4'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M2 4h12v3H2z'/><path d='M3 7v6h10V7'/><path d='M6 10h4'/></svg>");
}
/* User folder (default) = simple folder */
.mail-folder-user > a::before,
.mail-folder-all > a::before,
.mail-folder-important > a::before,
.mail-folder-flagged > a::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M2 4h4l2 2h6v7H2z'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M2 4h4l2 2h6v7H2z'/></svg>");
}

.mail-main { min-width: 0; }   /* min-width:0 dovolí grid child se zalomit */
.mail-toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
}
.mail-toolbar h1 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  color: var(--accent);
}
.mail-count { color: var(--muted); font-size: 0.85rem; }

.mail-message-list { list-style: none; padding: 0; margin: 0; }
.mail-message-list li {
  border-bottom: 1px solid var(--border);
  margin: 0;
}
.mail-message-list a {
  display: grid;
  /* From užší (8rem fixní), subject "vyhrává" zbytek místa.
     min-width:0 v gridu a ellipsis v dětech zaručí, že se nic nepřekrývá. */
  grid-template-columns: 8rem 1fr 4.5rem;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.6rem 0.5rem;
  text-decoration: none;
  color: var(--fg);
  font-size: 0.92rem;
}
.mail-message-list a:hover { background: rgba(0,0,0,0.03); text-decoration: none; }
.mail-message-list .mail-from {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-message-list .mail-subject {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent);
}
.mail-message-list time {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.mail-message-list li.is-unseen .mail-from,
.mail-message-list li.is-unseen .mail-subject { font-weight: 600; }
@media (max-width: 700px) {
  .mail-message-list a {
    grid-template-columns: 1fr 4rem;
    grid-template-areas: "from time" "subj subj";
  }
  .mail-message-list .mail-from { grid-area: from; }
  .mail-message-list .mail-subject { grid-area: subj; }
  .mail-message-list time { grid-area: time; }
}

.mail-message {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  padding: 1.25rem;
}
.mail-message-header h1 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  line-height: 1.3;
}
.mail-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 0.75rem;
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0;
}
.mail-meta dt { font-weight: 600; }
.mail-meta dd { margin: 0; color: var(--fg); }
.mail-message-body { margin-top: 1rem; }
.mail-message-body pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  background: none;
  padding: 0;
  border-radius: 0;
}

/* HTML body iframe (sandboxed). Pevná výška + interní scroll. Bez allow-scripts
   nemůžeme měřit content height a auto-resize, takže pevná dimenze je trade-off. */
.mail-body-frame {
  width: 100%;
  height: 70vh;
  min-height: 25rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  margin-top: 1rem;
  display: block;
}
.mail-images-toggle {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding: 0.6rem 0.9rem;
  background: #fff7e6;
  border: 1px solid #d99e3a;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #8a5a00;
}
.mail-images-toggle .btn-secondary {
  margin-left: auto;
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
}


/* User menu (avatar trigger + dropdown). Generický blok — používá CSS
   proměnné, takže se v každém tématu naplní svojí --accent / --border. */
.user-menu { position: relative; display: inline-block; }
.user-menu-trigger {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  border-radius: 50%;
  line-height: 0;
}
.user-menu-trigger:focus { outline: none; }
.user-menu-trigger:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.user-menu-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-sizing: border-box;
}
.user-menu-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 14rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  padding: 0.4rem 0;
  z-index: 100;
  font-size: 0.9rem;
  color: var(--fg);
}
.user-menu-dropdown[hidden] { display: none; }

.user-menu-header {
  padding: 0.5rem 1rem 0.4rem;
}
.user-menu-name {
  font-weight: 600;
  word-break: break-word;
}
.user-menu-email {
  color: var(--muted);
  font-size: 0.8rem;
  word-break: break-all;
}
.user-menu-dropdown hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0.3rem 0;
}
.user-menu-dropdown a,
.user-menu-dropdown button {
  display: block;
  width: 100%;
  padding: 0.45rem 1rem;
  color: var(--fg);
  text-decoration: none;
  background: none;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}
.user-menu-dropdown a:hover,
.user-menu-dropdown button:hover {
  background: rgba(0, 0, 0, 0.05);
  text-decoration: none;
}
.user-menu-dropdown form { margin: 0; padding: 0; }

/* Button styles (kopie z vodaci pro paritu /me uploadu napříč tenanty). */
.btn-primary, .btn-danger, .btn-cancel, .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  border: none;
}
/* Inline SVG ikonky uvnitř buttonů. fill:none + stroke:currentColor =
   ikona zdědí barvu textu buttonu (modrá u secondary, červená u danger). */
.btn-primary .icon,
.btn-secondary .icon,
.btn-danger .icon,
.btn-cancel .icon {
  width: 0.95em;
  height: 0.95em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { opacity: 0.9; text-decoration: none; }
.btn-secondary {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--accent);
  margin-right: 0.25rem;
}
.btn-secondary:hover { background: var(--accent); color: #fff; text-decoration: none; }
.btn-danger {
  background: #fff;
  color: #c33;
  border: 1px solid #c33;
}
.btn-danger:hover { background: #c33; color: #fff; }
.btn-cancel {
  background: #f0f0f0;
  color: #333;
  border: 1px solid var(--border);
}
.btn-cancel:hover { background: #e8e8e8; text-decoration: none; }

/* /me page wrapper — když na stránce je .profile-card, daj .site-main
   karta-styl (bílý box s shadow), aby vypadala jako auth /me. */
.site-main:has(.profile-card) {
  max-width: 46rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Mail message toolbar — back link vlevo, akce (Přečtené/Archivovat/Smazat) vpravo. */
.mail-message-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
}
.mail-message-toolbar .back {
  margin: 0;
  text-decoration: none;
  color: var(--accent);
  font-size: 0.95rem;
}
.mail-message-toolbar .back:hover { text-decoration: underline; }
.mail-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.mail-actions form { margin: 0; display: inline; }
.mail-actions .btn-secondary,
.mail-actions .btn-danger {
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  line-height: 1.2;
}
.mail-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}
.mail-pagination .btn-secondary {
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
}
.mail-pagination .btn-secondary.is-disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}
.mail-page-status {
  color: var(--muted);
  font-size: 0.9rem;
}
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.95rem;
}
.mail-compose-btn:hover { background: var(--accent-hover, var(--accent)); filter: brightness(1.08); text-decoration: none; }

.mail-compose-title { margin: 0 0 1rem; font-size: 1.5rem; font-weight: 700; }

.mail-compose-error {
  margin: 0 0 1rem;
  padding: 0.7rem 0.9rem;
  background: #fff4f4;
  border: 1px solid #f0c2c2;
  border-radius: 4px;
  color: #8a1f1f;
}

.mail-compose-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  max-width: 50rem;
}
.mail-compose-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  align-items: center;
  gap: 0.6rem;
}
.mail-compose-row > span {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}
.mail-compose-row input[type="text"],
.mail-compose-row select {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
  width: 100%;
  background: #fff;
}
.mail-compose-row input[type="text"]:focus,
.mail-compose-row select:focus,
.mail-compose-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 100, 200, 0.15);
}

.mail-compose-row-body { grid-template-columns: 1fr; }
.mail-compose-row textarea {
  width: 100%;
  min-height: 16rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  background: #fff;
}

/* Kopie / skrytá kopie — collapsible <details>. */
.mail-compose-cc-toggle {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.mail-compose-cc-toggle > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
  padding-left: 6.1rem;   /* zarovnání s labels nahoře */
  user-select: none;
  list-style: revert;
}
.mail-compose-cc-toggle[open] > summary { margin-bottom: 0.2rem; }

.mail-compose-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.5rem;
  padding-left: 6.1rem;
}

/* Compose layout — tightit max-width pro lepší čtení. */
.site-main:has(.mail-app-compose) { max-width: 70rem; }

/* Visually hidden helper pro screen readery. */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
/* ==========================================================================
   Mail attachments — seznam příloh v message detail.
   ========================================================================== */
.mail-attachments {
  margin: 1rem 0 1.25rem;
  padding: 0.75rem 1rem;
  background: #f8f8f8;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.mail-attachments h2 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.mail-attachments ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.mail-attachments li { display: flex; }
.mail-attachments a {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  text-decoration: none;
  color: var(--fg);
  flex: 1;
}
.mail-attachments a:hover {
  background: rgba(0,0,0,0.04);
  text-decoration: none;
}
.mail-attach-name { font-weight: 500; color: var(--accent); }
.mail-attach-meta { font-size: 0.8rem; color: var(--muted); }
.mail-attach-meta { font-size: 0.8rem; color: var(--muted); }
.mail-attach-icon {
  display: inline-block;
  margin-left: 0.3rem;
  font-size: 0.85em;
  opacity: 0.7;
  vertical-align: baseline;
}
}

/* Mail compose — file input pro přílohy. */
.mail-compose-row-files input[type="file"] {
  font-size: 0.9rem;
  font-family: inherit;
}
}

.mail-compose-row-forward-att .mail-compose-forward-att-label {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.95rem;
  color: var(--fg);
  cursor: pointer;
}
/* User menu — sekce "Přepnout na" v dropdownu (multi-tenant switcher). */
.user-menu-section-title {
  padding: 0.55rem 0.9rem 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.user-menu-dropdown a.user-menu-tenant-link {
  font-size: 0.95rem;
  color: var(--accent);
}

/* Externí link icon v user-menu (Související sekce). */
.user-menu-ext-icon {
  font-size: 0.85em;
  opacity: 0.6;
  margin-left: 0.2rem;
}
