/* Seznam-style webmail */
:root {
  --orange: #fb6421;
  --orange-hover: #e8551a;
  --orange-text: #ef5b1d;
  --text: #111;
  --text-2: #222;
  --text-3: #555;
  --muted: #9a9a9a;
  --muted-2: #666;
  --icon: #8a8a8a;
  --faint: #c3c3c3;
  --line: #e9e9e9;
  --border: #ddd;
  --border-strong: #b0b0b0;
  --bg: #fff;
  --raised: #fff;          /* menus, panels, cards on top of the page */
  --hover: #fafafa;
  --hover-2: #f4f4f4;
  --nav-hover: rgba(0, 0, 0, .04);
  --sb-bg: #f4f3f1;
  --active-bg: #f6e6df;
  --active-text: var(--orange-text);
  --active-ic: var(--orange);
  --sel-bg: #fff4ee;
  --sel-hover: #ffe9dd;
  --card-bg: #f4f5f7;
  --card-hover: #eceef1;
  --tb-bg: #f1f1f1;
  --tb-hover: #e6e6e6;
  --tb-text: #555;
  --avatar-bg: #ececec;
  --avatar-text: #222;
  --chk-bg: #fff;
  --bar-bg: var(--orange);  /* phone app bar */
  --sb-w: 260px;
  --zoom: 1;  /* text size (Nastavení → Vzhled), applied to the whole page */
  color-scheme: light;
}
/* Tmavý: Seznam's dark palette */
:root[data-theme="dark"] {
  --orange-text: #ff7433;
  --text: #ececec;
  --text-2: #e2e2e2;
  --text-3: #c4c4c4;
  --muted: #a3a3a3;
  --muted-2: #b0b0b0;
  --icon: #b5b5b5;
  --faint: #6f6f6f;
  --line: #333;
  --border: #474747;
  --border-strong: #6a6a6a;
  --bg: #1e1e1e;
  --raised: #2b2b2b;
  --hover: #262626;
  --hover-2: #383838;
  --nav-hover: rgba(255, 255, 255, .06);
  --sb-bg: #2b2b2b;
  --active-bg: #3d3d3d;
  --active-text: #fff;
  --active-ic: #fff;
  --sel-bg: #3a2b23;
  --sel-hover: #4a3226;
  --card-bg: #2b2b2b;
  --card-hover: #333;
  --tb-bg: #2c2c2c;
  --tb-hover: #3a3a3a;
  --tb-text: #d0d0d0;
  --avatar-bg: #e6e6e6;
  --avatar-text: #222;
  --chk-bg: #fff;
  --bar-bg: #2b2b2b;
  --active-cut: #3d3d3d;  /* the flap line cut into the filled envelope icon */
  color-scheme: dark;
}
/* Koňský: hay, saddle leather and a cream paddock fence */
:root[data-theme="horse"] {
  --orange: #8b4a22;
  --orange-hover: #723b19;
  --orange-text: #8b4a22;
  --text: #2b1d12;
  --text-2: #3b2919;
  --text-3: #5b4330;
  --muted: #9b8670;
  --muted-2: #77624d;
  --icon: #8f7457;
  --faint: #c9b79b;
  --line: #ecdfc7;
  --border: #dac7a4;
  --border-strong: #b89c72;
  --bg: #fdf8ee;
  --raised: #fffaf1;
  --hover: #f8efdc;
  --hover-2: #f3e6cc;
  --nav-hover: rgba(139, 74, 34, .07);
  --sb-bg: #f1e2c3;
  --active-bg: #e6cb98;
  --active-text: #5e2e10;
  --active-ic: #8b4a22;
  --sel-bg: #f6e5c4;
  --sel-hover: #efd7aa;
  --card-bg: #f7ecd6;
  --card-hover: #f1e2c3;
  --tb-bg: #f1e4c9;
  --tb-hover: #e8d4ad;
  --tb-text: #5b4330;
  --avatar-bg: #e8d6b4;
  --avatar-text: #4a2f1a;
  --bar-bg: #8b4a22;
}
/* Kočičí: white Maine Coons (Beethoven has blue eyes, Mia one blue and one green) – snowy whites, soft blue-grey, eye-blue accent */
:root[data-theme="cat"] {
  --orange: #3d7cc9;
  --orange-hover: #2f68ad;
  --orange-text: #2f6db8;
  --text: #1d2733;
  --text-2: #27323f;
  --text-3: #4a5768;
  --muted: #8c99aa;
  --muted-2: #657285;
  --icon: #7d8ba0;
  --faint: #bcc6d3;
  --line: #e4eaf2;
  --border: #d3dce8;
  --border-strong: #a9b6c7;
  --bg: #fbfcfe;
  --raised: #fff;
  --hover: #f3f6fb;
  --hover-2: #eaf0f8;
  --nav-hover: rgba(61, 124, 201, .07);
  --sb-bg: #eaf0f8;
  --active-bg: #d4e3f6;
  --active-text: #1f5aa3;
  --active-ic: #3d7cc9;
  --sel-bg: #e6f0fb;
  --sel-hover: #d8e7f8;
  --card-bg: #f1f5fb;
  --card-hover: #e6eef8;
  --tb-bg: #edf2f9;
  --tb-hover: #dfe8f4;
  --tb-text: #4a5768;
  --avatar-bg: #e3ebf6;
  --avatar-text: #27323f;
  --bar-bg: #3d7cc9;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html { zoom: var(--zoom); }
body {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.ic { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.orange { color: var(--orange-text); }
.muted { color: var(--muted); }

/* ------------------------------------------------------------ layout */
.app { display: flex; height: calc(100vh / var(--zoom)); }
.sidebar {
  width: var(--sb-w); flex: none; background: var(--sb-bg);
  display: flex; flex-direction: column; transition: width .15s;
}
.sb-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding-bottom: 16px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.content { flex: 1; overflow-y: auto; padding: 0 24px 40px 24px; }

/* ------------------------------------------------------------ sidebar */
.logo {
  display: block; text-align: center; margin: 22px 0 14px;
  font-family: "Kaushan Script", cursive; font-size: 34px; line-height: 1; white-space: nowrap;
  color: var(--orange); letter-spacing: 1px; text-transform: uppercase;
  transform: skewX(-6deg);
}
.btn-compose {
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 26px; width: 200px; height: 32px; border-radius: 3px;
  background: var(--orange); color: #fff; font-weight: 600; font-size: 15px;
}
.btn-compose:hover { background: var(--orange-hover); }
.only-collapsed { display: none; }
.nav { display: flex; flex-direction: column; padding: 0 20px 0 0; }
.nav-group { margin-top: 26px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; height: 32px;
  padding: 0 12px 0 30px; border-radius: 0 4px 4px 0; color: var(--text-2); font-size: 15px;
  width: 100%; text-align: left; white-space: nowrap;
}
.nav-item .ic { color: var(--icon); width: 20px; height: 20px; }
.nav-item:hover { background: var(--nav-hover); }
.nav-item.active { background: var(--active-bg); color: var(--active-text); }
.nav-item.active .ic { color: var(--active-ic); }
.nav-item.starred .ic { color: #f5a623; }
.nav-item .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-item .count { font-weight: 700; color: var(--text); font-size: 15px; }
.nav-item.sub { padding-left: 55px; }
.nav-item.sub-f { padding-left: 45px; }
.tags-toggle { padding-left: 10px; gap: 8px; }
.tags-toggle .chev { width: 14px; height: 14px; color: var(--icon); transition: transform .15s; }
.tags-group.closed .chev { transform: rotate(180deg); }
.tags-group.closed .tags-list { display: none; }
.tag-ic { color: var(--tag, var(--icon)) !important; }
.add-tag { color: var(--muted-2); font-size: 14px; }
.add-tag .ic { width: 16px; height: 16px; }
.sb-bottom {
  height: 64px; flex: none; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-around; padding: 0 10px;
}
.sb-bottom a, .sb-bottom button { color: var(--icon); padding: 8px; border-radius: 4px; display: flex; }
.sb-bottom a:hover, .sb-bottom button:hover { color: var(--text-3); background: var(--nav-hover); }
.sb-bottom .ic { width: 22px; height: 22px; }

/* collapsed sidebar */
.sb-collapsed { --sb-w: 64px; }
.sb-collapsed .logo { font-size: 22px; margin: 22px 0; overflow: hidden; height: 26px; }
.sb-collapsed .btn-compose { width: 40px; border-radius: 50%; height: 40px; }
.sb-collapsed .btn-compose span { display: none; }
.sb-collapsed .only-collapsed { display: block; }
.sb-collapsed .nav { padding: 0; }
.sb-collapsed .nav-item { padding: 0; justify-content: center; border-radius: 0; position: relative; }
.sb-collapsed .nav-item .lbl, .sb-collapsed .tags-toggle .chev { display: none; }
.sb-collapsed .nav-item .count {
  position: absolute; top: 2px; right: 10px; font-size: 10px; background: var(--orange); color: #fff;
  border-radius: 8px; padding: 0 4px; line-height: 14px;
}
.sb-collapsed .sb-bottom { flex-direction: column; height: auto; padding: 8px 0; gap: 4px; }
.sb-collapsed .sb-bottom [data-collapse] .ic { transform: rotate(180deg); }

/* ------------------------------------------------------------ top bar */
.topbar {
  display: flex; align-items: center; gap: 24px; padding: 16px 24px 0 30px; height: 66px; flex: none;
  position: relative; z-index: 20; /* above the sticky toolbar, so the account menu isn't covered */
}
.search { position: relative; width: 536px; max-width: 100%; }
.search input[type="search"] {
  width: 100%; height: 42px; border: 1px solid var(--border); border-radius: 4px;
  padding: 0 46px 0 12px; font-size: 16px; outline: none; background: var(--bg);
}
.search input[type="search"]::placeholder { color: var(--faint); }
.search input[type="search"]:focus { border-color: var(--border-strong); }
.adv-btn { position: absolute; right: 10px; top: 9px; color: var(--icon); padding: 2px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.debug-badge { background: #e5484d; color: #fff; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 3px; letter-spacing: .5px; }
.top-ic { color: var(--icon); display: flex; }
.top-ic .ic { width: 30px; height: 30px; }
.top-name { color: var(--text-2); font-size: 16px; white-space: nowrap; background: none; border: 0; padding: 0; font-family: inherit; }
.user-dd { align-items: center; gap: 18px; }
button.top-ic { cursor: pointer; }
.notes-dd.open > .top-ic { color: var(--text-3); }

/* "Oznámení" panel behind the envelope icon */
.notes-panel.dd-menu {
  width: 400px; max-height: min(840px, calc(100vh / var(--zoom) - 90px)); padding: 0; overflow: hidden; display: none;
  flex-direction: column; border-radius: 24px; box-shadow: 0 6px 30px rgba(0,0,0,.18); z-index: 60;
}
.notes-dd.open > .notes-panel { display: flex; }
.notes-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 20px 20px 12px; }
.notes-head h2 { margin: 0; font-size: 21px; font-weight: 700; color: var(--text); }
.notes-panel .notes-head a { display: inline; padding: 0; width: auto; font-size: 16px; color: var(--text); }
.notes-panel .notes-head a:hover { background: none; text-decoration: underline; }
.notes-list { overflow-y: auto; padding: 0 18px 18px; display: flex; flex-direction: column; gap: 18px; }
.notes-panel .note {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 12px; white-space: normal;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 2px 6px rgba(0,0,0,.12);
  color: var(--text); font-size: 16px; transition: opacity .16s, transform .16s;
}
.notes-panel .note:hover { background: var(--card-hover); }
.note.leaving { opacity: 0; transform: translateX(24px); }
.note-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.note-logo { width: 40px; height: 40px; border-radius: 10px; flex: none; margin-top: 2px; }
.note-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.note-who b { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-who small { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.note-dot { width: 7px; height: 7px; border-radius: 50%; background: #e00; }
.notes-panel .note-x { width: auto; padding: 2px; color: var(--muted); background: none; flex: none; }
.notes-panel .note-x:hover { color: var(--text-2); background: none; }
.notes-panel .note-x .ic { width: 22px; height: 22px; color: inherit; }
.note-subj, .note-prev { overflow: hidden; text-overflow: ellipsis; }
.note-subj { white-space: nowrap; }
.note-prev { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.4; }
.note-empty { color: var(--muted); text-align: center; padding: 24px 0; margin: 0; }

/* ------------------------------------------------------------ avatars */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%; background: var(--avatar-bg);
  font-size: 14px; color: var(--avatar-text); font-weight: 500; letter-spacing: .3px;
}
.avatar-sm { width: 26px; height: 26px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 20px; }
.avatar-xl { width: 60px; height: 60px; font-size: 21px; }
/* the user's own profile picture covers the initials once it loads */
.avatar, .avatar-square { position: relative; overflow: hidden; }
.avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ------------------------------------------------------------ toolbar */
.toolbar {
  display: flex; align-items: center; gap: 20px; padding: 22px 0 16px; position: sticky; top: 0;
  background: var(--bg); z-index: 10; flex-wrap: wrap;
}
.tb-group { display: flex; align-items: stretch; background: var(--tb-bg); border-radius: 4px; }
.tb-group > form { display: flex; }
.tb-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 9px;
  color: var(--tb-text); font-size: 16px; white-space: nowrap; background: var(--tb-bg); border-radius: 4px;
  position: relative;
}
.tb-group > * + * { border-left: 1px solid var(--bg); }
.tb-group > * { border-radius: 0; }
.tb-btn:hover { background: var(--tb-hover); }
.tb-btn .ic { width: 18px; height: 18px; color: var(--icon); }
.tb-dark { color: var(--text); }
.tb-btn.disabled { color: var(--faint); cursor: default; }
.tb-btn.disabled .ic { color: var(--faint); }
.tb-btn.disabled:hover { background: var(--tb-bg); }
.toolbar:not(.msg-toolbar) .need-sel { color: var(--faint); }
.toolbar:not(.msg-toolbar) .need-sel .ic { color: var(--faint); }
.toolbar.has-sel .need-sel { color: var(--text); }
.toolbar.has-sel .need-sel .ic { color: var(--icon); }
.tb-check { padding: 0 2px 0 10px; cursor: pointer; }
.tb-caret { padding: 0 9px 0 6px; }
.caret {
  display: inline-block; width: 0; height: 0; margin-left: 4px;
  border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 4px solid var(--border-strong);
}
/* numbered pager under the list (desktop; the phone loads more on scroll) */
.pager-nav { display: flex; justify-content: center; align-items: center; gap: 14px; padding: 24px 16px 32px; }
.pager-nav .pg {
  min-width: 56px; height: 40px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 10px; background: var(--raised); color: var(--text-3); text-decoration: none;
  transition: background .12s, border-color .12s;
}
.pager-nav a.pg:hover { background: var(--hover-2); border-color: var(--border-strong); }
.pager-nav .pg-arrow .ic { width: 18px; height: 18px; color: var(--icon); }
.pager-nav .pg-arrow.off { opacity: .45; cursor: default; }
.pager-nav .pg-side { min-width: 28px; text-align: center; font-size: 15px; color: var(--muted-2); text-decoration: none; padding: 6px 4px; border-radius: 6px; }
.pager-nav .pg-side:hover { color: var(--orange-text); background: var(--hover-2); }
.pg-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.pg-input {
  width: 64px; height: 44px; box-sizing: border-box; padding: 0; text-align: center; font: inherit; font-size: 18px; font-weight: 700;
  color: var(--orange-text); background: var(--raised); border: 2px solid var(--orange); border-radius: 12px; outline: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12); -moz-appearance: textfield; appearance: textfield; transition: box-shadow .12s;
}
.pg-input::-webkit-outer-spin-button, .pg-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pg-input:focus { box-shadow: 0 0 0 4px var(--sel-hover); }
.pg-of { font-size: 14px; color: var(--muted); white-space: nowrap; }
[data-theme="cat"] .pager-nav .pg, [data-theme="cat"] .pg-input { border-radius: 22px; }
[data-theme="horse"] .pager-nav .pg, [data-theme="horse"] .pg-input { border-radius: 6px; }
[data-theme="horse"] .pager-nav .pg { border-width: 1.5px; }
@media (prefers-reduced-motion: reduce) { .pager-nav .pg { transition: none; } }
@media (max-width: 760px) { .pager-nav { display: none; } }
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin: 0;
  border: 1.5px solid var(--border-strong); border-radius: 4px; background: var(--chk-bg); cursor: pointer; display: inline-grid;
  place-content: center; vertical-align: middle;
}
input[type="checkbox"]:checked, input[type="checkbox"]:indeterminate { background: var(--orange); border-color: var(--orange); }
input[type="checkbox"]:checked::after {
  content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px);
}
input[type="checkbox"]:indeterminate::after { content: ""; width: 10px; height: 2px; background: #fff; }

/* dropdowns */
.dd { position: relative; display: flex; }
.dd-menu {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; min-width: 200px; z-index: 40;
  background: var(--raised); border-radius: 4px; box-shadow: 0 4px 20px rgba(0,0,0,.16); padding: 6px 0;
  max-height: calc(70vh / var(--zoom)); overflow-y: auto;
}
.dd-menu.right { left: auto; right: 0; }
.dd.open > .dd-menu { display: block; }
.dd-menu > a, .dd-menu > button, .dd-menu form button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 16px; text-align: left;
  font-size: 15px; color: var(--text-2); white-space: nowrap;
}
.dd-menu > a:hover, .dd-menu > button:hover, .dd-menu form button:hover { background: var(--hover-2); }
.dd-menu .ic { width: 18px; height: 18px; color: var(--icon); }
.dd-sep { border-top: 1px solid var(--line); margin: 6px 0 2px; padding: 6px 16px 2px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.dd-head { padding: 8px 16px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: flex; flex-direction: column; }
.dd-head span { color: var(--muted); font-size: 13px; }
.user-dd .dd-btn { cursor: pointer; }

/* ------------------------------------------------------------ message list */
.list-title { font-size: 20px; font-weight: 600; margin: 4px 0 12px; }
.mlist { border-top: 0; }
.row {
  display: grid; align-items: center; height: 50px; border-bottom: 1px solid var(--line); cursor: pointer;
  grid-template-columns: 40px 46px minmax(140px, 250px) 34px minmax(0, 1fr) auto; padding-right: 10px;
}
.row:hover { background: var(--hover); }
.row.selected { background: var(--sel-bg); }
.row .cb { display: flex; justify-content: center; align-items: center; height: 100%; cursor: pointer; padding-left: 4px; }
.row .from { display: flex; align-items: center; gap: 6px; min-width: 0; padding-right: 12px; font-size: 16px; }
.from-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cnt { color: var(--muted); font-size: 14px; font-weight: 400; flex: none; }
.draft-lbl { color: #e5484d; font-size: 14px; flex: none; }
.star { color: var(--icon); display: flex; align-items: center; justify-content: center; }
.star .ic { width: 19px; height: 19px; }
.star.on { color: #f5a623; }
.star:hover { color: #f5a623; }
.subj { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; padding-right: 30px; }
.prev { color: var(--muted); }
.row.unread .from-name, .row.unread .subj-text { font-weight: 700; }
.meta { display: flex; align-items: center; gap: 10px; white-space: nowrap; font-size: 16px; }
.meta .ic { width: 20px; height: 20px; color: var(--text-3); transform: rotate(45deg); }
.chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; line-height: 18px;
  padding: 0 7px; border-radius: 9px; margin-right: 6px; vertical-align: 2px;
  color: var(--tag); background: color-mix(in srgb, var(--tag) 13%, var(--bg)); border: 1px solid color-mix(in srgb, var(--tag) 35%, var(--bg));
}
.chip button { color: inherit; font-size: 14px; line-height: 1; opacity: .7; }
.chip button:hover { opacity: 1; }
.empty { text-align: center; color: var(--muted); padding: 80px 0; }
.empty .ic { width: 48px; height: 48px; color: var(--faint); }

/* ------------------------------------------------------------ message view */
.msg-head { display: flex; gap: 10px; padding: 4px 0 12px; border-bottom: 1px solid var(--line); }
.msg-head-main { flex: 1; min-width: 0; }
.msg-subj { font-size: 17px; font-weight: 700; margin: 2px 0 8px; }
.msg-line { font-size: 16px; margin-bottom: 6px; overflow-wrap: anywhere; }
.msg-line .muted { color: var(--icon); }
.msg-line a.orange { margin-left: 6px; }
.msg-tags { margin-top: 8px; }
.msg-head-right { display: flex; align-items: flex-start; gap: 10px; white-space: nowrap; font-size: 16px; padding-top: 2px; }
.msg-head-right .star { margin-top: -1px; }
.msg-body { display: block; width: 100%; border: 0; margin-top: 40px; padding-left: 90px; min-height: 40px; }
/* mail bodies and editors are written for white paper, so they stay white in every theme */
.img-block { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 24px 0 -24px; padding: 10px 14px; background: var(--hover); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--text-2); }
.msg-body, .editor { background: #fff; background-clip: content-box; color-scheme: light; }
.msg-section { margin-top: 44px; }
.sec-title { font-size: 19px; font-weight: 600; color: var(--icon); margin: 0 0 4px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.quick-reply { display: flex; gap: 30px; padding-top: 20px; }
.qr-main { flex: 1; min-width: 0; padding-right: 40px; }
.qr-to { font-size: 16px; margin: 2px 0 8px; overflow-wrap: anywhere; }
.quick-reply textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 3px; padding: 10px; font-size: 15px; resize: vertical; min-height: 120px; outline: none;
}
.quick-reply textarea:focus { border-color: var(--border-strong); }
.qr-actions { display: flex; gap: 20px; margin-top: 22px; }
.qr-btn:disabled { color: var(--faint); cursor: default; }
.qr-btn:disabled .ic { color: var(--faint); }
.qr-btn:disabled:hover { background: var(--tb-bg); }
.qr-send:not(:disabled) { color: var(--text); font-weight: 600; }
.qr-send { font-weight: 600; }
.conv-row {
  display: grid; grid-template-columns: minmax(140px, 260px) 34px minmax(0, 1fr) auto; align-items: center;
  height: 50px; border-bottom: 1px solid var(--line); padding: 0 10px 0 14px; font-size: 16px;
}
.conv-row:hover { background: var(--hover); }
.conv-row.current { background: var(--sel-bg); }
.conv-row.unread .c-from, .conv-row.unread .c-subj-text { font-weight: 700; }
.c-from, .c-subj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-from { padding-right: 12px; }
.c-subj { padding-right: 30px; }
.c-date { white-space: nowrap; }
.folder-badge {
  display: inline-block; border: 1px solid var(--border); border-radius: 3px; padding: 0 9px; margin-right: 6px;
  font-size: 14px; font-weight: 600; line-height: 24px; vertical-align: 1px;
}
.msg-bottom { display: inline-flex; margin-top: 70px; }
.dd-menu.up { top: auto; bottom: calc(100% + 4px); }
@media print {
  .sidebar, .topbar, .toolbar, .msg-section, .msg-bottom, .toast { display: none !important; }
  .app, .main, .content { display: block; height: auto; overflow: visible; }
  .msg-body { padding-left: 0; }
}
.goto-atts { position: absolute; right: 0; top: 46px; font-size: 16px; }
.msg-head-right { position: relative; }
.atts-section { margin-top: 20px; }
.att { display: flex; gap: 18px; padding: 18px 0 6px 4px; font-size: 16px; }
.att-thumb { width: 48px; height: 62px; object-fit: cover; flex: none; border: 1px solid var(--border); background: var(--bg); }
img.att-thumb { width: 72px; height: 72px; object-fit: contain; border: 0; background: none; }
.att-file { display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; position: relative;
  background: repeating-linear-gradient(var(--bg) 0 6px, var(--line) 6px 7px) 8px 10px / 30px 32px no-repeat, var(--bg); }
.att-file span { font-size: 9px; font-weight: 700; color: #fff; background: #e5484d; padding: 1px 4px; border-radius: 2px; }
.att-info { min-width: 0; padding-top: 4px; }
.att-name { overflow-wrap: anywhere; }
.att-links { display: flex; gap: 20px; margin-top: 10px; }
.att-dl { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.att-dl .ic { width: 18px; height: 18px; }

/* ------------------------------------------------------------ compose (slide-over panel) */
.overlay-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.12); z-index: 50; }
.compose {
  position: fixed; top: 0; right: 0; bottom: 0; left: 400px; z-index: 51; background: var(--bg);
  box-shadow: -6px 0 24px rgba(0,0,0,.1); display: flex; flex-direction: column; padding: 0 52px 24px 60px;
}
.cmp-winbtns { position: absolute; top: 0; right: 52px; display: flex; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 4px 4px; }
.cmp-winbtns button { width: 56px; height: 36px; display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.cmp-winbtns button + button { border-left: 1px solid var(--border); }
.cmp-winbtns button:hover { background: var(--hover-2); }
.win-min span { width: 12px; border-bottom: 2px solid var(--text-2); margin-top: 8px; }
.cmp-head { display: flex; gap: 30px; padding-top: 36px; }
.cmp-fields { flex: 1; min-width: 0; }
.cmp-from { display: flex; align-items: baseline; gap: 10px; padding: 4px 0 10px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.cmp-from-name { font-size: 22px; }
.cmp-from .orange { font-size: 16px; }
.cmp-row { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); height: 51px; }
.cmp-row label { color: var(--icon); font-size: 16px; min-width: 52px; }
.cmp-row input { flex: 1; border: 0; outline: none; height: 100%; font-size: 16px; background: transparent; }
.cmp-row input::placeholder { color: var(--icon); }
.link-orange { color: var(--orange-text); font-size: 16px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.link-orange .ic { width: 18px; height: 18px; color: var(--icon); transform: rotate(45deg); }
.cmp-toolbar { display: flex; align-items: center; gap: 16px; margin: 34px 0 12px; flex-wrap: wrap; }
.cmp-toolbar .tb-btn.ed { min-width: 56px; justify-content: center; color: var(--text); font-weight: 500; }
.cmp-toolbar .tb-btn .ic { color: var(--text); width: 18px; height: 18px; stroke-width: 2.2; }
.cmp-toolbar .attach-link { margin-left: auto; }
.abc span:nth-child(1) { color: #e5484d; } .abc span:nth-child(2) { color: #30a46c; } .abc span:nth-child(3) { color: #3e63dd; }
.ol-ic, .align-ic, .emoji-ic, .rf-ic { font-size: 18px; font-weight: 700; line-height: 1; }
.img-ic { width: 16px; height: 14px; border: 2px solid var(--text); border-radius: 2px; position: relative; }
.img-ic::after { content: ""; position: absolute; left: 2px; bottom: 1px; border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 5px solid var(--text); }
.dd-menu.colors { min-width: 0; display: none; grid-template-columns: repeat(4, 26px); gap: 6px; padding: 10px; }
.dd.open > .dd-menu.colors { display: grid; }
.dd-menu.colors button { width: 26px; height: 26px; padding: 0; border-radius: 4px; }
.dd-menu.emojis { min-width: 0; grid-template-columns: repeat(4, 40px); padding: 6px; }
.dd.open > .dd-menu.emojis { display: grid; }
.dd-menu.emojis button { padding: 6px; font-size: 20px; justify-content: center; }
.editor-wrap { flex: 1; min-height: 160px; border: 1px solid var(--border); border-radius: 3px; display: flex; }
.editor { flex: 1; border: 0; width: 100%; }
.cmp-atts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.cmp-atts:empty { display: none; }
.att-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--tb-bg); border-radius: 4px; padding: 5px 10px; font-size: 14px; }
.att-chip small { color: var(--muted); }
.att-chip input { width: 16px; height: 16px; }
.cmp-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 30px; }
.chk { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; cursor: pointer; }
.cmp-actions { display: flex; gap: 20px; }
.cmp-actions .tb-btn .ic { color: var(--icon); }
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 16px;
  background: var(--orange); color: #fff; border-radius: 3px; font-weight: 600; font-size: 16px;
}
.btn-primary:hover { background: var(--orange-hover); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

/* ------------------------------------------------------------ settings */
.btn-back {
  display: block; width: 180px; margin: 0 auto 36px; text-align: center; height: 38px; line-height: 36px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 3px; font-size: 16px; color: var(--text-2);
}
.btn-back:hover { border-color: var(--border-strong); }
.set-nav .nav-item { position: relative; }
.set-nav .nav-item.current { font-weight: 700; }
.set-nav .nav-item.current::before {
  content: ""; position: absolute; left: 0; border-left: 8px solid var(--text-2); border-top: 9px solid transparent; border-bottom: 9px solid transparent;
}
.set-top { text-align: right; padding: 14px 28px 0; font-size: 16px; color: var(--text-2); flex: none; }
.set-content { padding: 0 44px 40px; max-width: 1290px; }
.set-title { font-size: 30px; font-weight: 400; margin: 10px 0 30px; }
.set-h2 { font-size: 19px; font-weight: 600; margin: 0 0 18px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.set-photo { display: flex; gap: 20px; margin-bottom: 26px; }
.set-photo p { margin: 8px 0; font-size: 16px; }
.avatar-square { width: 80px; height: 80px; background: var(--avatar-bg); display: flex; align-items: center; justify-content: center; font-size: 32px; flex: none; }
.set-grid { display: grid; grid-template-columns: 125px 1fr; row-gap: 20px; align-items: start; font-size: 16px; }
.set-grid > label { padding-top: 10px; }
.set-grid > div { min-width: 0; }
.set-input { width: 480px; max-width: 100%; height: 40px; border: 1px solid var(--border); border-radius: 3px; padding: 0 10px; background: var(--bg); }
.undo-head { margin-top: 36px; }
.undo-warn { max-width: 560px; }
/* Automatická odpověď */
.autoreply { max-width: 640px; }
.ar-card {
  display: flex; flex-direction: column; gap: 22px; padding: 24px; background: var(--raised);
  border: 1px solid var(--border); border-radius: 10px;
}
.ar-head { display: flex; align-items: center; gap: 14px; }
.ar-badge {
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none;
  border-radius: 12px; background: var(--active-bg); color: var(--orange-text);
}
.ar-badge .ic { width: 22px; height: 22px; }
.ar-head-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ar-head-text strong { font-size: 17px; font-weight: 600; }
.ar-head-text span { font-size: 14px; color: var(--muted-2); }
.ar-state {
  display: none; flex: none; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--hover-2); color: var(--muted-2);
}
.ar-state-on, .ar-state-sched { background: var(--sel-bg); color: var(--orange-text); }
.autoreply:has(input[value="disabled"]:checked) .ar-state-disabled,
.autoreply:has(input[value="alwaysEnabled"]:checked) .ar-state-on,
.autoreply:has(input[value="scheduled"]:checked) .ar-state-sched { display: inline-block; }

.ar-seg { display: flex; gap: 4px; padding: 4px; background: var(--hover-2); border-radius: 10px; }
.ar-seg label { flex: 1; position: relative; cursor: pointer; }
.ar-seg input { position: absolute; opacity: 0; pointer-events: none; }
.ar-seg span {
  display: block; padding: 9px 10px; border: 1px solid transparent; border-radius: 7px; text-align: center;
  font-size: 15px; color: var(--text-3); transition: background .15s, color .15s;
}
.ar-seg label:hover span { color: var(--text); }
.ar-seg input:checked + span {
  background: var(--raised); border-color: var(--border); color: var(--orange-text); font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}
.ar-seg input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }

.ar-when { display: none; grid-template-columns: 1fr 1fr; gap: 14px; animation: drop-in .2s ease-out; }
.autoreply:has(input[value="scheduled"]:checked) .ar-when { display: grid; }
.ar-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ar-label { font-size: 14px; font-weight: 600; color: var(--text-3); }
.ar-input {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); font: inherit; font-size: 15px;
}
.ar-input:hover { border-color: var(--border-strong); }
.ar-input:focus { outline: 2px solid var(--orange); outline-offset: -1px; border-color: var(--orange); }
.ar-text { height: auto; min-height: 130px; padding: 11px 12px; line-height: 1.45; resize: vertical; }
.ar-input::placeholder { color: var(--faint); }

.ar-switch { display: flex; align-items: center; gap: 16px; padding-top: 18px; border-top: 1px solid var(--line); cursor: pointer; }
.ar-switch-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.ar-switch-text strong { font-size: 15px; font-weight: 600; }
.ar-switch-text span { font-size: 14px; color: var(--muted-2); }
.ar-switch input { position: absolute; opacity: 0; pointer-events: none; }
.ar-track {
  position: relative; flex: none; width: 46px; height: 26px; border-radius: 999px; background: var(--border-strong);
  transition: background .2s;
}
.ar-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s;
}
.ar-switch input:checked ~ .ar-track { background: var(--orange); }
.ar-switch input:checked ~ .ar-track::after { transform: translateX(20px); }
.ar-switch input:focus-visible ~ .ar-track { outline: 2px solid var(--orange); outline-offset: 2px; }
.ar-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.ar-actions .btn-primary { min-width: 160px; }
@media (max-width: 760px) {
  .ar-card { padding: 18px 16px; gap: 18px; }
  .ar-state { display: none !important; }
  .ar-when { grid-template-columns: 1fr; }
  .ar-seg span { padding: 9px 4px; font-size: 14px; }
  .ar-actions .btn-primary { width: 100%; }
}
.set-input:disabled { color: var(--text-3); background: var(--hover); }
.sig-toolbar { margin: 18px 0 10px; }
.sig-editor { width: 875px; max-width: 100%; height: 400px; flex: none; }
.set-save { margin-top: 18px; font-weight: 600; color: var(--text-2); }
.settings { max-width: 720px; padding-top: 24px; }
.tag-new { display: flex; gap: 10px; margin: 18px 0 26px; }
.tag-new input, .tag-new select, .tag-row select {
  height: 40px; border: 1px solid var(--border); border-radius: 4px; padding: 0 10px; background: var(--bg);
}
.tag-new input { flex: 1; }
.tag-new .set-save { margin-top: 0; height: 40px; }
.tag-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tag-name { flex: 1; font-size: 16px; }
form.inline { display: flex; }

/* ------------------------------------------------------------ toast */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 100;
  background: #333; color: #fff; padding: 12px 22px; border-radius: 4px; font-size: 15px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2); transition: opacity .3s;
}
.toast.hide { opacity: 0; pointer-events: none; }

/* ------------------------------------------------------------ login */
.login-body { display: flex; align-items: center; justify-content: center; background: var(--sb-bg); min-height: calc(100vh / var(--zoom)); padding: 16px; }
.login-card {
  background: var(--raised); border-radius: 8px; box-shadow: 0 6px 30px rgba(0,0,0,.08); padding: 36px 40px 30px;
  width: 400px; max-width: 100%; display: flex; flex-direction: column; gap: 14px;
}
.login-card .logo { margin: 0 0 6px; }
.login-card h1 { font-size: 22px; font-weight: 600; margin: 0 0 6px; text-align: center; }
.login-card input {
  height: 44px; border: 1px solid var(--border); border-radius: 4px; padding: 0 12px; font-size: 16px; outline: none;
}
.login-card input:focus { border-color: var(--border-strong); }
.login-card .btn-primary { height: 44px; }
.login-note { color: var(--muted); font-size: 13px; text-align: center; margin: 4px 0 0; }
.login-error { background: #fdecea; color: #b42318; border-radius: 4px; padding: 10px 12px; font-size: 14px; overflow-wrap: anywhere; }
.login-back { text-align: center; color: var(--orange-text); font-size: 15px; }
.login-back:hover { text-decoration: underline; }

/* ------------------------------------------------------------ accounts: avatar menu and Správa účtů */
:root { --acc-card: color-mix(in srgb, var(--text) 4.5%, var(--raised)); --acc-hover: color-mix(in srgb, var(--text) 9%, var(--raised)); }
.user-btn { cursor: pointer; transition: background .15s, color .15s; }
.user-btn .user-x { display: none; position: absolute; inset: 0; margin: auto; width: 26px; height: 26px; color: var(--text-3); }
.user-dd.open > .user-btn { color: transparent; background: var(--acc-card); }
.user-dd.open > .user-btn .avatar-img { display: none; }
.user-dd.open > .user-btn .user-x { display: block; }
.acc-menu.dd-menu {
  display: none; flex-direction: column; gap: 20px; width: 400px; max-width: calc(100vw - 24px); padding: 20px;
  top: calc(100% + 10px); border-radius: 20px; box-shadow: 0 6px 30px rgba(0,0,0,.18); z-index: 60;
  max-height: calc(100vh / var(--zoom) - 90px);
}
.user-dd.open > .acc-menu { display: flex; }
.acc-card { background: var(--acc-card); border-radius: 16px; padding: 8px 0; overflow: hidden; flex: none; }
.acc-me { display: flex; align-items: center; gap: 18px; padding: 18px 20px 12px; }
.acc-av { width: 48px; height: 48px; font-size: 19px; box-shadow: 0 0 0 1px var(--border); }
.acc-who { display: flex; flex-direction: column; gap: 4px; min-width: 0; text-align: left; }
.acc-who b, .acc-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-who b { font-size: 18px; font-weight: 700; color: var(--text); }
.acc-who span { font-size: 14px; color: var(--text-2); }
.acc-menu .acc-card a, .acc-menu .acc-card button {
  display: flex; align-items: center; gap: 30px; width: 100%; min-height: 56px; padding: 0 20px 0 30px;
  font-size: 17px; color: var(--text); white-space: nowrap; background: none; border-radius: 0;
}
.acc-menu .acc-card a:hover, .acc-menu .acc-card button:hover { background: var(--acc-hover); }
.acc-menu .ic { width: 22px; height: 22px; color: var(--text); flex: none; }
.acc-menu .acc-card .acc-row { gap: 18px; padding: 10px 20px; }
.acc-row .acc-av { width: 40px; height: 40px; font-size: 16px; }
.acc-row .acc-who b { font-size: 17px; }
.acc-chev { margin-left: auto; transition: transform .2s; }
.acc-more.open .acc-chev { transform: rotate(90deg); }
.acc-list { display: none; }
.acc-more.open .acc-list { display: block; }

.acc-page-body { background: var(--bg); }
.acc-page {
  width: 440px; max-width: 100%; margin: 0 auto; padding: 36px 16px 48px;
  display: flex; flex-direction: column; gap: 12px; min-height: calc(100vh / var(--zoom));
}
.acc-page .logo { margin: 0 0 30px; font-size: 38px; }
.acc-page h1 { text-align: center; font-size: 30px; font-weight: 700; color: var(--text); margin: 0 0 22px; }
.acc-tile { display: flex; align-items: center; background: var(--acc-card); border-radius: 26px; min-height: 108px; transition: background .15s; }
.acc-tile:hover { background: var(--acc-hover); }
.acc-page > .acc-tile { flex: none; }
.acc-tile > form:first-child { flex: 1; min-width: 0; display: flex; align-self: stretch; }
.acc-tile-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 22px; padding: 0 12px 0 30px;
  align-self: stretch; text-align: left; color: var(--text); font-size: 17px; cursor: pointer;
}
.acc-tile-main > .ic { width: 26px; height: 26px; color: var(--text-3); margin: 0 17px 0 16px; flex: none; }
.acc-tile-main b { font-weight: 700; }
.acc-tile-av { width: 60px; height: 60px; font-size: 22px; }
.acc-tile-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.acc-tile-text b { font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-tile-text small { font-size: 14px; color: var(--muted-2); }
.acc-tile.current .acc-tile-av { background: var(--orange); color: #fff; }
.acc-del { display: flex; padding: 12px; margin-right: 26px; border-radius: 50%; color: var(--icon); cursor: pointer; }
.acc-del:hover { color: #e5484d; background: var(--raised); }
.acc-del .ic { width: 22px; height: 22px; }
.acc-back { text-align: center; color: var(--orange-text); font-weight: 600; font-size: 17px; margin-top: 18px; }
.acc-back:hover { text-decoration: underline; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .compose { left: 0; padding: 0 20px 20px; }
  .cmp-winbtns { right: 20px; }
  .top-name { display: none; }
  .row { grid-template-columns: 36px 40px minmax(110px, 180px) 30px minmax(0, 1fr) auto; }
}
/* ------------------------------------------------------------ animations */
@view-transition { navigation: auto; }               /* smooth cross-fade between pages (Chromium) */
.sidebar { view-transition-name: sidebar; }
.topbar { view-transition-name: topbar; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes row-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes slide-in-right { from { transform: translateX(60px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slide-out-right { to { transform: translateX(60px); opacity: 0; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.45) rotate(-12deg); } 100% { transform: scale(1); } }
@keyframes check-in { from { transform: rotate(45deg) translate(-1px, -1px) scale(0); } to { transform: rotate(45deg) translate(-1px, -1px) scale(1); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* menus and panels */
.dd.open > .dd-menu { animation: drop-in .14s ease-out; transform-origin: top left; }
.dd.open > .dd-menu.right { transform-origin: top right; }
.dd.open > .dd-menu.up { animation-name: rise-in; transform-origin: bottom left; }
.caret { transition: transform .15s; }
.dd.open > .dd-btn .caret { transform: rotate(180deg); }

/* list rows appear with a short stagger */
.row, .conv-row { animation: row-in .22s ease-out backwards; }
.row:nth-child(2), .conv-row:nth-child(2) { animation-delay: .02s; }
.row:nth-child(3), .conv-row:nth-child(3) { animation-delay: .04s; }
.row:nth-child(4), .conv-row:nth-child(4) { animation-delay: .06s; }
.row:nth-child(5) { animation-delay: .08s; }
.row:nth-child(6) { animation-delay: .10s; }
.row:nth-child(7) { animation-delay: .12s; }
.row:nth-child(8) { animation-delay: .14s; }
.row:nth-child(n+9) { animation-delay: .16s; }
.row { transition: background-color .15s, opacity .25s, transform .25s, height .3s ease; }
.row.leaving { opacity: 0; transform: translateX(-24px); pointer-events: none; }
.row.entering { height: 0; opacity: 0; transform: translateY(-10px); overflow: hidden; }
.row.collapsing { height: 0 !important; border-bottom-width: 0; overflow: hidden; transition: height .2s ease, border-width .2s; }

/* hover / press feedback */
.tb-btn, .nav-item, .btn-primary, .btn-compose, .btn-back, .sb-bottom a, .sb-bottom button, .star,
.att, .cmp-winbtns button, .dd-menu > a, .dd-menu > button, .chip, .conv-row {
  transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s, transform .1s;
}
.tb-btn:active, .btn-primary:active, .btn-compose:active, .btn-back:active { transform: scale(.97); }
.btn-compose:hover, .btn-primary:not(:disabled):hover { box-shadow: 0 3px 10px rgba(251, 100, 33, .35); }
.nav-item .ic { transition: color .15s, transform .15s; }
.nav-item:hover .ic { transform: translateX(1px) scale(1.06); }
.star .ic { transition: transform .15s; }
.star:hover .ic { transform: scale(1.15); }
.star.pop .ic { animation: pop .35s ease-out; }
input[type="checkbox"] { transition: background-color .12s, border-color .12s, box-shadow .12s; }
input[type="checkbox"]:hover { box-shadow: 0 0 0 4px rgba(0, 0, 0, .05); }
input[type="checkbox"]:checked::after { animation: check-in .14s ease-out; }
.search input[type="search"] { transition: border-color .15s, box-shadow .15s; }
.search input[type="search"]:focus { box-shadow: 0 0 0 3px rgba(251, 100, 33, .12); border-color: #f0a37f; }
.toolbar .need-sel { transition: color .2s; }
.count { display: inline-block; animation: fade-in .3s; }

/* sidebar: tags collapse smoothly */
.tags-list { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .2s ease, opacity .2s; }
.tags-inner { min-height: 0; overflow: hidden; }
.tags-group.closed .tags-list { display: grid; grid-template-rows: 0fr; opacity: 0; }
.sidebar .lbl { transition: opacity .15s; }

/* compose panel */
.overlay-backdrop { animation: fade-in .2s ease-out; }
.compose { animation: slide-in-right .26s cubic-bezier(.2, .8, .2, 1); }
.compose.closing { animation: slide-out-right .18s ease-in forwards; }
.overlay-backdrop.closing { animation: fade-in .18s reverse forwards; }
.btn-primary.sending { animation: pulse 1s infinite; pointer-events: none; }

/* message view */
.msg-head, .msg-body, .msg-section, .msg-bottom { animation: row-in .25s ease-out backwards; }
.msg-body { animation-delay: .05s; }
.msg-section { animation-delay: .08s; }
.msg-body.loading { opacity: 0; }
.msg-body { transition: opacity .2s; }
.chip { animation: fade-in .2s; }

/* navigation progress bar (see navStart in app.js); the accent token follows the theme */
#nav-bar { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 1000; pointer-events: none; opacity: 0; transition: opacity .2s; }
#nav-bar.on { opacity: 1; }
#nav-bar i { position: absolute; top: 0; bottom: 0; left: 0; width: 40%; background: var(--orange); border-radius: 0 3px 3px 0; animation: nav-run 1.1s ease-in-out infinite; }
@keyframes nav-run { from { left: -40%; } to { left: 100%; } }
[data-theme="horse"] #nav-bar i::after, [data-theme="cat"] #nav-bar i::after {
  position: absolute; right: -4px; top: 3px; font-size: 18px; line-height: 1;
}
[data-theme="horse"] #nav-bar i::after { content: "🐎"; }
[data-theme="cat"] #nav-bar i::after { content: "🐾"; }

/* toast */
.toast { animation: toast-in .25s cubic-bezier(.2, .8, .2, 1); transition: opacity .3s, transform .3s; }
.toast.hide { transform: translate(-50%, 12px); }

/* login card */
.login-card { animation: rise-in .3s ease-out; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  @view-transition { navigation: none; }
}
.tags-group.no-anim .tags-list { transition: none; }
.msg.leaving-msg { opacity: 0; transform: translateX(-20px); transition: opacity .2s, transform .2s; }


/* ------------------------------------------------------------ search */
.search input[type="search"] { padding-right: 76px; }
.search input[type="search"]::-webkit-search-cancel-button { display: none; }
.clear-btn { position: absolute; right: 44px; top: 9px; color: var(--icon); padding: 2px; border-radius: 3px; }
.clear-btn:hover, .adv-btn:hover { color: var(--text-2); background: var(--hover-2); }
.adv-btn { border-radius: 3px; }
body.searching .search input[type="search"] {
  background-image: linear-gradient(90deg, transparent, rgba(251, 100, 33, .12), transparent);
  background-size: 200% 100%; animation: search-shimmer 1s linear infinite;
}
@keyframes search-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.adv-search { margin: 26px 0 10px; animation: row-in .2s ease-out; }
.adv-search .sec-title { margin-bottom: 0; }
.adv-row { display: flex; align-items: center; min-height: 50px; border-bottom: 1px solid var(--border); margin-left: 90px; }
.adv-row > span { width: 90px; margin-left: -90px; color: var(--icon); font-size: 16px; flex: none; }
.adv-row input { flex: 1; height: 49px; border: 0; outline: none; font-size: 16px; background: transparent; padding: 0 2px; }
.adv-row select, .adv-row input[type="date"] {
  flex: none; border: 0; outline: none; font-size: 16px; background: transparent; padding: 6px 12px; cursor: pointer; border-radius: 3px;
}
.adv-row select:hover, .adv-row input[type="date"]:hover { background: var(--hover-2); }
.adv-row:focus-within { border-bottom-color: #f0a37f; }
.adv-buttons { display: flex; gap: 10px; margin: 8px 0 0 90px; }
.adv-buttons .btn-primary { height: 40px; }
.search-empty { padding: 60px 0; }
.search-empty p { font-size: 30px; color: var(--icon); margin: 0 0 6px; }
.search-empty a { font-size: 18px; }
@media (max-width: 760px) {
  .adv-row, .adv-buttons { margin-left: 80px; }
  .adv-row > span { width: 80px; margin-left: -80px; font-size: 14px; }
  .search-empty p { font-size: 20px; }
}
/* ------------------------------------------------------------ mobile (Seznam Email app look) */
.m-bar, .drawer-head, .m-backdrop, .fab, .m-msg-head, .cmp-mbar, .m-from-lbl, .m-cc-toggle,
.m-search-ic, .m-chev, .m-back-index, .m-back-section, .m-only, .m-more { display: none; }

@media (max-width: 760px) {
  :root { --sb-w: 0px; --bar-h: 56px; }
  body { font-size: 16px; }
  .app { height: calc(100dvh / var(--zoom)); }
  .content { padding: 0 0 calc(96px + env(safe-area-inset-bottom)); }

  /* orange app bar */
  .m-bar {
    display: flex; align-items: center; gap: 4px; height: calc(var(--bar-h) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 6px 0; background: var(--bar-bg); color: #fff; flex: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .12); position: relative; z-index: 20;
  }
  .m-ic {
    width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; color: inherit; flex: none; cursor: pointer;
  }
  .m-ic:active { background: rgba(255, 255, 255, .2); }
  .m-ic .ic { width: 24px; height: 24px; }
  .m-title { flex: 1; font-size: 20px; font-weight: 500; padding-left: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-spacer { flex: 1; }
  .m-bar .dd-menu { color: var(--text-2); top: calc(100% - 4px); }

  /* infinite scroll: spinner while the next page loads, a button once the user has scrolled a lot */
  .m-more { display: flex; justify-content: center; align-items: center; min-height: 72px; padding: 14px 16px; }
  .m-spin {
    width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--orange);
    animation: m-spin .8s linear infinite; visibility: hidden;
  }
  .m-more.loading .m-spin { visibility: visible; }
  .m-more-btn {
    display: none; height: 44px; padding: 0 22px; border-radius: 22px; border: 1px solid var(--border);
    background: var(--raised); color: var(--orange); font-size: 16px; font-weight: 500;
  }
  .m-more-btn:active { background: var(--hover); }
  .m-more.manual:not(.loading) .m-spin { display: none; }
  .m-more.manual:not(.loading) .m-more-btn { display: inline-block; }
  .m-end { display: none; color: var(--faint); font-size: 16px; }
  .m-more.end .m-spin, .m-more.end .m-more-btn { display: none !important; }
  .m-more.end .m-end { display: block; }
  @keyframes m-spin { to { transform: rotate(360deg); } }
  @media (prefers-reduced-motion: reduce) { .m-spin { animation-duration: 2.4s; } }

  /* desktop chrome off */
  .topbar, .toolbar:not(.has-sel), .msg-toolbar, .list-title, .sb-bottom, .logo, .btn-compose, .msg-head,
  .msg-bottom, .msg-section.quick, .cmp-winbtns, .cmp-toolbar, .cmp-foot, .cmp-head > .avatar,
  .link-orange[data-show-cc], .goto-atts, .set-top, .debug-badge { display: none !important; }
  .status-body .logo { display: block !important; font-size: 32px; }
  .status-main { padding-top: 48px; }
  .status-main h1 { font-size: 23px; }
  .status-main p, .status-back { font-size: 16px; }
  .status-foot { font-size: 14px; }

  /* drawer */
  .sidebar {
    position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: min(calc(84vw / var(--zoom)), 340px); background: var(--bg);
    transform: translateX(-102%); transition: transform .25s cubic-bezier(.2, .8, .2, 1);
    border-radius: 0 16px 16px 0; box-shadow: none; padding-top: env(safe-area-inset-top);
    view-transition-name: none;
  }
  .drawer-open .sidebar { transform: none; box-shadow: 4px 0 24px rgba(0, 0, 0, .18); }
  .m-backdrop {
    display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .4);
    opacity: 0; pointer-events: none; transition: opacity .25s;
  }
  .drawer-open .m-backdrop { opacity: 1; pointer-events: auto; }
  .drawer-head { display: flex; align-items: center; gap: 16px; padding: 20px 20px 16px; }
  .drawer-email { font-size: 18px; overflow: hidden; text-overflow: ellipsis; }
  a.drawer-head { color: var(--text); }
  .drawer-chev { width: 22px; height: 22px; flex: none; margin-left: auto; color: var(--text-3); }
  .acc-page .logo { display: block !important; font-size: 32px; margin-bottom: 20px; }
  .acc-page { padding-top: 28px; }
  .acc-page h1 { font-size: 25px; margin-bottom: 14px; }
  .acc-tile { min-height: 84px; border-radius: 20px; }
  .acc-tile-main { padding-left: 18px; gap: 16px; }
  .acc-tile-main > .ic { margin: 0 11px 0 12px; }
  .acc-tile-av { width: 48px; height: 48px; font-size: 18px; }
  .acc-tile-text b { font-size: 17px; }
  .acc-del { margin-right: 12px; }
  .nav { padding: 0 8px; }
  .nav.m-only { display: flex; }
  .nav-group { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
  .nav-item { height: 54px; padding: 0 16px; gap: 24px; border-radius: 10px; font-size: 17px; }
  .nav-item .ic { width: 24px; height: 24px; color: var(--text-3); }
  .nav-item.active { background: var(--active-bg); }
  .nav-item.sub, .nav-item.sub-f { padding-left: 16px; }
  .tags-toggle { padding-left: 16px; gap: 24px; }
  .tags-toggle .chev { display: none; }
  .tags-group.closed .tags-list { grid-template-rows: 1fr; opacity: 1; }
  .nav-item.sub:not(.add-tag):not(.sub-f) .lbl {
    flex: none; background: var(--tag); color: #fff; padding: 4px 12px; border-radius: 5px; font-weight: 500;
  }
  .nav-item.sub .tag-ic { color: var(--text-3) !important; }

  /* floating compose button */
  .fab {
    display: flex; align-items: center; justify-content: center; position: fixed; z-index: 30;
    right: 18px; bottom: calc(22px + env(safe-area-inset-bottom)); width: 60px; height: 60px; border-radius: 18px;
    background: var(--orange); color: #fff; box-shadow: 0 6px 16px rgba(251, 100, 33, .45);
    animation: rise-in .3s ease-out;
  }
  .fab:active { transform: scale(.94); }
  .fab .ic { width: 26px; height: 26px; }

  /* mobile search: pill bar replaces the app bar */
  .m-search .m-bar { display: none; }
  .m-search .topbar {
    display: flex !important; height: auto; padding: calc(10px + env(safe-area-inset-top)) 12px 8px; background: var(--bg);
  }
  .m-search .search { width: 100%; }
  .m-search .search input[type="search"] {
    height: 50px; border: 0; border-radius: 25px; background: var(--tb-bg); padding: 0 52px 0 52px; font-size: 18px;
  }
  .m-search .search input[type="search"]:focus { box-shadow: none; }
  .m-search .m-search-ic { display: flex; position: absolute; left: 16px; top: 13px; color: var(--text-3); }
  .m-search .clear-btn { display: flex !important; right: 10px; top: 9px; padding: 6px; border-radius: 50%; }
  .m-search .clear-btn .ic { width: 22px; height: 22px; }
  .m-search .adv-btn, .m-search .top-right { display: none; }

  /* list rows: avatar | name + date / subject / preview + star */
  .mlist { border-top: 0; }
  .row {
    grid-template-columns: 72px minmax(0, 1fr) auto; grid-template-areas: "av from meta" "av subj subj" "av prev star";
    height: auto; padding: 12px 14px 12px 0; align-items: center; row-gap: 1px;
  }
  .row .cb { display: none; }
  .row .avatar { grid-area: av; align-self: center; justify-self: center; width: 46px; height: 46px; font-size: 17px; }
  .row .from { grid-area: from; font-size: 17px; padding-right: 8px; }
  .row .subj { display: contents; }
  .row .subj-line { grid-area: subj; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .row .prev { grid-area: prev; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 12px; }
  .row .prev .dash { display: none; }
  .row .star { grid-area: star; justify-self: end; }
  .row .star .ic { width: 22px; height: 22px; }
  .row .meta { grid-area: meta; font-size: 14px; gap: 6px; }
  .row .meta .ic { width: 17px; height: 17px; }
  .row.unread .date { color: var(--orange-text); font-weight: 600; }
  .row.unread .subj-text { font-weight: 700; }
  .row .folder-badge { display: block; width: fit-content; font-size: 13px; line-height: 20px; margin: 3px 0 2px; color: var(--icon); }
  .row .chip { font-size: 11px; line-height: 16px; padding: 0 6px; }
  .row.selected { background: var(--sel-bg); }
  .row .avatar { cursor: pointer; }
  /* selection mode: every avatar becomes a round checkbox, ticked on the selected rows */
  .mlist.selecting .row .avatar {
    background: transparent; color: transparent; box-shadow: inset 0 0 0 2px var(--faint);
    transition: background .15s, box-shadow .15s;
  }
  .mlist.selecting .row .avatar::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 17px;
    border: solid #fff; border-width: 0 3px 3px 0; transform: translate(-50%, -62%) rotate(45deg) scale(0);
    transition: transform .15s;
  }
  .mlist.selecting .row.selected .avatar { background: var(--orange); box-shadow: none; }
  .mlist.selecting .row.selected .avatar::after { transform: translate(-50%, -62%) rotate(45deg) scale(1); }
  .empty { padding: 60px 16px; }

  /* selection mode bar (long-press a row) */
  .toolbar.has-sel {
    position: fixed; z-index: 25; top: 0; left: 0; right: 0; height: calc(var(--bar-h) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 8px 0; background: var(--bg); box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
    gap: 6px; flex-wrap: nowrap; overflow-x: auto;
  }
  .toolbar.has-sel .tb-group { background: none; }
  .toolbar.has-sel .tb-btn { background: none; font-size: 15px; padding: 0 8px; }
  .toolbar.has-sel .sel-dd, .toolbar.has-sel > .dd { display: none; }
  /* the bar scrolls sideways, which would clip an absolute menu: pin it to the screen instead */
  .toolbar.has-sel .dd-menu {
    position: fixed; top: calc(var(--bar-h) + env(safe-area-inset-top)); right: auto;
    max-height: calc(100vh / var(--zoom) - var(--bar-h) - env(safe-area-inset-top) - 16px); overflow-y: auto;
  }

  /* message view */
  .msg { padding: 0; }
  .m-msg-head { display: block; }
  .m-from-row { display: flex; align-items: center; gap: 16px; padding: 18px 16px; border-bottom: 1px solid var(--line); }
  .m-from-main { flex: 1; min-width: 0; }
  .m-from-addr { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-from-to { font-size: 16px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-more-btn { font-weight: 600; font-size: 16px; letter-spacing: .3px; align-self: flex-start; padding: 4px 0; }
  .m-details { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 15px; display: grid; gap: 6px; overflow-wrap: anywhere; animation: row-in .2s; }
  .m-subj-row { display: flex; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
  .m-subj { font-size: 19px; font-weight: 400; margin: 0 0 4px; }
  .m-subj-row .star .ic { width: 26px; height: 26px; }
  .m-msg-head .msg-tags { padding: 10px 16px 0; }
  .msg-body { margin-top: 16px; padding: 0 12px; }
  .msg-section { margin: 28px 16px 0; }
  .atts-section .sec-title { display: none; }
  .att-links { gap: 18px; }
  .quick-reply .avatar { display: none; }
  .qr-main { padding-right: 0; }
  .conv-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "from date" "subj subj"; height: auto; padding: 10px 4px; row-gap: 2px; }
  .conv-row .c-from { grid-area: from; } .conv-row .c-date { grid-area: date; font-size: 14px; }
  .conv-row .c-subj { grid-area: subj; padding-right: 0; font-size: 15px; } .conv-row .star { display: none; }

  /* compose: full screen */
  .compose { left: 0; padding: 0 0 env(safe-area-inset-bottom); box-shadow: none; }
  .overlay-backdrop { display: none; }
  .cmp-mbar {
    display: flex; align-items: center; gap: 6px; height: calc(64px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 10px 0 6px; box-shadow: 0 2px 6px rgba(0, 0, 0, .1); flex: none;
  }
  .cmp-mbar .m-ic { color: var(--text-3); }
  .m-send {
    width: 52px; height: 52px; border-radius: 50%; background: var(--orange); color: #fff;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 8px rgba(251, 100, 33, .4);
  }
  .m-send .ic { width: 24px; height: 24px; }
  .m-send.sending { animation: pulse 1s infinite; }
  .cmp-head { padding: 0; gap: 0; }
  .cmp-from { padding: 0 16px; height: 58px; align-items: center; border-bottom: 1px solid var(--border); flex-wrap: nowrap; }
  .m-from-lbl { display: inline; color: var(--icon); font-size: 16px; width: 44px; flex: none; }
  .cmp-from-name { display: none; }
  .cmp-from .orange { color: var(--text); font-size: 17px; overflow: hidden; text-overflow: ellipsis; }
  .cmp-row { height: 58px; padding: 0 16px; border-bottom-color: var(--border); }
  .cmp-row label { min-width: 0; width: 70px; }
  .cmp-row .subj-input { padding: 0; font-size: 16px; }
  .m-cc-toggle { display: flex; width: 100%; color: var(--icon); font-size: 16px; text-align: left; }
  .m-cc-toggle[hidden] { display: none; }
  .cmp-atts { padding: 8px 16px 0; margin: 0; }
  .editor-wrap { border: 0; border-radius: 0; margin-top: 4px; }
  .compose.closing { animation-name: slide-out-down; }

  /* settings: index list → section pages */
  .settings-app .m-bar { position: sticky; top: 0; }
  .settings-app .m-back-index, .settings-app .m-back-section { display: none; }
  .set-index .settings-app .m-back-index, .set-section .settings-app .m-back-section { display: inline-flex; }
  .set-index .sidebar {
    position: static; transform: none; width: 100%; box-shadow: none; border-radius: 0; background: var(--bg); padding-top: 0;
  }
  .set-index .app { flex-direction: column; }
  .set-index .main { order: -1; flex: none; overflow: visible; }
  .set-index .set-content { display: none; }
  .set-section .sidebar, .settings-app .btn-back { display: none; }
  .set-nav .nav-item { height: 64px; font-size: 18px; border-radius: 0; }
  .set-nav .nav-item.current { font-weight: 400; }
  .set-nav .nav-item.current::before { display: none; }
  .m-chev { display: block; color: var(--icon); }
  .set-content { padding: 0 16px 40px; }
  .set-title { display: none; }
  .set-grid { grid-template-columns: 1fr; row-gap: 8px; }
  .set-grid > label { padding-top: 12px; color: var(--icon); }
  .sig-editor { height: 260px; }
  .tag-new { flex-wrap: wrap; }
  .tag-row { flex-wrap: wrap; }
}
@keyframes slide-out-down { to { transform: translateY(40px); opacity: 0; } }
.offline-card { align-items: center; text-align: center; }
.offline-card img { border-radius: 16px; }

/* ------------------------------------------------------------ error pages (404, 500, …) */
.status-body {
  display: flex; flex-direction: column; min-height: calc(100vh / var(--zoom)); padding: 0 16px;
  text-align: center; background: var(--bg);
}
.status-body .logo { margin: 14px 0 0; font-size: 38px; }
.status-main { flex: 1; padding-top: 72px; }
.status-main h1 { font-size: 28px; font-weight: 400; color: var(--text-2); margin: 0 0 22px; }
.status-main p { color: var(--icon); font-size: 18px; line-height: 1.65; max-width: 500px; margin: 0 auto; }
.status-main .status-detail { font-size: 14px; margin-top: 12px; overflow-wrap: anywhere; }
.status-main .status-code { color: var(--muted); font-size: 13px; margin-top: 12px; }
.status-back { display: inline-block; margin-top: 44px; color: var(--orange-text); font-size: 18px; }
.status-foot { padding: 24px 0 22px; color: var(--icon); font-size: 16px; line-height: 2; }
.status-foot a, .status-back { color: var(--orange-text); }
.status-foot a:hover, .status-back:hover { text-decoration: underline; }

/* ------------------------------------------------------------ new mail */
.toast.undo { display: flex; align-items: center; gap: 18px; }
.undo-btn {
  background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: #fdb38f; cursor: pointer;
  text-transform: uppercase; letter-spacing: .02em;
}
.undo-btn:hover { text-decoration: underline; }
.toast.link { cursor: pointer; }
.toast.link::after { content: " ›"; color: #fdb38f; }
.new-mail-bar {
  display: block; width: 100%; padding: 10px; margin: 0 0 6px; border-radius: 4px; background: var(--sel-bg);
  color: var(--orange-text); font-weight: 600; text-align: center; animation: drop-in .25s ease-out;
}
.new-mail-bar:hover { background: var(--sel-hover); }
.set-switch { margin: 4px 0 6px; }
.look-sizes, .look-themes { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.look-opt {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px;
  position: relative; width: 108px; height: 96px; padding: 10px 6px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
}
.look-opt:hover { border-color: var(--border-strong); }
.look-opt:has(input:checked) { border: 2px solid var(--orange); background: var(--active-bg); }
.look-opt:has(input:focus-visible) { outline: 2px solid var(--orange); outline-offset: 2px; }
.look-opt input { position: absolute; opacity: 0; pointer-events: none; }
.look-a { font-weight: 600; line-height: 1; }
.look-name { font-size: 14px; text-align: center; }
.look-theme { width: 128px; height: 108px; }
/* little window previews: sidebar + three mail rows */
.look-prev {
  --p-bg: #fff; --p-sb: #f4f3f1; --p-line: #ddd; --p-acc: #fb6421;
  display: grid; grid-template-columns: 26px 1fr; grid-auto-rows: 1fr; gap: 5px 6px; width: 92px; height: 56px; padding: 6px 6px 6px 0;
  border: 1px solid var(--border); border-radius: 4px; background: var(--p-bg); overflow: hidden;
}
.look-prev i { grid-row: span 3; background: var(--p-sb); margin: -6px 0; border-top: 5px solid var(--p-acc); }
.look-prev b { background: var(--p-line); border-radius: 2px; }
.look-prev-dark { --p-bg: #1e1e1e; --p-sb: #2b2b2b; --p-line: #474747; }
.look-prev-auto { background: linear-gradient(135deg, #fff 50%, #1e1e1e 50%); --p-sb: linear-gradient(135deg, #f4f3f1 50%, #2b2b2b 50%); --p-line: #888; }
.look-prev-horse { --p-bg: #fdf8ee; --p-sb: #f1e2c3; --p-line: #dac7a4; --p-acc: #8b4a22; position: relative; }
.look-prev-cat { --p-bg: #fbfcfe; --p-sb: #eaf0f8; --p-line: #d3dce8; --p-acc: #3d7cc9; position: relative; }
.look-prev-cat::after { content: "🐱"; position: absolute; right: 4px; bottom: 2px; font-size: 20px; line-height: 1; }
.look-prev-horse::after { content: "🐎"; position: absolute; right: 4px; bottom: 2px; font-size: 20px; line-height: 1; }
.set-note { font-size: 14px; margin: 4px 0 18px; }
.set-note:empty { display: none; }
@media (max-width: 760px) { .new-mail-bar { border-radius: 0; margin: 0; } }.push-box { border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; max-width: 640px; margin-bottom: 10px; }
.push-state { margin: 0 0 12px; font-size: 15px; }
.push-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.push-actions .btn-primary .ic { width: 18px; height: 18px; }
.push-intro { color: var(--text-3); font-size: 15px; }

/* ------------------------------------------------------------ Koňský motiv: the fun bits */
/* JK Amor's pasture along the bottom of the mail pane; a mask fades the photo itself into the page */
[data-theme="horse"] .main { position: relative; z-index: 0; }
[data-theme="horse"] .main::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; z-index: -1; pointer-events: none;
  aspect-ratio: 1200 / 356; min-height: 240px; max-height: 70%; opacity: .6;
  background: url("horse-bg.jpg") center bottom / cover no-repeat;
  -webkit-mask-image: linear-gradient(transparent, #000 75%); mask-image: linear-gradient(transparent, #000 75%);
}
[data-theme="horse"] .drawer-head {
  background: linear-gradient(rgba(253, 248, 238, .35), rgba(253, 248, 238, .85)), url("horse-bg.jpg") 35% 40% / cover;
}
/* three lucky horseshoes at the foot of the sidebar menu */
[data-theme="horse"] .sb-scroll::after {
  content: "Pro štěstí"; display: block; margin: 34px 0 6px; padding-top: 66px; text-align: center;
  font-family: "Kaushan Script", cursive; font-size: 17px; color: var(--muted-2);
  background: url("horseshoe.svg") 50% 0 / 60px no-repeat,
    url("horseshoe.svg") calc(50% - 58px) 18px / 40px no-repeat,
    url("horseshoe.svg") calc(50% + 58px) 18px / 40px no-repeat;
}
.sb-collapsed[data-theme="horse"] .sb-scroll::after { content: none; }
/* Pedro, one of the JK Amor horses, pinned to the sidebar like a photo */
.horse-card { display: none; }
[data-theme="horse"] .horse-card {
  display: block; width: 150px; margin: 34px auto 0; padding: 8px 8px 4px; background: #fff;
  box-shadow: 0 3px 10px rgba(91, 52, 20, .25); transform: rotate(-3deg);
}
[data-theme="horse"] .horse-card img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; }
[data-theme="horse"] .horse-card figcaption {
  font-family: "Kaushan Script", cursive; font-size: 17px; text-align: center; color: #5b4330; padding-top: 2px;
}
.sb-collapsed[data-theme="horse"] .horse-card { display: none; }
@media (max-width: 760px) { [data-theme="horse"] .horse-card { margin-bottom: 8px; } }
[data-theme="horse"] .logo::after { content: " 🐎"; display: inline-block; transform: skewX(6deg); }
.sb-collapsed[data-theme="horse"] .logo::after { content: none; }
/* stitched leather on the orange (now saddle-brown) buttons and the phone app bar */
[data-theme="horse"] .btn-compose, [data-theme="horse"] .btn-primary, [data-theme="horse"] .fab {
  outline: 1px dashed rgba(255, 255, 255, .5); outline-offset: -4px;
}
[data-theme="horse"] .m-bar::after {
  content: ""; position: absolute; left: 6px; right: 6px; bottom: 4px; border-bottom: 1px dashed rgba(255, 255, 255, .45);
}
[data-theme="horse"] .empty .ic { display: none; }
[data-theme="horse"] .empty::before { content: "🐴"; display: block; font-size: 56px; margin-bottom: 8px; animation: trot 1.2s ease-in-out infinite; }
@keyframes trot { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-6px) rotate(-4deg); } 75% { transform: translateY(-3px) rotate(3deg); } }

/* ------------------------------------------------------------ Kočičí motiv */
/* Beethoven or Mia (picked per page load) peeks over the bottom of the mail pane and blinks now and then */
[data-theme="cat"] .main { position: relative; z-index: 0; }
[data-theme="cat"] .main::before {
  content: ""; position: absolute; right: 48px; bottom: 0; z-index: -1; pointer-events: none;
  width: 190px; aspect-ratio: 200 / 170; background: url("cat-peek-beethoven.svg") center bottom / contain no-repeat;
}
[data-theme="cat"] [data-cat="mia"] .main::before { background-image: url("cat-peek-mia.svg"); }
/* a little trail of paw prints at the foot of the sidebar menu */
[data-theme="cat"] .sb-scroll::after {
  content: "Mňau"; display: block; margin: 24px 0 6px; padding-top: 64px; text-align: center;
  font-family: "Kaushan Script", cursive; font-size: 17px; color: var(--muted-2);
  background: url("paw.svg") calc(50% - 48px) 40px / 20px no-repeat, url("paw.svg") calc(50% - 16px) 22px / 20px no-repeat,
    url("paw.svg") calc(50% + 16px) 36px / 20px no-repeat, url("paw.svg") calc(50% + 48px) 16px / 20px no-repeat;
}
.sb-collapsed[data-theme="cat"] .sb-scroll::after { content: none; }
[data-theme="cat"] .logo::after { content: " 🐈"; display: inline-block; transform: skewX(6deg); }
.sb-collapsed[data-theme="cat"] .logo::after { content: none; }
[data-theme="cat"] .btn-compose, [data-theme="cat"] .btn-primary { border-radius: 16px; }
[data-theme="cat"] .fab { border-radius: 50%; }
[data-theme="cat"] .empty .ic { display: none; }
[data-theme="cat"] .empty::before { content: "🐱"; display: block; font-size: 56px; margin-bottom: 8px; animation: purr .9s ease-in-out infinite; }
@keyframes purr { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06, .96); } }
.cat-card { display: none; }
[data-theme="cat"] .cat-card {
  display: block; width: 150px; margin: 34px auto 0; padding: 8px 8px 4px; background: #fff;
  border-radius: 6px; box-shadow: 0 3px 10px rgba(29, 39, 51, .18); transform: rotate(2deg);
}
[data-theme="cat"] .cat-card img { display: block; width: 100%; height: auto; border-radius: 3px; }
[data-theme="cat"] .cat-card figcaption {
  font-family: "Kaushan Script", cursive; font-size: 17px; text-align: center; color: var(--text-3); padding-top: 2px;
}
.sb-collapsed[data-theme="cat"] .cat-card { display: none; }
@media (max-width: 760px) {
  [data-theme="cat"] .cat-card { margin-bottom: 8px; }
  [data-theme="cat"] .main::before { right: 50%; transform: translateX(50%); width: 150px; }
}

/* ------------------------------------------------------------ Vlastní motivy (theme.js) */
/* Colours come from tokens that theme.js writes into #custom-theme-css; the classes on <html> switch the extras on. */
[data-theme="custom"] body { font-family: var(--ct-font); }
[data-theme="custom"] .btn-compose, [data-theme="custom"] .btn-primary, [data-theme="custom"] .tb-btn { border-radius: var(--ct-radius); }
[data-theme="custom"] .fab { border-radius: 50%; }
.ct-bg .main { position: relative; z-index: 0; }
.ct-bg .main::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--ct-bg-img) center / cover no-repeat; opacity: var(--ct-bg-op);
}
.ct-sb .sidebar {
  background-image: linear-gradient(color-mix(in srgb, var(--sb-bg) 55%, transparent), color-mix(in srgb, var(--sb-bg) 55%, transparent)), var(--ct-sb-img);
  background-size: cover; background-position: center;
}
.ct-logo .logo { font-size: 0; height: 52px; transform: none; background: var(--ct-logo-img) center / contain no-repeat; }
.ct-emoji .logo::after { content: " " var(--ct-emoji); display: inline-block; }
.sb-collapsed.ct-emoji .logo::after { content: none; }
.ct-emoji .empty .ic { display: none; }
.ct-emoji .empty::before { content: var(--ct-emoji); display: block; font-size: 56px; margin-bottom: 8px; }
.ct-m-pulse .btn-compose { animation: ct-pulse 2.2s ease-in-out infinite; }
.ct-m-bounce .empty .ic { display: inline-block; }
.ct-m-bounce .empty .ic, .ct-m-bounce .empty::before { animation: ct-bounce 1.1s ease-in-out infinite; }
.ct-m-shimmer .sidebar {
  background-image: linear-gradient(120deg, var(--sb-bg), color-mix(in srgb, var(--orange) 16%, var(--sb-bg)), var(--sb-bg));
  background-size: 300% 300%; animation: ct-shimmer 10s ease infinite;
}
@keyframes ct-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes ct-bounce { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-10px); } }
@keyframes ct-shimmer { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
/* falling / rising symbols, drawn over everything but never in the way of clicks */
#ct-fx { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 5; }
#ct-fx span { position: absolute; color: var(--orange); opacity: .5; animation: linear infinite; }
#ct-fx.ct-fall span { top: -40px; animation-name: ct-fall; }
#ct-fx.ct-rise span { bottom: -40px; animation-name: ct-rise; }
@keyframes ct-fall { from { transform: translateY(0) rotate(0); } to { transform: translateY(calc(100vh + 80px)) rotate(240deg); } }
@keyframes ct-rise { from { transform: translateY(0) rotate(0); } to { transform: translateY(calc(-100vh - 80px)) rotate(-240deg); } }
@media (prefers-reduced-motion: reduce) {
  #ct-fx { display: none; }
  .ct-m-pulse .btn-compose, .ct-m-bounce .empty .ic, .ct-m-bounce .empty::before, .ct-m-shimmer .sidebar { animation: none; }
}
/* "‹ Zpět do NelaMailu" in Nastavení: the light theme keeps Seznam's plain button, the others get styled ones */
[data-theme="dark"] .btn-back {
  background: var(--raised); border-color: var(--orange); color: var(--orange-text); font-weight: 600;
  transition: background .15s, color .15s;
}
[data-theme="dark"] .btn-back:hover { background: var(--active-bg); border-color: var(--orange); color: var(--active-text); }
[data-theme="horse"] .btn-back, [data-theme="cat"] .btn-back, [data-theme="custom"] .btn-back {
  background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 600;
  transition: background .15s, border-color .15s, transform .15s;
}
[data-theme="horse"] .btn-back:hover, [data-theme="cat"] .btn-back:hover, [data-theme="custom"] .btn-back:hover {
  background: var(--orange-hover); border-color: var(--orange-hover);
}
[data-theme="horse"] .btn-back { outline: 1px dashed rgba(255, 255, 255, .5); outline-offset: -4px; }
[data-theme="cat"] .btn-back { border-radius: 19px; }
[data-theme="custom"] .btn-back { border-radius: var(--ct-radius); }
/* the editor in Nastavení → Vzhled */
.ct-tile { position: relative; font: inherit; color: inherit; background: none; }
.ct-add { border-style: dashed; justify-content: center; }
.ct-plus { font-size: 34px; line-height: 1; color: var(--orange); }
.ct-edit {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%;
  background: var(--hover-2); color: var(--text-3); cursor: pointer; font-size: 14px; line-height: 1;
}
.ct-edit:hover { background: var(--active-bg); color: var(--orange-text); }
.ct-editor { max-width: 720px; margin: 8px 0 24px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 6px; background: var(--raised); }
.ct-editor [hidden] { display: none !important; }
.ct-grid { display: grid; grid-template-columns: 190px 1fr; gap: 12px 14px; align-items: center; }
.ct-grid > label { font-size: 15px; color: var(--text-3); }
.ct-grid .set-input { width: 100%; max-width: 360px; }
.ct-grid .ct-short { width: 100px; }
.ct-colors, .ct-file, .ct-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ct-color { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; color: var(--text-3); }
.ct-color input { width: 54px; height: 34px; padding: 0; border: 1px solid var(--border); border-radius: 4px; background: none; cursor: pointer; }
.ct-grid input[type="range"] { max-width: 260px; accent-color: var(--orange); }
.ct-css { height: auto; padding: 8px 10px; font: 13px/1.4 ui-monospace, Consolas, monospace; max-width: 100% !important; }
.ct-actions { margin-top: 6px; }
.ct-actions .set-save { margin-top: 0; }
.ct-del { margin-left: auto; color: #c0392b; }
@media (max-width: 760px) {
  .ct-grid { grid-template-columns: 1fr; gap: 6px; }
  .ct-grid > label { margin-top: 8px; }
}

