/* FONET Workspace – rozloženie v štýle webových klientov (ikonový panel, horná lišta, panely) */
:root {
  --bg: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --surface-3: #e9edf2;
  --hover: #f0f4f9;
  --selected: #e3edfb;
  --border: #dde3ea;
  --text: #1d2532;
  --muted: #6b7686;
  --accent: #1565d8;
  --accent-hover: #0f56bd;
  --accent-soft: #e3edfb;
  --success: #138a5b;
  --danger: #d23f3f;
  --warning: #c27c0e;
  --rail: #12325f;
  --rail-text: #b9c8de;
  --rail-hover: rgba(255, 255, 255, .08);
  --rail-active: rgba(255, 255, 255, .16);
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 2px 6px rgba(16, 24, 40, .08), 0 12px 32px rgba(16, 24, 40, .12);
  --topbar-h: 52px;
  --rail-w: 76px;
  --c0: #1565d8; --c1: #138a5b; --c2: #c2410c; --c3: #7c3aed; --c4: #be185d; --c5: #0e7490;
  color-scheme: light;
}
:root[data-theme="dark"] {
    --bg: #0f141c; --surface: #171d27; --surface-2: #1c2330; --surface-3: #242c3a; --hover: #1f2735; --selected: #1d3150;
    --border: #2a3342; --text: #e3e8f0; --muted: #96a1b2; --accent: #4c8dff; --accent-hover: #6aa0ff; --accent-soft: #1d3150;
    --rail: #0b1422; --rail-text: #93a3bb;
    --shadow: 0 2px 8px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141c; --surface: #171d27; --surface-2: #1c2330; --surface-3: #242c3a; --hover: #1f2735; --selected: #1d3150;
    --border: #2a3342; --text: #e3e8f0; --muted: #96a1b2; --accent: #4c8dff; --accent-hover: #6aa0ff; --accent-soft: #1d3150;
    --rail: #0b1422; --rail-text: #93a3bb;
    --shadow: 0 2px 8px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1 { font-size: 18px; font-weight: 600; margin: 0; }
h2 { font-size: 16px; font-weight: 600; margin: 0; }
h3 { font-size: 11px; font-weight: 600; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
small { font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.grow { flex: 1; min-width: 0; }
.right { text-align: right; }
.row-inline { display: inline-flex; align-items: center; gap: 6px; }
[hidden] { display: none !important; }
.ico { flex: none; display: block; }

/* ---------- ovládacie prvky ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; text-decoration: none; color: var(--text); white-space: nowrap; font-weight: 500;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.on { background: var(--accent-soft); border-color: var(--accent); }
.btn.small { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.wide { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 6px;
  background: transparent; color: var(--muted); cursor: pointer; text-decoration: none; flex: none;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.call { color: var(--success); }
.icon-btn.with-label { display: inline-flex; width: auto; gap: 6px; padding: 0 12px; background: var(--success); color: #fff; font-weight: 500; }
.tb-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: 6px;
  background: transparent; color: var(--text); cursor: pointer; text-decoration: none; font-size: 13px; white-space: nowrap;
}
.tb-btn .ico { color: var(--muted); }
.tb-btn:hover { background: var(--hover); }
.tb-btn:hover .ico { color: var(--accent); }
.tb-btn.danger:hover, .tb-btn.danger:hover .ico { color: var(--danger); }
.link { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=tel], input[type=url], input[type=datetime-local], input[type=date], input[type=time], input[type=number], select, textarea {
  height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); min-width: 0;
}
textarea { height: auto; padding: 8px 10px; width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn:focus-visible, .icon-btn:focus-visible, .tb-btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field > span { font-size: 12px; font-weight: 500; color: var(--muted); }
.field input, .field select { width: 100%; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 3px 0; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > .field { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 2px 1px 10px; margin: 2px 4px 2px 0; font-size: 13px; }
.chip .icon-btn { width: 26px; height: 26px; }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 600; flex: none; font-size: 13px; }
.avatar.small { width: 30px; height: 30px; font-size: 11px; }
.avatar.ucm { background: #dff3ea; color: var(--success); }
.avatar.group { background: var(--surface-3); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); flex: none; }
.dot.c0 { background: var(--c0); } .dot.c1 { background: var(--c1); } .dot.c2 { background: var(--c2); }
.dot.c3 { background: var(--c3); } .dot.c4 { background: var(--c4); } .dot.c5 { background: var(--c5); }
.status-error, .status-busy { background: var(--danger) !important; }
.status-unconfigured, .status-off, .status-offline { background: #98a2b3 !important; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 600; display: inline-grid; place-items: center; line-height: 1; }
.loading-row, .empty { padding: 32px 16px; text-align: center; color: var(--muted); }
.error-box { margin: 12px; padding: 12px 14px; border-radius: 6px; background: #fdecec; color: var(--danger); border: 1px solid #f6caca; }
.error-text { color: var(--danger); min-height: 1.2em; font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.card.wide { grid-column: 1 / -1; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface-2); position: sticky; top: 0; }
.table tbody tr:hover { background: var(--hover); }
.tabs { display: inline-flex; gap: 2px; background: var(--surface-3); padding: 3px; border-radius: 8px; }
.tab { border: 0; background: transparent; border-radius: 6px; padding: 5px 14px; cursor: pointer; color: var(--muted); font-weight: 500; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- prihlásenie ---------- */
#app.loading, #app.login { display: grid; place-items: center; min-height: 100vh; padding: 16px; background: linear-gradient(160deg, var(--rail) 0%, #1d4f8f 100%); }
.splash { color: #fff; opacity: .8; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); padding: 32px; border-radius: 12px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand.big { font-size: 20px; margin-bottom: 6px; }
.logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 800; }

/* ---------- rozloženie ---------- */
#app.shell { display: grid; grid-template-columns: var(--rail-w) 1fr; height: 100vh; overflow: hidden; }
.rail { background: var(--rail); color: var(--rail-text); display: flex; flex-direction: column; align-items: stretch; padding: 10px 6px; gap: 4px; overflow-y: auto; z-index: 40; }
.rail-logo { width: 38px; height: 38px; margin: 2px auto 12px; border-radius: 10px; background: #fff; color: var(--rail); display: grid; place-items: center; font-weight: 800; font-size: 18px; flex: none; }
.rail-items { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.rail-bottom { display: flex; flex-direction: column; gap: 2px; }
.rail-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 7px; border-radius: 8px; color: inherit; text-decoration: none; }
.rail-item:hover { background: var(--rail-hover); color: #fff; }
.rail-item.active { background: var(--rail-active); color: #fff; }
.rail-item.active::before { content: ""; position: absolute; left: -6px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: #fff; }
.rail-label { font-size: 10.5px; font-weight: 500; letter-spacing: .01em; text-align: center; line-height: 1.15; }
.rail-item .badge { position: absolute; top: 3px; right: 9px; box-shadow: 0 0 0 2px var(--rail); }
.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.topbar { height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 14px; padding: 0 16px 0 20px; background: var(--surface); border-bottom: 1px solid var(--border); position: relative; z-index: 30; }
.app-title { min-width: 120px; font-size: 17px; }
.menu-toggle { display: none; }
.search { position: relative; flex: 1; max-width: 640px; margin: 0 auto; }
.search input { width: 100%; height: 36px; padding-left: 36px; border-radius: 18px; background: var(--surface-2); border-color: transparent; }
.search input:focus { background: var(--surface); }
.search-ico { position: absolute; left: 12px; top: 10px; color: var(--muted); pointer-events: none; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 70vh; overflow-y: auto; z-index: 50; padding: 6px; }
.search-results h4 { margin: 8px 8px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sr-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; width: 100%; border: 0; background: none; text-align: left; cursor: pointer; }
.sr-item:hover { background: var(--hover); }
.sr-item b, .sr-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.sr-item small { color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 8px; position: relative; }
.avatar-btn { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }
.avatar-btn:focus-visible { outline: 2px solid var(--accent); }
.user-menu { position: absolute; top: calc(100% + 8px); right: 0; width: 260px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 60; }
.user-menu-head { display: flex; gap: 10px; align-items: center; padding: 8px 8px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-menu-head div { display: flex; flex-direction: column; min-width: 0; }
.user-menu-head small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.menu-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 6px; color: var(--text); text-decoration: none; cursor: pointer; text-align: left; }
.menu-row:hover { background: var(--hover); }
.menu-row .ico { color: var(--muted); }
.view { flex: 1; overflow-y: auto; padding: 0; outline: none; display: flex; flex-direction: column; }
.view > * { flex: none; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; min-height: 54px; }
.view-head h1 { display: none; }
.view-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.view-head .actions input[type=search] { width: 260px; }
.view > :not(.view-head):not(.mail-layout):not(.chat-layout):not(.cal-layout):not(.tk-layout):not(.ct-layout):not(.in-main):not(.dc-layout) { margin: 16px; }

/* ---------- pošta (tri panely) ---------- */
.mail-layout, .chat-layout { flex: 1; display: grid; min-height: 0; background: var(--surface); }
/* pošta – pozri sekciu „Pošta“ na konci súboru */

/* ---------- kalendár ---------- */
.event-desc { white-space: pre-wrap; font: inherit; background: var(--surface-2); padding: 10px; border-radius: 6px; }
.rooms { border: 1px solid var(--border); border-radius: 6px; margin: 0 0 12px; }

/* ---------- kontakty a úlohy ---------- */
.contact-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.contact-card { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-sm); }
.contact-card b, .contact-card > div > small { display: block; }
.contact-lines { margin-top: 8px; }
.task-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.task { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.task:last-child { border-bottom: 0; }
.task:hover { background: var(--hover); }
.task.done b { text-decoration: line-through; color: var(--muted); }
.task input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.task p { margin: 2px 0 0; }
.task.prio-high { box-shadow: inset 3px 0 var(--danger); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prio { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.prio.high { background: #fdecec; color: var(--danger); }
.due { font-size: 13px; color: var(--muted); white-space: nowrap; }
.due.overdue { color: var(--danger); font-weight: 600; }

/* ---------- telefón ---------- */
.phone-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.meeting-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.intro { margin: 0 0 4px; }

/* ---------- chat ---------- */
.chat-layout { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); }
.chat-list { border-right: 1px solid var(--border); overflow-y: auto; background: var(--surface); }
.chat-item { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; border-left: 3px solid transparent; }
.chat-item:hover { background: var(--hover); }
.chat-item.active { background: var(--selected); }
.chat-item.unread { border-left-color: var(--accent); }
.chat-item.unread b { font-weight: 700; }
.chat-item .grow { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.chat-item-top { display: flex; justify-content: space-between; gap: 6px; }
.chat-item-top b { display: inline-flex; align-items: center; gap: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.chat-item-top small, .chat-item .preview { color: var(--muted); }
.chat-item .preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.chat-item.unread .preview { color: var(--text); }
.muted-ico { color: var(--muted); }
.avatar-wrap { position: relative; display: inline-flex; flex: none; }
.presence { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #98a2b3; border: 2px solid var(--surface); }
.presence.available, .presence.on { background: #22a06b; }
.presence.away { background: #e2a400; }
.presence.dnd { background: var(--danger); }
.status-select { font-size: 13px; height: 34px; }
.chat-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.thread-head { display: flex; align-items: center; gap: 4px; padding: 8px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.thread-head .grow { display: flex; flex-direction: column; min-width: 120px; }
.thread-head .back { display: none; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; background: var(--bg); }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 72%; margin-top: 4px; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.bubble { background: var(--surface); border: 1px solid var(--border); padding: 8px 12px; border-radius: 12px 12px 12px 4px; overflow-wrap: anywhere; box-shadow: var(--shadow-sm); }
.msg.mine .bubble { background: var(--accent); border-color: var(--accent); color: #fff; border-radius: 12px 12px 4px 12px; }
.msg.mine .bubble a { color: #fff; }
.msg-text { white-space: pre-wrap; }
.msg-author { color: var(--muted); margin: 0 0 2px 6px; font-weight: 500; }
.msg-time { color: var(--muted); font-size: 11px; margin: 2px 6px 0; }
.msg-system { align-self: center; font-size: 12px; color: var(--muted); padding: 4px 10px; }
.msg-image { display: block; max-width: min(320px, 100%); max-height: 260px; border-radius: 8px; margin-bottom: 4px; }
.msg-file { display: inline-flex; align-items: stretch; max-width: 100%; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.msg-file a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; text-decoration: none; color: var(--text); min-width: 0; }
.msg-file a:hover { color: var(--accent); }
.msg-file small { color: var(--muted); white-space: nowrap; }
.msg-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-file .msg-file-dl { border-left: 1px solid var(--border); padding: 5px 8px; color: var(--muted); }
.msg.mine .msg-file { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .3); }
.msg.mine .msg-file a, .msg.mine .msg-file small { color: #fff; }
.msg.mine .msg-file .msg-file-dl { border-color: rgba(255, 255, 255, .3); }
.msg-caption { margin-top: 4px; }
.msg-image-btn { display: block; border: 0; padding: 0; background: none; cursor: zoom-in; border-radius: 8px; margin-bottom: 4px; }
.msg-image-btn .msg-image { margin: 0; }
.msg-meeting { display: flex; flex-direction: column; gap: 8px; }
.msg.mine .msg-meeting .btn { background: #fff; color: var(--accent); border-color: #fff; }
.day-sep { align-self: center; margin: 12px 0 4px; font-size: 12px; color: var(--muted); }
.day-sep span { background: var(--surface); border: 1px solid var(--border); padding: 2px 12px; border-radius: 999px; }
.older { align-self: center; margin-bottom: 8px; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); background: var(--surface); }
.composer textarea { flex: 1; resize: none; max-height: 160px; min-height: 40px; border-radius: 20px; padding: 9px 14px; }
.people-list { max-height: 50vh; overflow-y: auto; margin: 10px 0; display: flex; flex-direction: column; gap: 2px; }
.person { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.person:hover { background: var(--hover); }
.person .grow { display: flex; flex-direction: column; }
.section-title { margin: 20px 0 10px; }
.meeting-list { display: flex; flex-direction: column; gap: 8px; }
.meeting { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.meeting.ended { opacity: .6; }
.meeting-link { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }

/* ---------- ikona chatu v hornej lište ---------- */
.chat-menu-wrap { position: relative; }
.top-icon { position: relative; display: inline-grid; place-items: center; width: 38px; height: 34px; border-radius: 17px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.top-icon:hover, .top-icon[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.top-badge { position: absolute; top: -6px; right: -6px; box-shadow: 0 0 0 2px var(--surface); }
.chat-menu { position: absolute; top: calc(100% + 8px); right: 0; width: 360px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 60; overflow: hidden; }
.chat-menu-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.link-btn { font-size: 13px; text-decoration: none; }
.chat-menu-list { max-height: 70vh; overflow-y: auto; }
.chat-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; cursor: pointer; color: var(--text); }
.chat-menu-item:last-child { border-bottom: 0; }
.chat-menu-item:hover { background: var(--hover); }
.chat-menu-item .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chat-menu-item b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-menu-item.unread b { font-weight: 700; }
.chat-menu-item .preview { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.chat-menu-item.unread .preview { color: var(--text); }

/* ---------- pripnuté okná chatu (dole) ---------- */
.chat-dock { position: fixed; right: 16px; bottom: 0; display: flex; flex-direction: row-reverse; align-items: flex-end; gap: 10px; z-index: 70; pointer-events: none; }
.cw { pointer-events: auto; width: 320px; height: 440px; max-height: calc(100vh - var(--topbar-h) - 16px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-bottom: 0; border-radius: 10px 10px 0 0; box-shadow: var(--shadow); overflow: hidden; }
.cw.min { height: auto; }
body[data-module="chat"] .chat-dock { display: none; }
.cw.min .cw-thread, .cw.min .cw-composer { display: none; }
.cw-head { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; background: var(--rail); color: #fff; cursor: pointer; min-height: 44px; }
.cw-head .icon-btn { color: rgba(255, 255, 255, .8); width: 28px; height: 28px; }
.cw-head .icon-btn:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.cw-head .presence { border-color: var(--rail); }
.cw-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13px; }
.cw.flash .cw-head { animation: cw-flash 1s ease-in-out infinite alternate; }
@keyframes cw-flash { from { background: var(--rail); } to { background: var(--accent); } }
@media (prefers-reduced-motion: reduce) { .cw.flash .cw-head { animation: none; background: var(--accent); } }
.cw-thread { padding: 10px 12px; }
.cw-thread .msg { max-width: 85%; }
.cw-thread .bubble { padding: 6px 10px; font-size: 13px; }
.cw-thread .msg-image { max-width: 100%; max-height: 160px; }
.cw-composer { padding: 8px; gap: 6px; align-items: center; }
.cw-composer textarea { min-height: 36px; padding: 7px 12px; border-radius: 18px; font-size: 13px; }
.cw-composer .send { color: var(--accent); }

/* ---------- modálne okná a toasty ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 36, .45); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: var(--surface); border-radius: 12px; width: 100%; max-width: 620px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow); }
.modal header, .modal footer { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; gap: 8px; }
.modal header { border-bottom: 1px solid var(--border); }
.modal footer { border-top: 1px solid var(--border); justify-content: flex-end; background: var(--surface-2); border-radius: 0 0 12px 12px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
#toasts { position: fixed; top: calc(var(--topbar-h) + 12px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; width: min(420px, calc(100vw - 32px)); }
.toast { background: #1d2532; color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); }
.toast-error { background: var(--danger); }
.toast-success { background: var(--success); }

/* ---------- responzívne ---------- */
@media (max-width: 1280px) {
  .tb-btn span { display: none; }
}
@media (max-width: 960px) {
  #app.shell { grid-template-columns: 1fr; }
  .rail { position: fixed; inset: 0 auto 0 0; width: var(--rail-w); transform: translateX(-100%); transition: transform .2s; }
  #app.nav-open .rail { transform: none; box-shadow: var(--shadow); }
  .menu-toggle { display: inline-grid; }
  .topbar { padding: 0 10px; gap: 8px; }
  .app-title { min-width: 0; font-size: 16px; }
  .search { max-width: none; }
    .view-head { padding: 8px 12px; }
  .view-head .actions { margin-left: 0; width: 100%; }
  .view-head .actions input[type=search] { flex: 1; width: auto; }
  .view > :not(.view-head):not(.mail-layout):not(.chat-layout):not(.cal-layout) { margin: 12px; }
  .phone-layout { grid-template-columns: 1fr; }
  .contact-list, .cards { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-layout.has-thread .chat-list { display: none; }
  .chat-layout:not(.has-thread) .chat-thread { display: none; }
  .thread-head .back { display: inline-grid; }
  .msg { max-width: 88%; }
  .chat-menu { position: fixed; top: calc(var(--topbar-h) + 4px); left: 8px; right: 8px; width: auto; max-width: none; }
  .chat-dock { right: 8px; left: 8px; }
  .cw { width: 100%; }
}


/* ---------- Pošta: plynulé načítavanie ---------- */
.mail-list { position: relative; }
.mail-list.refreshing::before { content: ''; position: sticky; top: 0; display: block; height: 2px; margin-bottom: -2px; z-index: 2;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%); background-size: 40% 100%;
  background-repeat: no-repeat; animation: ws-progress 1s linear infinite; }
@keyframes ws-progress { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.skeleton { padding: 4px 0; }
.sk-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.sk-row.sk-folder { padding: 8px 10px; }
.sk-circle { width: 32px; height: 32px; border-radius: 50%; flex: none; }
.sk-folder .sk-circle { width: 17px; height: 17px; border-radius: 4px; }
.sk-lines { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.sk-lines span { height: 10px; border-radius: 5px; }
.sk-lines span:first-child { width: 55%; }
.sk-lines span:last-child { width: 85%; }
.sk-folder .sk-lines span:last-child { display: none; }
.sk-circle, .sk-lines span { background: linear-gradient(90deg, var(--hover) 25%, var(--border) 50%, var(--hover) 75%);
  background-size: 200% 100%; animation: ws-shimmer 1.2s ease-in-out infinite; }
@keyframes ws-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.reader-loading { display: grid; place-items: center; padding: 60px 16px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: ws-spin .8s linear infinite; }
@keyframes ws-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .mail-list.refreshing::before, .sk-circle, .sk-lines span, .spinner { animation: none; }
}

/* ====================================================================== Pošta */
.mail-head .icon-btn:first-child { margin-right: -4px; }
.mail-head h1 { display: block; font-size: 17px; }
.mail-search { display: flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 0 2px 0 10px; }
.mail-search .ico { color: var(--muted); }
.mail-search input[type=search] { border: 0; background: transparent; width: 240px; padding-left: 4px; }
.mail-search input[type=search]:focus { outline: none; }
.mail-search:focus-within { border-color: var(--accent); }

.mail-layout { --fold-w: 230px; --list-w: 380px; grid-template-columns: var(--fold-w) var(--list-w) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.mail-layout.no-folders { grid-template-columns: var(--list-w) minmax(0, 1fr); }
.mail-layout.no-folders .mail-folderpane { display: none; }
.mail-layout.pane-bottom { grid-template-columns: var(--fold-w) minmax(0, 1fr); grid-template-rows: var(--list-h, minmax(0, 2fr)) minmax(0, 3fr); }
.mail-layout.pane-bottom.no-folders { grid-template-columns: minmax(0, 1fr); }
.mail-layout.pane-bottom .mail-folderpane { grid-row: 1 / 3; }
.mail-layout.pane-bottom .mail-listpane { border-right: 0; border-bottom: 5px solid var(--surface-3); box-shadow: 0 1px 0 var(--border), 0 -1px 0 var(--border) inset; }
.mail-layout.pane-off { grid-template-columns: var(--fold-w) minmax(0, 1fr); }
.mail-layout.pane-off.no-folders { grid-template-columns: minmax(0, 1fr); }
.mail-layout.pane-off .mail-listpane { border-right: 0; }
.mail-layout.pane-off:not(.has-message) .mail-reader, .mail-layout.pane-off.has-message .mail-listpane { display: none; }
.mail-layout.pane-off .reader-toolbar .back, .mail-layout.pane-bottom .reader-toolbar .back { display: inline-flex; }

.mail-folderpane { display: flex; flex-direction: column; min-height: 0; background: var(--surface-2); border-right: 1px solid var(--border); }
.mail-folders { flex: 1; overflow-y: auto; padding: 6px 4px; background: none; border: 0; }
.fold-section + .fold-section { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.fold-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 4px 8px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fold-row { display: flex; align-items: center; border-radius: 6px; padding-left: calc(var(--depth, 0) * 12px); position: relative; }
.fold-row:hover { background: var(--hover); }
.fold-row.active { background: var(--selected); }
.fold-row.drop { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.fold-toggle { flex: none; width: 16px; height: 28px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; }
.fold-toggle .ico { transition: transform .15s; }
.fold-toggle.open .ico { transform: rotate(90deg); }
.mail-folders a.fold { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 6px 4px 6px 2px; color: var(--text); text-decoration: none; background: none; border-radius: 0; }
.mail-folders a.fold:hover { background: none; }
.fold .ico { color: var(--muted); }
.fold .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fold-row.active .fold { color: var(--accent); font-weight: 600; }
.fold-row.active .fold .ico { color: var(--accent); }
.fold .count { font-size: 12px; font-weight: 700; color: var(--accent); }
.fold-more { opacity: 0; margin-right: 2px; }
.fold-row:hover .fold-more, .fold-more:focus-visible { opacity: 1; }
.icon-btn.tiny { width: 24px; height: 24px; }
.mail-folders-foot { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-top: 1px solid var(--border); }
.foot-actions { display: flex; flex-direction: column; gap: 6px; }
.foot-actions .btn { justify-content: flex-start; }
.foot-row { display: flex; align-items: center; gap: 8px; }
.foot-toggle { flex: none; color: var(--muted); }
.foot-toggle .ico { transition: transform .15s; transform: rotate(180deg); }
.foot-toggle.open .ico { transform: none; }
.quota { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.quota-bar { height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.quota-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.quota-bar.warn span { background: var(--danger); }
.form .quota-bar { height: 8px; margin-bottom: 4px; }

.mail-listpane { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid var(--border); }
.mail-listbar { display: flex; align-items: center; gap: 4px; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--border); min-height: 46px; background: var(--surface); flex-wrap: wrap; }
.mail-listbar > input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); margin-right: 8px; }
.mail-listbar.selecting { background: var(--accent-soft); flex-wrap: nowrap; gap: 0; }
.mail-listbar.selecting .icon-btn:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.mail-listbar.selecting .icon-btn.danger:hover { color: var(--danger); }
.mail-listbar.selecting .icon-btn.on { color: var(--danger); }
.mail-listbar.selecting .icon-btn.on .ico { fill: currentColor; }
.sel-count { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-listtitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-searchinfo { display: flex; align-items: center; gap: 8px; padding: 6px 14px; background: var(--accent-soft); color: var(--text); font-size: 12.5px; border-bottom: 1px solid var(--border); }
.mail-list { flex: 1; min-height: 0; overflow-y: auto; border-right: 0; }
.mail-list ul { list-style: none; margin: 0; padding: 0; }
.mail-item { display: flex; gap: 10px; padding: 9px 12px 9px 11px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; border-left: 3px solid transparent; position: relative; }
.mail-item:hover { background: var(--hover); }
.mail-item.active { background: var(--selected); }
.mail-item.selected { background: var(--accent-soft); }
.mail-item.unread { border-left-color: var(--accent); }
.mail-item.unread .from, .mail-item.unread .subject { font-weight: 700; color: var(--text); }
.mi-select { position: relative; flex: none; width: 32px; height: 32px; }
.mi-select .avatar { position: absolute; inset: 0; }
.mi-cb { position: absolute; top: 7px; left: 7px; width: 18px; height: 18px; margin: 0; opacity: 0; cursor: pointer; z-index: 1; accent-color: var(--accent); }
.mail-item:hover .mi-cb, .mail-item.selected .mi-cb, .mail-list:has(.mail-item.selected) .mi-cb { opacity: 1; }
.mail-item:hover .mi-select .avatar, .mail-item.selected .mi-select .avatar, .mail-list:has(.mail-item.selected) .mi-select .avatar { visibility: hidden; }
.mi-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mi-top, .mi-bottom { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mail-item .from, .mail-item .subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-item .from { flex: 1; display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.mail-item .from-name { flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-item .from-addr { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; font-weight: 400; }
.mail-item .subject { flex: 1; color: var(--muted); font-size: 13px; }
.mail-item .date { font-size: 12px; color: var(--muted); white-space: nowrap; }
.mail-item.unread .date { color: var(--accent); font-weight: 600; }
.mi-ico { color: var(--muted); display: inline-flex; }
.mi-prio { color: var(--danger); font-weight: 800; font-size: 13px; }
.mi-flag { border: 0; background: none; padding: 2px; border-radius: 4px; color: var(--muted); cursor: pointer; display: inline-flex; opacity: 0; }
.mail-item:hover .mi-flag, .mi-flag.on, .mi-flag:focus-visible { opacity: 1; }
.mi-flag.on { color: var(--danger); }
.mi-flag.on .ico { fill: currentColor; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 10px; }
.drag-ghost { position: fixed; top: -100px; left: -100px; display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; background: var(--accent); color: #fff; border-radius: 6px; font-size: 13px; max-width: 280px; white-space: nowrap; overflow: hidden; }

.mail-reader { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.mail-reader.standalone { height: 100vh; }
.reader-toolbar { display: flex; gap: 2px; flex-wrap: wrap; padding: 6px 10px; border-bottom: 1px solid var(--border); background: var(--surface); flex: none; }
.reader-toolbar .back { display: none; }
.reader-toolbar .tb-btn.primary { background: var(--accent); color: #fff; }
.reader-toolbar .tb-btn.primary .ico { color: #fff; }
.tb-btn.on .ico { color: var(--danger); fill: currentColor; }
.reader-scroll { flex: 1; overflow-y: auto; min-height: 0; padding-bottom: 20px; }
.reader-subject { padding: 18px 24px 6px; font-size: 20px; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.reader-badges { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.badge-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.badge-pill.danger { background: rgba(210, 63, 63, .12); color: var(--danger); }
.badge-pill.ok { background: rgba(19, 138, 91, .12); color: var(--success); }
.reader-head { display: flex; gap: 12px; align-items: flex-start; padding: 6px 24px 12px; }
.reader-head > .avatar { width: 40px; height: 40px; font-size: 14px; flex: none; }
.rh-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.rh-from { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-height: 22px; }
.rh-name { border: 0; background: none; padding: 0; font: inherit; font-size: 15px; font-weight: 600; color: var(--text); cursor: pointer; }
.rh-name:hover { color: var(--accent); }
.rh-addr { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.rh-date { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.rh-more { align-self: center; color: var(--muted); }
.rh-more .ico { transition: transform .15s; }
.rh-more.open .ico { transform: rotate(180deg); }
.rh-row { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; }
.rh-label { flex: none; width: 44px; color: var(--muted); padding-top: 3px; }
.rh-people { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.person-chip { display: inline-flex; align-items: center; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 999px; padding: 2px 10px; font: inherit; font-size: 12.5px; cursor: pointer; }
.person-chip:hover { border-color: var(--accent); color: var(--accent); }
.person-chip.more { background: none; border-style: dashed; color: var(--muted); }
.link.person { font: inherit; color: inherit; text-decoration: none; }
.link.person:hover { color: var(--accent); text-decoration: underline; }
.link.person.strong { font-weight: 600; }
.reader-details { margin: 0 24px 12px; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; overflow-x: auto; }
.reader-details th { text-align: left; color: var(--muted); font-weight: 500; padding: 2px 12px 2px 0; white-space: nowrap; vertical-align: top; }
.reader-details td { word-break: break-all; }
.notice { display: flex; align-items: center; gap: 8px; margin: 0 24px 10px; padding: 8px 12px; border-radius: 6px; background: var(--accent-soft); font-size: 13px; flex-wrap: wrap; }
.notice.warn { background: rgba(194, 124, 14, .12); }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 24px 12px; }
.attachment { display: inline-flex; align-items: stretch; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; font-size: 13px; overflow: hidden; }
.attachment a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; text-decoration: none; color: var(--text); }
.attachment a:hover { background: var(--hover); color: var(--accent); }
.attachment a small { color: var(--muted); }
.att-name { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment .att-download { border-left: 1px solid var(--border); padding: 6px 9px; color: var(--muted); }
.mail-body { display: block; min-height: 160px; margin: 0 24px; width: calc(100% - 48px); border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.thread { margin: 14px 24px 0; }
.thread-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; text-decoration: none; color: var(--text); font-size: 13px; }
.thread-item:hover { background: var(--hover); }
.thread-item.active { background: var(--selected); }
.thread-item.unread b { color: var(--accent); }

/* ponuky, výber priečinka, zdieľanie */
.popup-menu { position: fixed; z-index: 300; min-width: 200px; max-width: 320px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 4px; }
.pm-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 7px 10px; border-radius: 6px; text-align: left; cursor: pointer; color: var(--text); }
.pm-item:hover, .pm-item:focus-visible { background: var(--hover); outline: none; }
.pm-item .ico { color: var(--muted); }
.pm-item.danger, .pm-item.danger .ico { color: var(--danger); }
.pm-item[disabled] { opacity: .45; cursor: default; }
.pm-ico { width: 16px; }
.pm-sep { height: 1px; background: var(--border); margin: 4px 0; }
.pick-list, .ab-list { max-height: 50vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; padding: 4px; }
.pick-row { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 7px 10px; border-radius: 6px; cursor: pointer; text-align: left; color: var(--text); }
.pick-row:hover { background: var(--hover); }
.pick-row.active { background: var(--selected); color: var(--accent); font-weight: 600; }
.share-list { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.share-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; }
.share-results:empty { display: none; }
.share-results { border: 1px solid var(--border); border-radius: 6px; padding: 4px; }
.shared-box { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin: 0 0 10px; }
.shared-box legend { font-weight: 600; padding: 0 4px; }
.ab-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.ab-row:hover { background: var(--hover); }
.ab-row input { width: 16px; height: 16px; accent-color: var(--accent); }
.row-inline.wrap { flex-wrap: wrap; gap: 14px; }
.modal.wide { max-width: 880px; }

/* písanie správy */
.composer-overlay { position: fixed; inset: 0; z-index: 75; background: rgba(15, 23, 36, .45); display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 16px; }
.mail-composer { position: relative; width: min(980px, 100%); height: min(860px, calc(100vh - 32px)); background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.mail-composer.standalone { width: 100%; height: 100vh; border-radius: 0; box-shadow: none; }
.mail-composer > *, .cmp-row, .cmp-row > * { min-width: 0; }
.cmp-head { display: flex; align-items: center; gap: 6px; padding: 10px 14px 10px 18px; border-bottom: 1px solid var(--border); }
.cmp-fields { padding: 4px 18px; border-bottom: 1px solid var(--border); }
.cmp-row { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); min-height: 42px; }
.cmp-row:last-child { border-bottom: 0; }
.cmp-label { width: 92px; flex: none; color: var(--muted); font-size: 13px; }
.cmp-row > select, .cmp-row > input { flex: 1; border: 0; background: transparent; padding: 8px 0; min-width: 0; }
.cmp-row > select:focus, .cmp-row > input:focus { outline: none; }
.cmp-to { flex: 1; display: flex; align-items: center; gap: 4px; min-width: 0; }
.cmp-subject-row { gap: 12px; }
.cmp-subject { font-size: 15px !important; font-weight: 500; }
.cmp-toggles { display: inline-flex; gap: 10px; font-size: 13px; white-space: nowrap; }
.cmp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cmp-toolbar select { padding: 3px 6px; font-size: 12.5px; height: 30px; }
.cmp-toolbar input[type=color] { width: 30px; height: 28px; border: 1px solid var(--border); border-radius: 6px; padding: 2px; background: var(--surface); cursor: pointer; }
.tb-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.cmp-body { flex: 1; overflow-y: auto; min-height: 120px; }
.cmp-editor { min-height: 100%; padding: 14px 18px; outline: none; line-height: 1.5; word-wrap: break-word; }
.cmp-editor img { max-width: 100%; }
.cmp-body { display: flex; flex-direction: column; }
.cmp-editor { flex: 1; }
.cmp-source { flex: 1; width: 100%; min-height: 100%; border: 0 !important; border-radius: 0 !important; resize: none; padding: 14px 18px !important;
  font-size: 12.5px; line-height: 1.55; background: var(--surface-2) !important; color: var(--text); tab-size: 2; white-space: pre-wrap; }
.cmp-source:focus { outline: none; box-shadow: none !important; }
.cmp-toolbar .cmp-html { padding: 4px 10px; }
.cmp-toolbar .cmp-html.active { background: var(--accent); color: #fff; }
.cmp-toolbar .cmp-html.active .ico { color: #fff; }
.cmp-toolbar [disabled] { opacity: .35; pointer-events: none; }
.cmp-editor blockquote { margin: 0 0 0 .8ex; border-left: 2px solid var(--border); padding-left: 1ex; color: var(--muted); }
.cmp-attachments { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 18px; border-top: 1px solid var(--border); max-height: 120px; overflow-y: auto; }
.cmp-att { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; max-width: 300px; overflow: hidden; background: var(--surface-2); }
.cmp-att.error { border-color: var(--danger); color: var(--danger); }
.cmp-att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-att-bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--accent); transition: width .2s; }
.cmp-options { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 8px 18px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 13px; }
.cmp-foot { display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-top: 1px solid var(--border); }
.cmp-foot .icon-btn.active { background: var(--selected); color: var(--accent); }
.cmp-status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-drop { display: none; position: absolute; inset: 8px; border: 2px dashed var(--accent); border-radius: 10px; background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--accent); font-weight: 600; z-index: 5; place-items: center; align-content: center; gap: 8px; pointer-events: none; }
.mail-composer.dragging .cmp-drop { display: grid; }
.rcpt { position: relative; flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 5px 0; min-width: 0; cursor: text; }
.rcpt-chips { display: contents; }
.rcpt-chip { display: inline-flex; align-items: baseline; gap: 5px; max-width: 100%; padding: 2px 4px 2px 9px; border-radius: 999px; background: var(--accent-soft); font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rcpt-name { overflow: hidden; text-overflow: ellipsis; }
.rcpt-addr { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.rcpt-chip.invalid { background: rgba(210, 63, 63, .14); color: var(--danger); }
.rcpt-x { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 15px; line-height: 1; padding: 0 4px; border-radius: 50%; }
.rcpt-x:hover { color: var(--danger); }
.rcpt-input { flex: 1; min-width: 140px; border: 0 !important; background: transparent !important; padding: 4px 0 !important; box-shadow: none !important; }
.rcpt-input:focus { outline: none; }
.rcpt-suggest { position: absolute; top: 100%; left: 0; z-index: 20; min-width: 320px; max-width: 100%; max-height: 300px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 4px; }
.rcpt-opt { display: flex; align-items: baseline; gap: 8px; width: 100%; border: 0; background: none; padding: 6px 10px; border-radius: 6px; text-align: left; cursor: pointer; color: var(--text); }
.rcpt-opt small { color: var(--muted); }
.rcpt-opt small.muted { margin-left: auto; }
.rcpt-opt.active, .rcpt-opt:hover { background: var(--hover); }

/* nastavenia pošty */
.ms { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 18px; min-height: 420px; }
.ms-tabs { display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--border); padding-right: 12px; }
.ms-tab { border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 6px; cursor: pointer; color: var(--text); }
.ms-tab:hover { background: var(--hover); }
.ms-tab.active { background: var(--selected); color: var(--accent); font-weight: 600; }
.ms-body { min-width: 0; }
.ms-body h3 { margin-top: 8px; }
.ms-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.sig-editor { min-height: 110px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 8px; }
.check.big { font-weight: 600; }
.rules { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.rule { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.rule.off { opacity: .6; }
.rule > input { width: 16px; height: 16px; accent-color: var(--accent); }
.rule-sum { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rule-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.rule-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rule-row select, .rule-row input { flex: 1; min-width: 120px; }
textarea.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
body.mail-window { background: var(--surface); }
body.mail-window #mailwin { height: 100vh; }

@media (max-width: 1280px) {
  .mail-layout { --fold-w: 190px; --list-w: 320px; }
  .mail-search input[type=search] { width: 170px; }
}
@media (max-width: 960px) {
  .hide-sm { display: none; }
  .mail-head h1 { display: none; }
  .mail-search { flex: 1; }
  .mail-search input[type=search] { width: auto; flex: 1; }
  .mail-layout, .mail-layout.pane-bottom, .mail-layout.pane-off { display: flex; flex-direction: column; }
  .mail-folderpane { flex: none; max-height: 40vh; border-right: 0; border-bottom: 1px solid var(--border); }
  .mail-layout .mail-folderpane, .mail-layout.no-folders .mail-folderpane { display: none; }
  .mail-layout.mobile-folders .mail-folderpane { display: flex; }
  .mail-listpane, .mail-reader { flex: 1; min-height: 0; border-right: 0; }
  .mail-layout.has-message .mail-folderpane, .mail-layout.has-message .mail-listpane { display: none !important; }
  .mail-layout:not(.has-message) .mail-reader { display: none; }
  .reader-toolbar .back { display: inline-flex; }
  .reader-subject, .reader-head { padding-left: 14px; padding-right: 14px; }
  .attachments, .notice, .reader-details, .thread { margin-left: 14px; margin-right: 14px; }
  .mail-body { margin: 0 14px; width: calc(100% - 28px); }
  .mi-cb { opacity: 1; }
  .mi-select .avatar { visibility: hidden; }
  .composer-overlay { padding: 0; }
  .mail-composer { width: 100vw; max-width: 100vw; height: 100%; border-radius: 0; }
  .cmp-label { width: 64px; }
  .cmp-fields { padding: 4px 12px; }
  .cmp-subject-row { flex-wrap: wrap; gap: 0 12px; }
  .cmp-subject-row .cmp-subject { flex-basis: 100%; }
  .cmp-toggles { padding-bottom: 6px; }
  .cmp-toolbar { padding: 4px 6px; }
  .cmp-editor { padding: 12px; }
  .cmp-foot { padding: 8px 12px; }
  .ms { grid-template-columns: 1fr; }
  .ms-tabs { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 8px; }
  .ms-tab { white-space: nowrap; }
}

/* avatar s ikonou domény odosielateľa */
.avatar { position: relative; overflow: hidden; }
.avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 18%; background: #fff; border-radius: inherit; opacity: 0; transition: opacity .15s; }
.avatar.has-img { box-shadow: inset 0 0 0 1px var(--border); }
.avatar.has-img .avatar-img { opacity: 1; }

/* ťahadlá na zmenu šírky panelov pošty */
.mail-folderpane, .mail-listpane { position: relative; }
.pane-resizer { position: absolute; top: 0; right: -4px; width: 8px; height: 100%; cursor: col-resize; z-index: 5; touch-action: none; }
.pane-resizer::after { content: ''; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: transparent; transition: background .15s; }
.pane-resizer:hover::after, .pane-resizer.dragging::after { background: var(--accent); }
.pane-resizer.rows { top: auto; bottom: -4px; right: 0; width: 100%; height: 8px; cursor: row-resize; }
.pane-resizer.rows::after { top: 3px; bottom: auto; left: 0; right: 0; width: auto; height: 2px; }
.mail-layout.pane-off .mail-listpane .pane-resizer { display: none; }
body.resizing-col, body.resizing-col * { cursor: col-resize !important; user-select: none !important; }
body.resizing-row, body.resizing-row * { cursor: row-resize !important; user-select: none !important; }
body.resizing-col iframe, body.resizing-row iframe { pointer-events: none; }
@media (max-width: 960px) { .pane-resizer { display: none; } }
.quota small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* chat – prílohy pred odoslaním, ťahanie súborov, zväčšený náhľad */
.chat-thread, .cw { position: relative; }
.chat-tray { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 14px 0; background: var(--surface); border-top: 1px solid var(--border); max-height: 190px; overflow-y: auto; }
.chat-tray.compact { padding: 8px 8px 0; gap: 6px; max-height: 120px; }
.chat-tray + .composer { border-top: 0; }
.tray-item { position: relative; display: flex; align-items: center; gap: 8px; height: 72px; min-width: 72px; max-width: 230px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.chat-tray.compact .tray-item { height: 52px; min-width: 52px; max-width: 170px; }
.tray-item img { height: 100%; width: auto; max-width: 140px; object-fit: cover; display: block; }
.tray-item.error { border-color: var(--danger); }
.tray-ico { display: grid; place-items: center; width: 40px; height: 100%; color: var(--muted); flex: none; }
.tray-name { display: flex; flex-direction: column; min-width: 0; padding-right: 24px; font-size: 12.5px; }
.tray-name, .tray-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray-name small { color: var(--muted); font-size: 11.5px; }
.tray-x { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(15, 23, 36, .7); color: #fff; cursor: pointer; padding: 0; }
.tray-x:hover { background: var(--danger); }
.tray-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); transition: width .15s; }
.chat-drop { display: none; position: absolute; inset: 6px; z-index: 6; border: 2px dashed var(--accent); border-radius: 10px; background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--accent); font-weight: 600; place-items: center; align-content: center; gap: 8px; pointer-events: none; }
.chat-dragging > .chat-drop { display: grid; }
.lightbox { position: fixed; inset: 0; z-index: 250; background: rgba(8, 12, 20, .92); display: flex; flex-direction: column; }
.lb-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; color: #fff; }
.lb-bar .icon-btn { color: #fff; }
.lb-bar .icon-btn:hover { background: rgba(255, 255, 255, .12); }
.lb-caption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.lb-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 64px 24px; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; box-shadow: 0 8px 40px rgba(0, 0, 0, .5); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; display: grid; place-items: center; cursor: pointer; z-index: 1; }
.lb-nav:hover { background: rgba(255, 255, 255, .25); }
.lb-nav.prev { left: 12px; }
.lb-nav.next { right: 12px; }
@media (max-width: 960px) { .lb-stage { padding: 0 8px 16px; } .lb-nav { width: 40px; height: 40px; } }

/* hlasový hovor 1:1 (WebRTC) – plávajúce okno vpravo hore */
.call-panel { position: fixed; right: 16px; top: calc(var(--topbar-h) + 10px); z-index: 90; width: 320px; max-width: calc(100vw - 24px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; }
.call-panel.state-ringing { border-color: var(--success); animation: call-ring 1.2s ease-in-out infinite alternate; }
@keyframes call-ring { to { box-shadow: var(--shadow), 0 0 0 5px rgba(19, 138, 91, .35); } }
.call-who { display: flex; gap: 12px; align-items: center; }
.call-who .avatar { width: 46px; height: 46px; font-size: 16px; }
.call-who .avatar.pulse { animation: call-pulse 1.2s ease-in-out infinite; }
@keyframes call-pulse { 50% { transform: scale(1.08); } }
.call-who .grow { display: flex; flex-direction: column; min-width: 0; }
.call-who b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-status { color: var(--muted); font-variant-numeric: tabular-nums; }
.call-panel.state-active .call-status { color: var(--success); font-weight: 600; }
.call-actions { display: flex; gap: 12px; justify-content: center; }
.call-btn { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); display: grid; place-items: center; cursor: pointer; text-decoration: none; }
.call-btn:hover { background: var(--hover); }
.call-btn.accept { background: var(--success); border-color: var(--success); color: #fff; }
.call-btn.decline { background: var(--danger); border-color: var(--danger); color: #fff; }
.call-btn.accept:hover, .call-btn.decline:hover { filter: brightness(1.1); }
.call-btn.mute.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.call-panel.state-ringing .call-actions { gap: 40px; }
.msg-call { align-self: center; display: inline-flex; align-items: center; gap: 8px; margin: 6px 0; padding: 5px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; color: var(--text); }
.msg-call small { color: var(--muted); }
.msg-call .ico { color: var(--success); }
.msg-call.missed { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.msg-call.missed .ico { color: var(--danger); }
@media (max-width: 960px) { .call-panel { right: 8px; left: 8px; width: auto; } }
@media (prefers-reduced-motion: reduce) { .call-panel.state-ringing, .call-who .avatar.pulse { animation: none; } }

/* chat – odpovede a úpravy správ */
.msg-row { display: flex; align-items: center; gap: 4px; max-width: 100%; }
.msg.mine .msg-row { flex-direction: row-reverse; }
.msg-row .bubble { min-width: 0; }
.msg-acts { display: inline-flex; gap: 2px; opacity: 0; transition: opacity .12s; flex: none; }
.msg:hover .msg-acts, .msg-acts:focus-within { opacity: 1; }
.msg-act { width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-sm); }
.msg-act:hover { color: var(--accent); background: var(--hover); }
.msg-reply { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--accent); border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 10%, transparent); padding: 4px 8px; margin: 0 0 6px; font: inherit; font-size: 12.5px; color: inherit; cursor: pointer; }
.msg-reply b { font-size: 12px; color: var(--accent); }
.msg-reply span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; opacity: .85; }
.msg.mine .msg-reply { background: rgba(255, 255, 255, .16); border-left-color: rgba(255, 255, 255, .8); }
.msg.mine .msg-reply b { color: #fff; }
.msg-edited { font-style: italic; }
.msg.highlight .bubble { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); transition: box-shadow .2s; }
.compose-ctx { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--surface); border-top: 1px solid var(--border); border-left: 3px solid var(--accent); }
.compose-ctx .ico { color: var(--accent); flex: none; }
.compose-ctx .grow { display: flex; flex-direction: column; min-width: 0; }
.compose-ctx b { font-size: 12.5px; color: var(--accent); }
.compose-ctx small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose-ctx + .composer, .chat-tray + .compose-ctx { border-top: 0; }
.cw .compose-ctx { padding: 6px 10px; }
.cw .msg-act { width: 24px; height: 24px; }
@media (hover: none) { .msg-acts { opacity: 1; } }

/* zdroj správy (samostatné okno) */
.source-view { display: flex; flex-direction: column; height: 100vh; }
.source-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.mail-source { flex: 1; margin: 0; overflow: auto; padding: 14px 16px; background: var(--surface-2); color: var(--text);
  font: 12.5px/1.5 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; tab-size: 4; }
.mail-source.nowrap { white-space: pre; word-break: normal; }
.reader-details .link { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; text-decoration: none; }

/* tagy e-mailov */
.tag-chip { --tag: #1565d8; display: inline-flex; align-items: center; gap: 5px; max-width: 180px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.4;
  color: color-mix(in srgb, var(--tag) 78%, var(--text)); background: color-mix(in srgb, var(--tag) 16%, transparent); border: 1px solid color-mix(in srgb, var(--tag) 38%, transparent); }
.tag-chip.small { padding: 0 6px; font-size: 11px; gap: 4px; }
.tag-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tag); flex: none; }
.tag-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-x { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0 0 2px; font-size: 14px; line-height: 1; opacity: .7; }
.tag-x:hover { opacity: 1; }
.mi-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.tag-more { font-size: 11px; color: var(--muted); align-self: center; }
.reader-subject-row { display: flex; align-items: flex-start; gap: 12px; padding: 18px 24px 6px; }
.reader-subject-row .reader-subject { flex: 1; min-width: 0; padding: 0; }
.reader-tags { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; max-width: 50%; padding-top: 3px; }
.tag-hist-btn { color: var(--muted); }
.tag-hist-btn.active { color: var(--accent); background: var(--accent-soft); }
.tag-add { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; border: 1px dashed var(--border); background: none; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.tag-add:hover { color: var(--accent); border-color: var(--accent); }
.tag-history { margin: 0 24px 12px; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; }
.tag-history ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.tag-check { width: 16px; height: 16px; border-radius: 4px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; border: 2px solid var(--tag); flex: none; }
.tag-check.on, .tag-check.mixed { background: var(--tag); }
.pm-empty { padding: 6px 10px; }
.tag-admin { display: flex; flex-direction: column; gap: 8px; }
.tag-admin-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag-admin-row > .tag-chip { width: 120px; }
.tag-admin-row input[type=text] { flex: 1; min-width: 140px; }
.tag-palette { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.swatch { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; background: var(--tag); cursor: pointer; padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--tag); }
.tag-palette input[type=color] { width: 26px; height: 24px; border: 1px solid var(--border); border-radius: 6px; padding: 1px; background: var(--surface); cursor: pointer; }
@media (max-width: 960px) { .reader-subject-row { flex-direction: column; gap: 6px; padding-left: 14px; padding-right: 14px; } .reader-tags { max-width: none; justify-content: flex-start; } .tag-history { margin-left: 14px; margin-right: 14px; } }

/* filter podľa tagov */
.tag-row .fold { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 6px 4px 6px 2px; border: 0; background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.tag-row.active .fold { color: var(--accent); font-weight: 600; }
.tag-row .fold .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-dot.big { width: 11px; height: 11px; margin: 0 3px; display: inline-block; }
.mail-listbar .icon-btn.active { color: var(--accent); background: var(--accent-soft); }
.mail-searchinfo .row-inline { gap: 6px; white-space: nowrap; flex-wrap: wrap; row-gap: 4px; min-width: 0; }
.mail-searchinfo > .link { white-space: nowrap; }

.scope-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; margin-left: 4px; flex: none; }
.scope-switch button { border: 0; background: var(--surface); color: var(--muted); font: inherit; font-size: 12px; padding: 2px 10px; cursor: pointer; white-space: nowrap; }
.scope-switch button.on { background: var(--accent); color: #fff; }
.scope-switch button:not(.on):hover { color: var(--accent); }

/* poznámka k e-mailu – jedna spoločná pod konverzáciou */
.mi-note { display: inline-flex; align-items: center; color: #c99a06; }
.mail-note { margin: 0 24px 12px; }
.rh-row .note-add { margin-left: auto; flex: none; }
.note-add { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; border: 1px dashed var(--border); background: none;
  color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; }
.note-add:hover { color: #b8860b; border-color: #e0b52b; background: color-mix(in srgb, #f2c94c 10%, transparent); }
.note-card { border-radius: 10px; padding: 10px 12px; background: color-mix(in srgb, #f2c94c 10%, var(--surface)); border: 1px solid color-mix(in srgb, #f2c94c 35%, var(--border)); }
.note-card.editing { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.note-card-head { display: flex; align-items: center; gap: 8px; font-size: 13px; min-height: 26px; }
.note-card-head > .ico { color: #c99a06; }
.note-card-head .tb-btn.small { padding: 3px 8px; font-size: 12.5px; }
.note-card-head .icon-btn.active { color: var(--accent); background: var(--accent-soft); }
.note-body { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.55; cursor: text; border-radius: 6px; padding: 2px 4px; margin-left: -4px; }
.note-body:hover { background: color-mix(in srgb, #f2c94c 12%, transparent); }
.note-card textarea { width: 100%; margin-top: 6px; resize: vertical; min-height: 70px; font-size: 13.5px; line-height: 1.5; }
.note-edit-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.note-edit-bar .hint { font-size: 11px; }
.link.danger { color: var(--danger); }
.note-conflict { margin-top: 6px; padding: 6px 10px; border-radius: 6px; background: rgba(210, 63, 63, .08); border: 1px solid rgba(210, 63, 63, .3); font-size: 13px; white-space: pre-wrap; }
.note-history { margin-top: 8px; padding-top: 8px; border-top: 1px dashed color-mix(in srgb, #f2c94c 40%, var(--border)); display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.note-version-text { white-space: pre-wrap; font-size: 12.5px; color: var(--muted); }
@media (max-width: 960px) { .mail-note { margin-left: 14px; margin-right: 14px; } .note-edit-bar .hint { display: none; } }


/* ====================================================================== Kalendár */
.cal-headbar { gap: 12px; }
.cal-nav { display: flex; align-items: center; gap: 4px; min-width: 0; }
.cal-title { margin: 0 0 0 8px; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-title::first-letter { text-transform: uppercase; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 8px; padding: 2px; }
.seg button { border: 0; background: none; color: var(--muted); height: 30px; padding: 0 12px; border-radius: 6px; font: inherit; font-size: 13px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }
.cal-layout { flex: 1; display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 0; background: var(--surface); }
.cal-side { background: var(--surface-2); border-right: 1px solid var(--border); padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.cal-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.cal-sec { display: flex; flex-direction: column; gap: 2px; }
.cal-sec h3 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.cal-sec-head { display: flex; align-items: center; justify-content: space-between; }
.cal-sec-head h3 { margin: 0; }
.cal-row { display: flex; align-items: center; gap: 8px; padding: 3px 4px; border-radius: 6px; font-size: 13px; min-width: 0; }
.cal-row:hover { background: var(--hover); }
.cal-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-check { width: 16px; height: 16px; flex: none; border-radius: 4px; border: 2px solid var(--cal); background: transparent; display: grid; place-items: center; padding: 0; cursor: pointer; color: #fff; }
.cal-check.on { background: var(--cal); }
.cal-more { opacity: 0; }
.cal-row:hover .cal-more, .cal-more:focus-visible { opacity: 1; }
.cal-room { display: flex; align-items: center; gap: 8px; border: 0; background: none; color: inherit; font: inherit; font-size: 13px; padding: 4px; border-radius: 6px; cursor: pointer; text-align: left; }
.cal-room:hover { background: var(--hover); }
.inv { display: flex; flex-direction: column; gap: 3px; padding: 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 6px; font-size: 13px; }
.inv-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: space-between; }
.inv.inv-cancel { border-left: 3px solid var(--danger); }

/* mini mesiac */
.mini-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; text-transform: capitalize; margin-bottom: 4px; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; text-align: center; }
.mini-wd { font-size: 10px; color: var(--muted); padding: 2px 0; }
.mini-d { border: 0; background: none; color: inherit; font: inherit; font-size: 12px; height: 26px; border-radius: 50%; cursor: pointer; padding: 0; }
.mini-d:hover { background: var(--hover); }
.mini-d.other { color: var(--muted); opacity: .6; }
.mini-d.in { background: var(--accent-soft); border-radius: 0; }
.mini-d.today { background: var(--accent); color: #fff; font-weight: 700; border-radius: 50%; }

/* čipy udalostí (mesiac, celý deň) */
.cal-chip { display: flex; align-items: center; gap: 4px; width: 100%; min-width: 0; border: 0; text-align: left; font: inherit; font-size: 12px; line-height: 1.35; padding: 1px 6px; border-radius: 4px; cursor: pointer;
  color: var(--text); background: color-mix(in srgb, var(--cal) 16%, var(--surface)); box-shadow: inset 3px 0 var(--cal); }
.cal-chip:hover { background: color-mix(in srgb, var(--cal) 26%, var(--surface)); }
.cal-chip.allday { background: var(--cal); color: #fff; box-shadow: none; }
.cal-chip .chip-time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.cal-chip .chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip.tentative, .tg-ev.tentative { background-image: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--cal) 18%, transparent) 6px 12px); }
.cal-chip.pending, .tg-ev.pending { outline: 1.5px dashed var(--cal); outline-offset: -1.5px; }
.cal-chip.declined, .tg-ev.declined { opacity: .55; text-decoration: line-through; }

/* mesiac */
.month { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: auto repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--border); overflow: auto; }
.mhead { background: var(--surface); padding: 6px; text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.mcell { background: var(--surface); min-height: 92px; padding: 3px 4px; display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow: hidden; }
.mcell.weekend { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
.mcell.other { background: var(--surface-2); }
.mcell.other .mday { color: var(--muted); }
.mcell.drop { background: var(--accent-soft); }
.mday { align-self: flex-start; border: 0; background: none; color: inherit; font: inherit; font-size: 12px; min-width: 24px; height: 24px; border-radius: 12px; cursor: pointer; padding: 0 4px; }
.mday:hover { background: var(--hover); }
.mcell.today .mday { background: var(--accent); color: #fff; font-weight: 700; }
.more-link { border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; text-align: left; padding: 0 6px; cursor: pointer; }
.more-link:hover { color: var(--accent); }

/* agenda */
.agenda { flex: 1; overflow-y: auto; padding: 8px 16px 24px; }
.ag-day { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.ag-date { display: flex; align-items: baseline; gap: 8px; }
.ag-date b { font-size: 22px; font-weight: 600; min-width: 30px; }
.ag-date span { color: var(--muted); font-size: 13px; }
.ag-day.today .ag-date b { color: var(--accent); }
.ag-list { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ag-item { display: flex; align-items: center; gap: 10px; border: 0; background: none; color: inherit; font: inherit; font-size: 14px; text-align: left; padding: 6px 8px; border-radius: 6px; cursor: pointer; min-width: 0; }
.ag-item:hover { background: var(--hover); }
.ag-time { width: 110px; flex: none; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.ag-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cal); flex: none; }

/* časová mriežka (deň / týždeň) */
.tg { flex: 1; display: flex; flex-direction: column; min-height: 0; --tw: 52px; }
.tg-head, .tg-allday { display: grid; grid-template-columns: var(--tw) repeat(var(--n), minmax(0, 1fr)); border-bottom: 1px solid var(--border); padding-right: var(--sbw, 0px); }
.tg-corner { display: flex; align-items: flex-end; justify-content: flex-end; padding: 4px 6px; font-size: 10px; }
.tg-dayhead { display: flex; align-items: baseline; justify-content: center; gap: 6px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; padding: 6px 0; cursor: pointer; text-transform: uppercase; }
.tg-dayhead b { font-size: 20px; font-weight: 500; color: var(--text); }
.tg-dayhead.today { color: var(--accent); }
.tg-dayhead.today b { background: var(--accent); color: #fff; border-radius: 50%; width: 32px; height: 32px; display: inline-grid; place-items: center; font-size: 16px; }
.tg-allday { min-height: 28px; }
.tg-adcell { border-left: 1px solid var(--border); padding: 2px; display: flex; flex-direction: column; gap: 2px; min-width: 0; max-height: 92px; overflow-y: auto; }
.tg-body { flex: 1; overflow-y: auto; position: relative; scrollbar-gutter: stable; }
.tg-head, .tg-allday { scrollbar-gutter: stable; overflow: hidden; }
.tg-inner { position: relative; display: grid; grid-template-columns: var(--tw) repeat(var(--n), minmax(0, 1fr)); }
.tg-times { position: relative; }
.tg-times span { position: absolute; right: 6px; transform: translateY(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tg-col { position: relative; border-left: 1px solid var(--border); cursor: cell; touch-action: pan-y;
  background:
    linear-gradient(to bottom, transparent var(--ws), transparent var(--ws)),
    repeating-linear-gradient(to bottom, var(--border) 0 1px, transparent 1px 24px, color-mix(in srgb, var(--border) 45%, transparent) 24px 25px, transparent 25px 48px);
}
.tg-col::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, var(--surface-2) var(--ws), transparent var(--ws), transparent var(--we), var(--surface-2) var(--we)); opacity: .7; }
.tg-col.today { background-color: color-mix(in srgb, var(--accent) 3%, transparent); }
.tg-now { position: absolute; left: -1px; right: 0; height: 2px; background: var(--danger); z-index: 3; pointer-events: none; }
.tg-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.tg-ghost { position: absolute; left: 2px; right: 4px; background: color-mix(in srgb, var(--accent) 22%, transparent); border: 1px solid var(--accent); border-radius: 6px; font-size: 12px; padding: 2px 6px; z-index: 4; pointer-events: none; color: var(--accent); font-weight: 600; }
.tg-ev { position: absolute; z-index: 2; overflow: hidden; border-radius: 6px; padding: 2px 6px 2px 8px; font-size: 12px; line-height: 1.3; cursor: pointer; user-select: none; touch-action: none;
  background: color-mix(in srgb, var(--cal) 18%, var(--surface)); color: var(--text); box-shadow: inset 3px 0 var(--lbl), 0 0 0 1px var(--surface); display: flex; flex-direction: column; }
.tg-ev:hover { background: color-mix(in srgb, var(--cal) 28%, var(--surface)); z-index: 5; }
.tg-ev:focus-visible { outline: 2px solid var(--accent); }
.tg-ev b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-ev small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-ev.short { flex-direction: row; gap: 6px; align-items: baseline; padding-top: 0; }
.tg-ev.can { cursor: grab; }
.tg-ev.dragging { cursor: grabbing; opacity: .85; z-index: 6; box-shadow: inset 3px 0 var(--lbl), var(--shadow); }
.tg-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.tg-ev:hover .tg-resize::after { content: ''; position: absolute; left: 50%; bottom: 2px; width: 18px; margin-left: -9px; height: 2px; border-radius: 1px; background: var(--muted); }
.tg-travel { position: absolute; left: 0; right: 0; bottom: 100%; background: repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--cal) 25%, transparent) 4px 8px); pointer-events: none; }
.tg-ev { overflow: visible; }
.tg-ev > b, .tg-ev > small { position: relative; }

/* zdieľanie kalendára */
.share-list { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; }
.share-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.share-row select { width: auto; }
.share-results { display: flex; flex-direction: column; }
.pick-row { display: flex; align-items: center; gap: 8px; border: 0; background: none; color: inherit; font: inherit; text-align: left; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.pick-row:hover { background: var(--hover); }
.shared-box { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin: 0 0 8px; }
.shared-box legend { font-weight: 600; padding: 0 4px; }

/* dialóg udalosti */
.modal.ev-modal { width: min(900px, calc(100vw - 32px)); max-width: 900px; }
.ev-form { display: flex; flex-direction: column; gap: 12px; }
.ev-title { font-size: 18px; font-weight: 600; }
.ev-cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; }
.ev-main, .ev-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ev-when { display: flex; flex-direction: column; gap: 6px; }
.ev-dt { display: grid; grid-template-columns: 26px 1fr 110px; gap: 6px; align-items: center; }
.ev-row { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.ev-row > :not(svg) { flex: 1; min-width: 0; color: var(--text); }
.ev-row.top { align-items: flex-start; }
.ev-row.top > svg { margin-top: 9px; }
.ev-row textarea { min-height: 90px; resize: vertical; }
.ev-recur { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.ev-recur .row-inline { flex-wrap: wrap; }
.ev-interval { width: 70px !important; }
.ev-days { display: inline-flex; gap: 3px; }
.ev-day { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: inherit; font: inherit; font-size: 12px; cursor: pointer; padding: 0; }
.ev-day.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ev-block { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.ev-block-head { display: flex; align-items: center; gap: 8px; }
.ev-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.ev-grid .field { margin: 0; }
.ev-people { border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px; min-height: 38px; background: var(--surface); }
.ev-people input { border: 0 !important; outline: 0; flex: 1; min-width: 120px; background: none; padding: 4px; }
.rcpt-chip.optional { background: var(--surface-3); font-style: italic; }
.ev-statuses { display: flex; flex-wrap: wrap; gap: 4px; }
.ev-status { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); }
.ev-status.ok { background: rgba(19, 138, 91, .14); color: var(--success); }
.ev-status.no { background: rgba(210, 63, 63, .12); color: var(--danger); }
.ev-status.maybe { background: rgba(194, 124, 14, .14); color: var(--warning); }
.room-row { font-size: 13px; }
.room-state.busy { color: var(--danger); font-weight: 600; }
.room-state.free { color: var(--success); }

/* detail udalosti (bublina) */
.ev-pop { position: fixed; z-index: 70; width: min(380px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.ev-pop-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 12px 6px 16px; }
.ev-pop-head h3 { margin: 0; flex: 1; font-size: 16px; line-height: 1.3; word-break: break-word; }
.ev-pop-dot { width: 12px; height: 12px; border-radius: 3px; background: var(--cal); margin-top: 4px; flex: none; }
.ev-pop-body { padding: 0 16px 10px 38px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.ev-pop-body p { margin: 0; }
.ev-pop-people { display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow-y: auto; }
.ev-person { display: flex; align-items: center; gap: 8px; }
.ev-person .avatar.small { width: 24px; height: 24px; font-size: 10px; }
.ev-part { margin-left: auto; color: var(--muted); }
.ev-person.ok .ev-part { color: var(--success); }
.ev-person.no .ev-part { color: var(--danger); }
.ev-person.maybe .ev-part { color: var(--warning); }
.ev-desc { white-space: pre-wrap; word-break: break-word; max-height: 160px; overflow-y: auto; padding: 8px; background: var(--surface-2); border-radius: 6px; }
.ev-label-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.ev-rsvp { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 4px; }
.ev-rsvp .btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.ev-pop-foot { display: flex; gap: 4px; justify-content: flex-end; padding: 8px 10px; border-top: 1px solid var(--border); flex-wrap: wrap; }

/* hľadanie času (free/busy) */
.fb { display: flex; flex-direction: column; gap: 10px; }
.fb-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-title { flex: 1; text-align: center; text-transform: capitalize; }
.fb-grid { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
.fb-row { display: grid; grid-template-columns: 160px 1fr; align-items: stretch; border-bottom: 1px solid var(--border); min-width: 640px; }
.fb-row:last-child { border-bottom: 0; }
.fb-name { padding: 6px 8px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--surface-2); }
.fb-slots { display: flex; }
.fb-slot { flex: 1; min-width: 14px; height: 28px; border-left: 1px solid var(--surface); cursor: pointer; }
.fb-head .fb-slot { cursor: default; font-size: 10px; color: var(--muted); height: auto; padding: 4px 0 2px 2px; background: none; }
.fb-slot.free { background: rgba(19, 138, 91, .12); }
.fb-slot.busy { background: var(--c0); opacity: .8; }
.fb-slot.unknown { background: repeating-linear-gradient(135deg, var(--surface-3) 0 4px, var(--surface) 4px 8px); }
.fb-slot.sel { box-shadow: inset 0 2px var(--warning), inset 0 -2px var(--warning); background-color: rgba(194, 124, 14, .22); }
.fb-legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fb-legend .fb-slot { display: inline-block; width: 16px; height: 12px; flex: none; border-radius: 2px; cursor: default; margin-left: 8px; }
.fb-info { display: flex; gap: 10px; flex-wrap: wrap; }
.fb-conflict { color: var(--danger); }
.fb-ok { color: var(--success); }

/* pripomienky – zvonček v hornej lište */
.rem-wrap { position: relative; }
.rem-btn { position: relative; }
.rem-btn .badge { position: absolute; top: 0; right: 0; min-width: 16px; height: 16px; font-size: 10px; }
.rem-btn.ringing svg { animation: ring 1.4s ease-in-out infinite; transform-origin: 50% 10%; }
@keyframes ring { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20%, 40% { transform: rotate(-14deg); } }
@media (prefers-reduced-motion: reduce) { .rem-btn.ringing svg { animation: none; } }
.rem-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; width: min(360px, calc(100vw - 16px)); max-height: 70vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; }
.rem-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 4px; font-size: 13px; }
.rem-row { display: flex; align-items: center; gap: 4px; padding: 2px; border-radius: 6px; }
.rem-row.missed .rem-main small { color: var(--danger); }
.rem-main { flex: 1; min-width: 0; display: flex; flex-direction: column; border: 0; background: none; color: inherit; font: inherit; text-align: left; padding: 6px; border-radius: 6px; cursor: pointer; }
.rem-main:hover { background: var(--hover); }
.rem-main b, .rem-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rem-main small { color: var(--muted); font-size: 12px; }
.rem-actions { display: flex; align-items: center; gap: 2px; }
.rem-actions select { height: 28px; font-size: 12px; width: auto; padding: 0 4px; }
.rem-toggle { padding: 4px 8px; font-size: 13px; }
.rem-link { display: block; padding: 8px; text-align: center; font-size: 13px; border-top: 1px solid var(--border); margin-top: 4px; }
.empty.small { padding: 10px; font-size: 13px; }

@media (max-width: 900px) {
  .cal-layout { grid-template-columns: 1fr; }
  .cal-side { display: none; }
  .ev-cols { grid-template-columns: 1fr; }
  .ag-day { grid-template-columns: 1fr; gap: 4px; }
  .cal-headbar .hide-sm { display: none; }
  .mcell { min-height: 64px; padding: 2px; }
  .cal-chip { font-size: 10px; padding: 0 3px; }
  .cal-chip .chip-time { display: none; }
  .tg { --tw: 40px; }
  .tg-dayhead { flex-direction: column; align-items: center; gap: 0; font-size: 10px; }
  .tg-dayhead b { font-size: 15px; }
  .tg-ev { padding: 1px 3px 1px 5px; font-size: 11px; }
  .tg-ev small { display: none; }
}

/* tlač kalendára */
@media print {
  body[data-module=calendar] .rail, body[data-module=calendar] .topbar, body[data-module=calendar] .cal-side,
  body[data-module=calendar] .cal-headbar .actions, body[data-module=calendar] .cal-nav button, .ev-pop, .chat-dock, #toasts { display: none !important; }
  body[data-module=calendar], body[data-module=calendar] #app, body[data-module=calendar] .main, body[data-module=calendar] .view { display: block !important; height: auto !important; overflow: visible !important; background: #fff !important; }
  body[data-module=calendar] .cal-layout { display: block; }
  body[data-module=calendar] .tg-body, body[data-module=calendar] .agenda, body[data-module=calendar] .month { overflow: visible !important; height: auto !important; }
  body[data-module=calendar] .month { grid-template-rows: auto repeat(6, 120px); }
  body[data-module=calendar] .tg-ev, body[data-module=calendar] .cal-chip { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body[data-module=calendar] .tg-col::before { display: none; }
}
.tg-ev b svg, .cal-chip svg, .ag-item b svg { display: inline-block; vertical-align: -1px; }
.inv-actions .btn.small { flex: 1; padding: 0 6px; min-width: 0; }
.ev-pop-head .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ev-pop-head .grow b { font-size: 16px; line-height: 1.3; word-break: break-word; }
.ev-pop-head .grow small::first-letter { text-transform: uppercase; }
.ev-dt input { width: 100%; }
.tg-dayhead, .mhead { text-transform: none; }
/* značka pozvánky v kalendári */
.inv-mark { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; flex: none; margin-right: 3px; vertical-align: -2px; color: #fff; background: var(--muted); }
.inv-mark svg { stroke-width: 3; }
.inv-mark.ok { background: var(--success); }
.inv-mark.maybe { background: var(--warning); }
.inv-mark.no { background: var(--danger); }
.cal-chip.allday .inv-mark { box-shadow: 0 0 0 1.5px #fff; }
.ev-invite-note { margin: 0; align-items: flex-start; }
.ev-invite-note small { color: var(--muted); }
.ev-form :disabled { opacity: .75; cursor: not-allowed; }

/* ---------- chat: vyhľadávanie ---------- */
.chat-list { display: flex; flex-direction: column; }
.chat-search { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface); border-bottom: 1px solid var(--border); color: var(--muted); }
.chat-search input { flex: 1; height: 34px; border-radius: 999px; background: var(--surface-2); padding: 0 12px; }
.chat-items { flex: 1; }
.chat-sec { padding: 10px 14px 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.chat-sec small { text-transform: none; font-weight: 400; letter-spacing: 0; }
.search-hit .avatar.small { width: 34px; height: 34px; }
.search-hit .hit-text { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-hit .hit-text b { font-weight: 600; color: var(--text); }
.chat-list mark, .chat-mark { background: rgba(255, 200, 0, .45); color: inherit; border-radius: 2px; padding: 0 1px; }
.thread-search { display: flex; align-items: center; gap: 6px; padding: 6px 14px; border-bottom: 1px solid var(--border); background: var(--surface); color: var(--muted); }
.thread-search[hidden] { display: none; }
.thread-search input { flex: 1; min-width: 0; height: 30px; }
.ts-count { min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; }
.msg.found .bubble { box-shadow: 0 0 0 2px var(--warning); }
.newer-bar { display: flex; justify-content: center; gap: 8px; padding: 10px 0 4px; }

/* ---------- pošta: tabuľkový zoznam (náhľad dole / bez náhľadu) ---------- */
.mail-table { --mt-cols: 30px 22px minmax(150px, 1.3fr) minmax(220px, 3fr) minmax(130px, 1.2fr) 92px 72px 26px 26px; min-width: 720px; }
.mt-row, .mail-list.as-table .mail-item { display: grid; grid-template-columns: var(--mt-cols); align-items: center; column-gap: 8px; }
.mt-head { position: sticky; top: 0; z-index: 2; background: var(--surface); border-bottom: 1px solid var(--border); height: 34px; padding: 0 12px 0 11px; font-size: 12px; }
.mt-h { border: 0; background: none; font: inherit; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; height: 100%; padding: 0 4px; cursor: pointer; white-space: nowrap; min-width: 0; text-align: left; }
span.mt-h { cursor: default; }
.mt-h:hover { color: var(--text); }
.mt-h.on { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.mt-h.mt-ico, .mt-c.mt-ico { justify-content: center; padding: 0; }
.mt-h.mt-date, .mt-h.mt-size, .mt-c.mt-date, .mt-c.mt-size { justify-content: flex-end; text-align: right; }
.mt-group { padding: 12px 12px 4px 14px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface); list-style: none; }
.mail-list.as-table .mail-item { padding: 0 12px 0 11px; min-height: 36px; gap: 0; column-gap: 8px; font-size: 13.5px; }
.mail-list.as-table .mail-item.unread { font-weight: 600; }
.mt-c { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.mt-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mt-who .avatar.small { width: 24px; height: 24px; font-size: 10px; flex: none; }
.mt-subj .mi-ico { flex: none; color: var(--muted); display: inline-flex; }
.mt-tags { display: inline-flex; gap: 3px; flex: none; margin-left: 4px; }
.mt-other, .mt-size { color: var(--muted); }
.mail-item.unread .mt-other { color: var(--text); }
.mt-date, .mt-size { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mail-list.as-table .mi-cb { position: static; opacity: 0; }
.mail-list.as-table .mail-item:hover .mi-cb, .mail-list.as-table .mail-item.selected .mi-cb, .mail-list.as-table:has(.mail-item.selected) .mi-cb { opacity: 1; }
.mt-seen, .mt-del { border: 0; background: none; padding: 0; height: 26px; cursor: pointer; color: var(--muted); border-radius: 4px; }
.mt-dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid transparent; }
.mt-seen:hover .mt-dot { border-color: var(--muted); }
.mt-seen.on .mt-dot { background: var(--danger); border-color: var(--danger); }
.mt-del { opacity: 0; }
.mail-item:hover .mt-del, .mt-del:focus-visible { opacity: 1; }
.mt-del:hover { color: var(--danger); background: var(--hover); }
.mail-list.as-table .mi-flag { opacity: 0; }
.mail-list.as-table .mail-item:hover .mi-flag, .mail-list.as-table .mi-flag.on { opacity: 1; }
.mail-list.as-table { overflow-x: auto; }
/* hrubšia deliaca čiara medzi zoznamom a čítaním (náhľad dole) – ťahadlo leží priamo na nej */
.mail-layout.pane-bottom .mail-listpane .pane-resizer.rows { bottom: -7px; height: 9px; }
.mail-layout.pane-bottom .mail-listpane .pane-resizer.rows::after { top: 2px; height: 5px; }
/* hustejšie riadky tabuľky */
.mail-list.as-table .mail-item { min-height: 30px; }
.mail-list.as-table .mt-who .avatar.small { width: 22px; height: 22px; font-size: 9px; }
.mail-list.as-table .mt-seen, .mail-list.as-table .mt-del { height: 22px; }
.mail-list.as-table .tag-chip, .mail-list.as-table .mt-tags > * { line-height: 1.2; }
.mt-group { padding: 8px 12px 3px 14px; }
/* tagy v stĺpci Predmet zarovnané vpravo */
.mt-subj .mt-tags { margin-left: auto; padding-left: 8px; }
/* hlavička pošty: Nová správa vľavo, vyhľadávanie širšie v strede */
.mail-head { flex-wrap: nowrap; justify-content: flex-start; }
.mail-head h1 { display: none; }
.mail-head .mail-new { flex: none; }
.mail-head .mail-search { flex: 1 1 auto; max-width: 620px; margin: 0 auto; }
.mail-head .mail-search input[type=search] { width: auto; flex: 1; min-width: 0; }
.mail-head .mail-settings-btn { flex: none; }
/* horná lišta bez spoločného vyhľadávania */
.top-spacer { flex: 1; }
/* vyhľadávanie v pošte – rovnaký vzhľad ako bývalé horné (zaoblené, sivé pozadie) */
.mail-head .mail-search { height: 36px; border-radius: 18px; border-color: transparent; background: var(--surface-2); padding: 0 4px 0 12px; gap: 6px; }
.mail-head .mail-search:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mail-head .mail-search input[type=search] { height: 34px; box-shadow: none; }
.mail-head .mail-search input[type=search]:focus { box-shadow: none; }
.mail-head .mail-search .icon-btn { width: 30px; height: 30px; border-radius: 50%; }

/* ====================================================================== pravý bočný panel */
:root { --side-w: 300px; }
.main-body { flex: 1; display: flex; min-height: 0; min-width: 0; }
.main-body > .view { flex: 1; min-width: 0; }
.side-panel { display: none; width: var(--side-w); flex: none; flex-direction: column; border-left: 1px solid var(--border); background: var(--surface-2); min-height: 0; }
body.side-open .side-panel { display: flex; }
body.side-open .chat-dock { right: calc(var(--side-w) + 16px); }
.side-toggle.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.sp-sec { display: flex; flex-direction: column; min-height: 0; }
.sp-today { flex: 0 1 auto; max-height: 50%; border-bottom: 1px solid var(--border); }
.sp-chat { flex: 1 1 auto; }
.sp-head { display: flex; align-items: center; gap: 6px; padding: 10px 12px 6px; }
.sp-title { flex: 1; display: flex; align-items: baseline; gap: 6px; color: var(--text); text-decoration: none; min-width: 0; }
.sp-title svg { align-self: center; color: var(--muted); flex: none; }
.sp-title b { font-size: 14px; }
.sp-title small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-title:hover b { color: var(--accent); }
.sp-cal, .sp-chats { overflow-y: auto; padding: 0 8px 10px; min-height: 0; }
.sp-chats .chat-menu-item { border-radius: 8px; background: transparent; }
.sp-chats .chat-menu-item:hover { background: var(--hover); }
.sp-ev { display: flex; gap: 10px; width: 100%; border: 0; background: var(--surface); color: inherit; font: inherit; text-align: left; padding: 7px 10px; border-radius: 8px; margin-bottom: 4px; cursor: pointer; box-shadow: inset 3px 0 var(--cal); }
.sp-ev:hover { background: var(--hover); }
.sp-ev.past { opacity: .55; }
.sp-ev.now { background: color-mix(in srgb, var(--cal) 14%, var(--surface)); }
.sp-ev-time { width: 42px; flex: none; display: flex; flex-direction: column; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sp-ev-time small { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.sp-ev-body { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.sp-ev-body b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-ev-body small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-badge { color: var(--danger) !important; font-weight: 600; }
.sp-badge.next { color: var(--accent) !important; }
@media (max-width: 1100px) {
  body.side-open .side-panel { display: none; }
  body.side-open .chat-dock { right: 16px; }
  .side-toggle { display: none; }
}
.sp-chats.chat-menu-list { max-height: none; }
.sp-chats .chat-menu-item { padding: 8px 10px; border-bottom: 0; }
/* bočný panel – denné zobrazenie */
.sp-today { height: 48%; max-height: none; }
.sp-cal { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 0 0 0 0; overflow: hidden; position: relative; }
.sp-allday { display: flex; flex-direction: column; gap: 2px; padding: 0 8px 6px 48px; max-height: 64px; overflow-y: auto; flex: none; }
.sp-chip { border: 0; border-radius: 4px; background: var(--cal); color: #fff; font: inherit; font-size: 12px; padding: 2px 6px; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-scroll { flex: 1; overflow-y: auto; min-height: 0; border-top: 1px solid var(--border); background: var(--surface); }
.sp-grid { position: relative; margin-left: 44px; }
.sp-hour { position: absolute; left: -44px; width: 38px; text-align: right; transform: translateY(-50%); font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sp-col { position: absolute; inset: 0 6px 0 0; border-left: 1px solid var(--border); cursor: cell;
  background: repeating-linear-gradient(to bottom, var(--border) 0 1px, transparent 1px 20px, color-mix(in srgb, var(--border) 45%, transparent) 20px 21px, transparent 21px 40px); }
.sp-block { position: absolute; z-index: 2; border: 0; border-radius: 5px; padding: 2px 5px 2px 7px; text-align: left; font: inherit; color: var(--text); cursor: pointer; overflow: hidden;
  background: color-mix(in srgb, var(--cal) 18%, var(--surface)); box-shadow: inset 3px 0 var(--cal), 0 0 0 1px var(--surface); display: flex; flex-direction: column; }
.sp-block:hover { background: color-mix(in srgb, var(--cal) 28%, var(--surface)); z-index: 4; }
.sp-block b { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-block small { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-block.short { flex-direction: row; gap: 5px; align-items: center; padding-top: 0; padding-bottom: 0; }
.sp-block.past { opacity: .55; }
.sp-block.now { box-shadow: inset 3px 0 var(--cal), 0 0 0 1.5px var(--cal); }
.sp-now { position: absolute; left: -1px; right: 0; height: 2px; background: var(--danger); z-index: 3; pointer-events: none; }
.sp-now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.sp-empty { position: absolute; left: 50px; right: 10px; bottom: 8px; text-align: center; pointer-events: none; }
/* šírka bočného panela – ťahadlo na ľavom okraji */
.side-panel { position: relative; }
.side-resizer { position: absolute; top: 0; bottom: 0; left: -4px; width: 8px; cursor: col-resize; z-index: 6; touch-action: none; }
.side-resizer::after { content: ''; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: transparent; transition: background .15s; }
.side-resizer:hover::after, .side-resizer.dragging::after { background: var(--accent); }
body.resizing-x { cursor: col-resize; user-select: none; }
body.resizing-x iframe { pointer-events: none; }

/* ====================================================================== Úlohy */
.tk-head { flex-wrap: nowrap; }
.tk-search { flex: 1 1 auto; max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 6px; height: 36px; border-radius: 18px; background: var(--surface-2); padding: 0 12px; color: var(--muted); border: 1px solid transparent; }
.tk-search:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tk-search input[type=search] { flex: 1; border: 0; background: transparent; height: 34px; min-width: 0; box-shadow: none !important; }
.tk-head .actions { margin-left: 0; flex-wrap: nowrap; }
.tk-head .actions select { width: auto; }
.tk-layout { flex: 1; display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 0; background: var(--surface); }
.tk-side { background: var(--surface-2); border-right: 1px solid var(--border); padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.tk-filters { display: flex; flex-direction: column; gap: 1px; }
.tk-filter { display: flex; align-items: center; gap: 10px; border: 0; background: none; color: inherit; font: inherit; font-size: 14px; padding: 7px 10px; border-radius: 8px; cursor: pointer; text-align: left; }
.tk-filter svg { color: var(--muted); }
.tk-filter:hover { background: var(--hover); }
.tk-filter.on { background: var(--selected); color: var(--accent); font-weight: 600; }
.tk-filter.on svg { color: var(--accent); }
.tk-filter small { color: var(--muted); font-variant-numeric: tabular-nums; }
.tk-filter.warn small { color: var(--danger); font-weight: 700; }
.tk-listname { border: 0; background: none; color: inherit; font: inherit; font-size: 13px; text-align: left; padding: 0; cursor: pointer; }
.tk-listrow.active { background: var(--selected); }
.tk-count { font-variant-numeric: tabular-nums; }
.tk-main { min-width: 0; min-height: 0; overflow-y: auto; padding: 12px 24px 40px; }
.tk-titlebar { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; flex-wrap: wrap; }
.tk-titlebar h2 { margin: 0; font-size: 20px; flex: 1; }
.tk-titlebar h2 small { font-size: 14px; font-weight: 400; }
.tk-quick { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px dashed var(--border); border-radius: 10px; color: var(--muted); margin-bottom: 12px; background: var(--surface); }
.tk-quick:focus-within { border-style: solid; border-color: var(--accent); color: var(--accent); }
.tk-quick-input { flex: 1; border: 0 !important; background: transparent !important; height: 42px !important; font-size: 14px; box-shadow: none !important; padding: 0 !important; }
.tk-list { list-style: none; margin: 0; padding: 0; }
.tk-group { padding: 14px 4px 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tk-group.overdue { color: var(--danger); }
.tk-group.today { color: var(--accent); }
.tk-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; position: relative; }
.tk-row:hover { background: var(--hover); }
.tk-row:focus-visible { outline: 2px solid var(--accent); }
.tk-row + .tk-row, li + li > .tk-row { border-top-color: var(--border); border-radius: 0; }
.tk-check { flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--cal, var(--muted)); background: transparent; display: grid; place-items: center; padding: 0; cursor: pointer; color: #fff; }
.tk-check:hover { background: color-mix(in srgb, var(--cal) 18%, transparent); }
.tk-check.on { background: var(--success); border-color: var(--success); }
.tk-check:disabled { cursor: not-allowed; opacity: .5; }
.tk-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tk-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tk-subject { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-row.done .tk-subject { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.tk-prio { font-weight: 800; flex: none; }
.tk-prio.high { color: var(--danger); }
.tk-prio.low { color: var(--muted); }
.tk-ico { color: var(--muted); display: inline-flex; flex: none; }
.tk-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; min-width: 0; }
.tk-meta:empty { display: none; }
.tk-list-chip { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.tk-list-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--cal); }
.tk-status { padding: 1px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text); }
.tk-status.s-InProgress { background: var(--accent-soft); color: var(--accent); }
.tk-status.s-Waiting { background: rgba(194, 124, 14, .14); color: var(--warning); }
.tk-status.s-Deferred { background: var(--surface-3); color: var(--muted); }
.tk-pct { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tk-pct-bar { width: 60px; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.tk-pct-bar i { display: block; height: 100%; background: var(--accent); }
.tk-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.tk-due { flex: none; font-size: 13px; color: var(--muted); white-space: nowrap; padding-top: 1px; }
.tk-due.overdue { color: var(--danger); font-weight: 600; }
.tk-due.today { color: var(--accent); font-weight: 600; }
.tk-due.tomorrow { color: var(--text); }
.tk-del { opacity: 0; flex: none; }
.tk-row:hover .tk-del, .tk-del:focus-visible { opacity: 1; }
.tk-del:hover { color: var(--danger); }
/* dialóg úlohy */
.tk-grid { display: grid; grid-template-columns: 70px 1fr; gap: 8px 10px; align-items: center; }
.tk-dt { display: grid; grid-template-columns: 1fr 110px auto; gap: 6px; align-items: center; }
.tk-dt[hidden] { display: none; }
.tk-pct-row { display: flex; align-items: center; gap: 8px; height: 34px; }
.tk-pct-row input[type=range] { flex: 1; accent-color: var(--accent); }
.tk-pct-out { width: 42px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.tk-extra { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .tk-layout { grid-template-columns: 1fr; }
  .tk-side { display: none; }
  .tk-main { padding: 8px 12px 30px; }
  .tk-head .actions select { display: none; }
  .tk-desc { display: none; }
}
@media print {
  body[data-module=tasks] .rail, body[data-module=tasks] .topbar, body[data-module=tasks] .tk-side, body[data-module=tasks] .tk-head,
  body[data-module=tasks] .tk-quick, body[data-module=tasks] .tk-del, body[data-module=tasks] .side-panel, body[data-module=tasks] .chat-dock { display: none !important; }
  body[data-module=tasks], body[data-module=tasks] #app, body[data-module=tasks] .main, body[data-module=tasks] .main-body, body[data-module=tasks] .view,
  body[data-module=tasks] .tk-layout, body[data-module=tasks] .tk-main { display: block !important; height: auto !important; overflow: visible !important; background: #fff !important; }
  body[data-module=tasks] .tk-row { break-inside: avoid; }
}
.tk-meta > span { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- úlohy: tabuľka (štýl ako v klasických webových klientoch) ---------- */
.tk-main { display: flex; flex-direction: column; padding: 12px 16px 0; overflow: hidden; }
.tk-tablewrap { flex: 1; overflow: auto; min-height: 0; border-top: 1px solid var(--border); margin: 0 -16px; }
.tk-table { --tt-cols: 34px 30px 32px minmax(220px, 3fr) 28px 28px 28px 116px 116px minmax(150px, 1.5fr) 36px; min-width: 820px; }
.tt-row { display: grid; grid-template-columns: var(--tt-cols); align-items: center; column-gap: 6px; padding: 0 8px; min-height: 30px; border-bottom: 1px solid var(--border); font-size: 13.5px; cursor: pointer; }
.tt-row:not(.tt-head):hover { background: var(--hover); }
.tt-row.selected { background: var(--accent-soft); }
.tt-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tt-head { position: sticky; top: 0; z-index: 2; background: var(--surface); min-height: 36px; cursor: default; font-size: 12.5px; }
.tt-h { border: 0; background: none; font: inherit; color: var(--muted); height: 36px; padding: 0 6px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; text-align: left; white-space: nowrap; min-width: 0; }
span.tt-h { cursor: default; }
.tt-h:hover { color: var(--text); }
.tt-h.on { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }
.tt-arrow { font-size: 9px; }
.tt-h.tt-ico, .tt-c.tt-ico { justify-content: center; padding: 0; }
.tt-c { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; color: var(--text); }
.tt-c.tt-ico { color: var(--muted); }
.tt-row input[type=checkbox] { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.tt-subject .tt-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tt-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cal); flex: none; }
.tt-subject .tk-pct-bar { flex: none; width: 46px; }
.tt-row.done .tt-txt { text-decoration: line-through; color: var(--muted); }
.tt-row.prio-high:not(.done) .tt-txt { font-weight: 600; }
.tt-date { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text); }
.tt-date.overdue { color: var(--danger); font-weight: 600; }
.tt-date.today { color: var(--accent); font-weight: 600; }
.tt-row.done .tt-date { color: var(--muted); }
.tt-cats { gap: 4px; flex-wrap: nowrap; }
.tk-cat { display: inline-flex; align-items: center; gap: 3px; flex: none; padding: 1px 8px; border-radius: 6px; background: var(--cat); color: #fff; font-size: 11.5px; font-weight: 500; line-height: 1.5; white-space: nowrap; }
.tk-cat-x { border: 0; background: none; color: #fff; padding: 0 0 0 2px; cursor: pointer; font-size: 13px; line-height: 1; opacity: .8; }
.tk-cat-x:hover { opacity: 1; }
.tt-status { border: 0; background: none; cursor: pointer; height: 26px; width: 26px; border-radius: 50%; }
.tt-status:disabled { cursor: default; opacity: .6; }
.tt-circle { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--muted); }
.tt-status:hover .tt-circle { border-color: var(--success); background: color-mix(in srgb, var(--success) 15%, transparent); }
.tt-badge { width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid currentColor; }
.tt-status.s-InProgress { color: var(--success); }
.tt-status.s-Completed .tt-badge { background: var(--success); border-color: var(--success); color: #fff; }
.tt-status.s-Waiting { color: var(--warning); }
.tt-status.s-Deferred { color: var(--muted); }
.tt-del { border: 0; background: none; cursor: pointer; height: 26px; width: 26px; border-radius: 6px; opacity: 0; }
.tt-row:hover .tt-del, .tt-del:focus-visible { opacity: 1; }
.tt-del:hover { color: var(--danger); background: var(--surface-3); }
.tk-bulk { display: flex; align-items: center; gap: 8px; padding: 6px 10px; margin-bottom: 8px; border-radius: 8px; background: var(--accent-soft); flex-wrap: wrap; }
.tk-bulk b { margin-right: auto; font-size: 13px; }
.btn.danger { color: var(--danger); }
.tk-quick { margin-bottom: 10px; }
.tk-catrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; background: none; padding: 3px 6px; border-radius: 6px; cursor: pointer; font: inherit; }
.tk-catrow:hover, .tk-catrow.on { background: var(--hover); }
.tk-catrow.on { box-shadow: inset 0 0 0 1.5px var(--accent); }
.tk-catedit { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.tk-catedit input { flex: 1; min-width: 120px; height: 30px; }
@media print { body[data-module=tasks] .tk-tablewrap { overflow: visible !important; } body[data-module=tasks] .tt-del, body[data-module=tasks] .tk-bulk { display: none !important; } }
/* prílohy úlohy */
.tk-files { display: flex; flex-direction: column; gap: 4px; }
.tk-file { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; background: var(--surface-2); min-width: 0; }
.tk-file.pending { opacity: .8; }
.tk-file-ico { width: 32px; height: 32px; display: grid; place-items: center; color: var(--muted); flex: none; }
.tk-thumb { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 4px; overflow: hidden; cursor: zoom-in; flex: none; background: var(--surface-3); }
.tk-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tk-file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 4px; }
a.tk-file-name:hover { color: var(--accent); text-decoration: underline; }
.tk-upbar { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; min-width: 60px; margin-left: 8px; }
.tk-upbar i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.modal.tk-drop { box-shadow: 0 0 0 3px var(--accent), var(--shadow); }
/* úlohy – prepojené e-maily */
.tk-mail .avatar.small { width: 30px; height: 30px; flex: none; }
.tk-mail-main { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.tk-mail-main b { font-size: 13px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-mail-main small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-mail-main:hover b { color: var(--accent); }
.modal.tk-mail-modal { width: min(900px, calc(100vw - 32px)); max-width: 900px; }
.tk-mailview { display: flex; flex-direction: column; gap: 10px; }
.tk-mail-head { display: flex; align-items: flex-start; gap: 12px; }
.tk-mail-head .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13.5px; }
.tk-mail-row { overflow-wrap: anywhere; }
.tk-mail-row .muted:first-child { margin-right: 6px; }
.tk-mail-files { display: flex; flex-wrap: wrap; gap: 6px; }
.tk-mail-file { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; color: var(--text); text-decoration: none; }
.tk-mail-file:hover { border-color: var(--accent); color: var(--accent); }
.tk-mail-frame { width: 100%; height: min(60vh, 560px); border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.tk-pick { display: flex; flex-direction: column; max-height: 50vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
.tk-pick-row { display: flex; align-items: center; gap: 8px; border: 0; border-bottom: 1px solid var(--border); background: none; padding: 9px 12px; font: inherit; font-size: 14px; color: inherit; text-align: left; cursor: pointer; }
.tk-pick-row:last-child { border-bottom: 0; }
.tk-pick-row:hover { background: var(--hover); }
.modal .form > input[type=search] { width: 100%; }
.tk-pick-mail .avatar.small { width: 30px; height: 30px; flex: none; }
.tk-pick-text { display: flex; flex-direction: column; min-width: 0; }
.tk-pick-text b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-pick-text b.unread { font-weight: 700; }
.tk-pick-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-pick-state { color: var(--accent); margin-left: 6px; }
.tk-pick-row.busy { opacity: .7; pointer-events: none; }
.tk-pick-bar { display: flex; gap: 8px; }
.tk-pick-bar select { flex: 0 0 220px; min-width: 0; }
.tk-pick-bar input[type=search] { flex: 1; min-width: 0; }
@media (max-width: 600px) { .tk-pick-bar { flex-direction: column; } .tk-pick-bar select { flex: none; } }
/* rýchly filter „iba neprečítané“ */
.quick-unread { position: relative; }
.quick-unread .qu-dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 1.5px var(--surface); }
.quick-unread.active { background: var(--accent-soft); color: var(--accent); }
.qu-label { color: var(--accent); font-weight: 600; }

/* ====================================================================== prehliadač príloh */
.fv-overlay { position: fixed; inset: 0; z-index: 400; background: rgba(10, 14, 22, .88); display: flex; flex-direction: column; }
.fv-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; color: #fff; flex: none; }
.fv-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fv-title b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fv-title small { color: rgba(255, 255, 255, .65); font-size: 12px; }
.fv-actions { display: flex; gap: 4px; }
.fv-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .1); color: #fff; display: inline-grid; place-items: center; cursor: pointer; text-decoration: none; }
.fv-btn:hover, .fv-btn:focus-visible { background: rgba(255, 255, 255, .22); outline: none; }
.fv-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 64px 20px; overflow: auto; }
.fv-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); cursor: zoom-in; background: #fff; }
.fv-stage.zoom { align-items: flex-start; justify-content: flex-start; }
.fv-stage.zoom img { max-width: none; max-height: none; cursor: zoom-out; margin: auto; }
.fv-frame { width: min(1100px, 100%); height: 100%; border: 0; border-radius: 6px; background: #fff; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.fv-stage video { max-width: 100%; max-height: 100%; border-radius: 6px; background: #000; }
.fv-audio, .fv-none { display: flex; flex-direction: column; align-items: center; gap: 14px; color: #fff; text-align: center; background: rgba(255, 255, 255, .06); padding: 32px 40px; border-radius: 14px; max-width: 460px; }
.fv-audio b, .fv-none b { font-size: 16px; overflow-wrap: anywhere; }
.fv-none p { margin: 0; color: rgba(255, 255, 255, .7); }
.fv-audio audio { width: 340px; max-width: 100%; }
.fv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; display: grid; place-items: center; cursor: pointer; }
.fv-nav:hover { background: rgba(255, 255, 255, .25); }
.fv-nav.prev { left: 10px; }
.fv-nav.next { right: 10px; }
.fv-nav[hidden] { display: none; }
@media (max-width: 700px) { .fv-stage { padding: 0 8px 12px; } .fv-nav { width: 40px; height: 40px; top: auto; bottom: 16px; transform: none; } }
/* zoskupené správy (rovnaký autor do 1 h): meno iba nad prvou, čas iba pod poslednou */
.msg.grp-cont { margin-top: -2px; }
.msg.grp-cont .msg-author { display: none; }
.msg.grp-more .msg-time { display: none; }
.msg.grp-cont .bubble { border-top-left-radius: 4px; }
.msg.mine.grp-cont .bubble { border-top-left-radius: 12px; border-top-right-radius: 4px; }
.msg.grp-cont .msg-reply { margin-top: 0; }
/* bočný panel: posledné konverzácie bez dátumu */
.sp-chats .chat-item-top small { display: none; }
.sp-grid { margin-top: 8px; margin-bottom: 8px; }
/* bočný panel: mimo pracovného času vyblednuté */
.sp-col::before { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: linear-gradient(to bottom, var(--surface-2) var(--ws), transparent var(--ws), transparent var(--we), var(--surface-2) var(--we)); opacity: .85; }
.sp-hour { z-index: 1; }

/* ====================================================================== Kontakty (zoznam + detail) */
.ct-head { flex-wrap: nowrap; }
.ct-layout { flex: 1; display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); min-height: 0; background: var(--surface); }
.ct-listpane { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); }
.ct-listbar { display: flex; align-items: baseline; gap: 4px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.ct-list { flex: 1; overflow-y: auto; outline: none; }
.ct-letter { position: sticky; top: 0; z-index: 1; padding: 6px 14px 4px; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.ct-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 14px; border: 0; border-bottom: 1px solid var(--border); border-left: 3px solid transparent; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.ct-item:hover { background: var(--hover); }
.ct-item.active { background: var(--selected); border-left-color: var(--accent); }
.ct-item .avatar.small { flex: none; }
.ct-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ct-main b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-main small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-src { font-size: 10px; text-transform: uppercase; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.ct-detail { min-width: 0; overflow-y: auto; }
.ct-detail > .empty { margin-top: 60px; }
.ct-card { max-width: 640px; padding: 28px 32px; display: flex; flex-direction: column; gap: 18px; }
.ct-back { display: none; align-self: flex-start; }
.ct-hero { display: flex; align-items: center; gap: 16px; }
.ct-hero .avatar.large { width: 64px; height: 64px; font-size: 22px; flex: none; }
.ct-hero h2 { margin: 0; font-size: 22px; }
.ct-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ct-actions .icon-btn.call.with-label { width: auto; padding: 0 12px; height: 34px; border: 1px solid var(--border); border-radius: 8px; gap: 6px; display: inline-flex; align-items: center; }
.ct-sec h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ct-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); margin-bottom: 4px; font-size: 14px; }
.ct-row a { color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.ct-row a:hover { color: var(--accent); }
.ct-type { width: 80px; flex: none; font-size: 12px; color: var(--muted); }
@media (max-width: 800px) {
  .ct-layout { grid-template-columns: 1fr; }
  .ct-layout.has-detail .ct-listpane { display: none; }
  .ct-layout:not(.has-detail) .ct-detail { display: none; }
  .ct-back { display: inline-flex; }
  .ct-card { padding: 16px; }
}
/* kontakty – adresáre, detail, úprava */
.ct-new { display: flex; gap: 6px; flex: none; }
.ct-listbar { align-items: center; }
.ct-booksel { flex: 1; min-width: 0; height: 30px; font-weight: 600; border-color: transparent; background: transparent; padding-left: 2px; }
.ct-booksel:hover { background: var(--hover); }
.ct-hero .avatar.large { position: relative; overflow: hidden; }
.avatar.group { background: var(--surface-3); color: var(--muted); }
.avatar.has-img .avatar-img, .ct-hero .avatar.has-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.ct-hero .grow { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ct-hero small svg { vertical-align: -2px; }
.ct-addr { overflow-wrap: anywhere; }
.ct-cats { display: flex; flex-wrap: wrap; gap: 4px; }
.ct-notes { white-space: pre-wrap; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); font-size: 14px; overflow-wrap: anywhere; }
.ct-row .avatar.small { width: 28px; height: 28px; font-size: 10px; flex: none; }
.modal.ct-modal { width: min(820px, calc(100vw - 32px)); max-width: 820px; }
.ct-form { gap: 12px; }
.ct-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 10px; }
.ct-grid.name { grid-template-columns: 80px 1fr 1fr 1.2fr 80px; }
.ct-grid .field, .ct-form .field { margin: 0; }
.ct-block { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.ct-block > b { font-size: 13px; }
.ct-rep { display: flex; flex-direction: column; gap: 6px; }
.ct-rep-row { display: flex; align-items: flex-start; gap: 6px; }
.ct-rep-type { flex: 0 0 130px; }
.ct-rep-fields { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.ct-rep-fields input:first-child:nth-last-child(4) { grid-column: span 1; }
.ct-rep-add { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--accent); cursor: pointer; padding: 2px 0; font: inherit; font-size: 13px; }
.ct-members { display: flex; flex-wrap: wrap; gap: 4px; min-height: 28px; align-items: center; }
@media (max-width: 700px) {
  .ct-grid, .ct-grid.name { grid-template-columns: 1fr 1fr; }
  .ct-rep-row { flex-wrap: wrap; }
  .ct-rep-type { flex: 1 1 100%; }
  .ct-rep-fields { grid-auto-flow: row; }
}
@media print {
  body[data-module=contacts] .rail, body[data-module=contacts] .topbar, body[data-module=contacts] .ct-head, body[data-module=contacts] .ct-listpane,
  body[data-module=contacts] .ct-actions, body[data-module=contacts] .side-panel, body[data-module=contacts] .chat-dock { display: none !important; }
  body[data-module=contacts] .ct-layout { display: block; }
}
.ct-hero small { display: inline-flex; align-items: center; gap: 4px; }
/* kontakty – panel adresárov ako priečinky v pošte */
.ct-layout { grid-template-columns: 220px minmax(280px, 360px) minmax(0, 1fr); }
.ct-folderpane { min-height: 0; }
.ct-folders button.fold { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 6px 4px 6px 2px; border: 0; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.ct-folders .fold-count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; margin-left: auto; padding-right: 4px; }
.ct-folders .fold-row.active .fold-count { color: var(--accent); }
.ct-fold-title { display: flex; align-items: center; padding-right: 4px; }
.ct-foot { gap: 2px; }
.ct-footbtn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; padding: 4px 6px; border-radius: 6px; cursor: pointer; text-align: left; }
.ct-footbtn:hover { background: var(--hover); color: var(--text); }
.ct-title { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1100px) { .ct-layout { grid-template-columns: 190px minmax(240px, 300px) minmax(0, 1fr); } }
@media (max-width: 900px) {
  .ct-layout { grid-template-columns: 1fr; }
  .ct-folderpane { display: none; }
}

/* ====================================================================== dialóg úlohy – jednotný vzhľad */
.modal.tkd-modal { width: min(980px, calc(100vw - 32px)); max-width: 980px; }
.tkd { display: flex; flex-direction: column; gap: 14px; }
.tkd-title { width: 100%; height: auto !important; border: 0 !important; border-bottom: 2px solid var(--border) !important; border-radius: 0 !important;
  padding: 4px 2px 10px !important; font-size: 21px; font-weight: 600; background: transparent !important; box-shadow: none !important; }
.tkd-title:focus { border-bottom-color: var(--accent) !important; }
.tkd-cols { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); gap: 22px; align-items: start; }
.tkd-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
/* sekcie vľavo (popis, prílohy, e-maily) – rovnaké nadpisy, bez rámčekov */
.tkd-sec h4, .tkd-main .ev-block > b, .tkd-main .ev-block-head > b {
  display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tkd-main .ev-block { border: 0; padding: 0; border-radius: 0; gap: 8px; }
.tkd-main .ev-block-head { margin-bottom: 0; }
.tkd-main .ev-block-head > b { margin: 0; }
.tkd-desc { width: 100%; min-height: 150px; resize: vertical; background: var(--surface-2) !important; border-color: transparent !important; border-radius: 10px !important; padding: 10px 12px !important; font-size: 14px; line-height: 1.5; }
.tkd-desc:focus { background: var(--surface) !important; border-color: var(--accent) !important; }
.tkd-main .tk-file { background: var(--surface-2); border-radius: 8px; }
/* panel vlastností vpravo */
.tkd-side { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--surface-2); border-radius: 12px; }
.tkd-prop { display: grid; grid-template-columns: 108px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 40px; }
.tkd-label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.tkd-label svg { flex: none; }
.tkd-ctrl { min-width: 0; display: flex; align-items: center; gap: 6px; }
.tkd-ctrl > select, .tkd-ctrl > input[type=text] { width: 100%; }
.tkd-side select, .tkd-side input[type=text], .tkd-side input[type=date], .tkd-side input[type=time] { height: 32px; background: var(--surface); }
.tkd-ctrl .tk-dt { width: 100%; grid-template-columns: minmax(0, 1fr) 92px 24px; gap: 4px; }
.tkd-ctrl .tk-pct-row { width: 100%; height: 32px; }
.tkd-sep { height: 1px; background: var(--border); margin: 6px 0; }
.tkd-sub { padding-left: 116px; }
.tkd-sub:has(> [hidden]) { display: none; }
.tkd-sub .tk-dt { grid-template-columns: minmax(0, 1fr) 92px 24px; gap: 4px; }
.tkd-side .ev-recur { margin: 2px 0 6px 116px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; }
.tkd-side .ev-recur[hidden] { display: none; }
.tkd-side .ev-days { flex-wrap: wrap; }
.tkd-side .ev-day { width: 26px; height: 26px; font-size: 11px; }
.tkd-ctrl .tk-catedit { width: 100%; }
.tkd-ctrl .tk-catedit input { height: 30px; min-width: 90px; }
.tkd-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.tkd-switch input { width: 16px; height: 16px; accent-color: var(--accent); }
.tkd-cal { align-self: flex-start; margin-top: 8px; }
@media (max-width: 820px) {
  .tkd-cols { grid-template-columns: 1fr; }
  .tkd-side { order: -1; }
  .tkd-sub, .tkd-side .ev-recur { padding-left: 0; margin-left: 0; }
}
/* dialóg udalosti v rovnakom dizajne ako úloha */
.tkd-dt { display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: 4px; width: 100%; }
.tkd-main .ev-people { background: var(--surface-2); border-color: transparent; border-radius: 10px; }
.tkd-main .ev-people:focus-within { background: var(--surface); border-color: var(--accent); }
.tkd-main .room-row { padding: 6px 10px; border-radius: 8px; background: var(--surface-2); }
.tkd-side .ev-recur .row-inline { flex-wrap: wrap; gap: 6px; }
.tkd .ev-invite-note { margin: 0; }
/* úlohy – zjednotenie príznakov */
.tk-merge-hint { color: var(--warning); position: relative; }
.tk-merge-hint::after { content: ''; position: absolute; top: 2px; right: 2px; width: 6px; height: 6px; border-radius: 50%; background: var(--warning); }
.modal.tk-merge-modal { width: min(680px, calc(100vw - 32px)); }
.tk-merge section { display: flex; flex-direction: column; gap: 8px; }
.tk-merge h4 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tk-merge p { margin: 0; }
.tk-merge-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); flex-wrap: wrap; }
.tk-merge-chips { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; min-width: 160px; }
.tk-merge-row select { width: auto; max-width: 200px; }
.tk-merge-all { display: flex; flex-wrap: wrap; gap: 6px; max-height: 200px; overflow-y: auto; }
.tk-merge-pick { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 6px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.tk-merge-pick:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.tk-merge-manual { display: flex; gap: 8px; }
.tk-merge-manual input { flex: 1; }
/* mesiac: „+“ pri čísle dňa po prejdení myšou → nová udalosť v daný deň */
.mcell-head { display: flex; align-items: center; justify-content: space-between; }
.madd { width: 22px; height: 22px; border-radius: 6px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0; opacity: 0; transition: opacity .12s; }
.mcell:hover .madd, .madd:focus-visible { opacity: 1; }
.madd:hover { background: var(--accent-soft); color: var(--accent); }
@media (hover: none) { .madd { display: none; } }
/* nastavenia pošty – zvuk a sledované priečinky */
.ms-volume { gap: 10px; }
.ms-volume input[type=range] { width: 160px; accent-color: var(--accent); }
.ms-watchlist { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.ms-watch-group { margin-top: 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ms-watch { font-size: 14px; }

/* ====================================================================== Intranet */
.in-head { flex-wrap: nowrap; }
.in-heading { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; flex: none; }
.in-heading svg { color: var(--accent); }
.in-actions { display: flex; gap: 8px; flex: none; }
.in-actions .btn.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.in-main { flex: 1; overflow-y: auto; padding: 20px 24px 40px; }
.in-sec + .in-sec { margin-top: 26px; }
.in-sec-title { margin: 0 0 12px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.in-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.in-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s; }
.in-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.in-card.editing { cursor: grab; }
.in-card.dragging { opacity: .4; }
.in-card.drop-before { box-shadow: -4px 0 0 var(--accent), var(--shadow); }
.in-img { display: grid; place-items: center; height: 130px; background: var(--surface-2); border-bottom: 1px solid var(--border); text-decoration: none; overflow: hidden; }
.in-img img { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.in-initial { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; font-size: 30px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), #7c3aed); }
.in-body { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.in-body h4 { margin: 0; font-size: 16px; }
.in-body p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.in-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; gap: 8px; }
.in-btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.in-tools { margin-left: auto; display: flex; gap: 2px; }
.in-empty { max-width: 460px; margin: 60px auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); }
.in-empty h3 { margin: 6px 0 0; color: var(--text); }
.in-preview { display: flex; align-items: center; gap: 12px; }
.in-preview img { width: 120px; height: 72px; object-fit: contain; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); padding: 6px; }
@media (max-width: 700px) { .in-main { padding: 12px; } .in-heading { display: none; } }
/* editor dokumentov (samostatná stránka) */
body.docs-editor-page { margin: 0; height: 100vh; overflow: hidden; }
#doc-editor, #doc-editor > div, #doc-editor iframe { height: 100vh; width: 100%; }
.docs-editor-error { max-width: 420px; margin: 80px auto; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; height: auto !important; }

/* ====================================================================== Dokumenty */
.dc-head { gap: 8px; flex-wrap: nowrap; }
.dc-tools { display: flex; align-items: center; gap: 8px; width: 100%; }
.dc-warn { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--warning); }
.dc-layout { flex: 1; display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 0; background: var(--surface); }
.dc-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.dc-main.dc-drop::after { content: 'Pusti súbory sem'; position: absolute; inset: 8px; border: 2px dashed var(--accent); border-radius: 12px; background: color-mix(in srgb, var(--accent) 8%, transparent);
  display: grid; place-items: center; font-weight: 600; color: var(--accent); pointer-events: none; }
.dc-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.dc-crumbs { flex: 1; display: flex; align-items: center; gap: 2px; min-width: 0; flex-wrap: wrap; color: var(--muted); }
.dc-crumb { border: 0; background: none; font: inherit; font-size: 15px; font-weight: 600; color: var(--text); padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.dc-crumb:hover { background: var(--hover); }
.dc-search { max-width: 280px; margin: 0; }
.dc-list { flex: 1; overflow-y: auto; }
.dc-table { min-width: 640px; }
.dc-row { display: grid; grid-template-columns: 44px minmax(200px, 1fr) 150px 160px 90px 36px; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.dc-row:not(.dc-headrow):hover { background: var(--hover); }
.dc-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dc-headrow { font-size: 12px; color: var(--muted); position: sticky; top: 0; background: var(--surface); z-index: 1; padding-top: 8px; padding-bottom: 8px; }
.dc-row .r { text-align: right; }
.dc-ico { width: 30px; height: 34px; display: grid; place-items: center; border-radius: 5px; font-size: 11px; font-weight: 800; color: #fff; justify-self: center; }
.dc-ico.doc { background: var(--c); }
.dc-ico.folder { color: #e0a526; }
.dc-ico.file { color: var(--muted); background: var(--surface-3); }
.dc-name { border: 0; background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-name:hover { color: var(--accent); }
.dc-badge { display: inline-flex; color: var(--muted); }
.dc-by { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 70px; color: var(--muted); }
.dc-empty p { margin: 0; }
.dc-versions { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow-y: auto; }
.dc-ver { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 14px; }
@media (max-width: 900px) {
  .dc-layout { grid-template-columns: 1fr; }
  .dc-layout .ct-folderpane { display: none; }
  .dc-row { grid-template-columns: 40px minmax(0, 1fr) 36px; }
  .dc-row > :nth-child(3), .dc-row > :nth-child(4), .dc-row > :nth-child(5) { display: none; }
  .dc-table { min-width: 0; }
}
