/* Polls in the calendar, image albums, reactions, sticky notes, favorites. */
/* Polls in the calendar */
.calendar-mark.is-poll { background: var(--cal-poll, #8b6fe0); }
.calendar-poll-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.calendar-poll-item {
  display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 10px; border: 1px solid rgba(139, 111, 224, .35);
  background: rgba(139, 111, 224, .08); color: inherit; font: inherit; cursor: pointer;
}
.calendar-poll-item:hover { background: rgba(139, 111, 224, .14); }
.calendar-poll-q { font-weight: 600; overflow-wrap: anywhere; }
.calendar-poll-meta { font-size: 12.5px; opacity: .72; }
.poll-card.is-scheduled { border-style: dashed; }

/* Image albums: mosaic of tiles that keep their orientation. */
.msg-album {
  position: relative; flex: 0 0 auto;
  width: 420px; max-width: 100%;
  border-radius: 12px; overflow: hidden;
  margin: 2px 0;
}
.msg.image-only .msg-album { margin: 0; }
.msg-album-tile { position: absolute; overflow: hidden; cursor: zoom-in; background: rgba(0, 0, 0, .06); }
.msg-album-img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
/* Time pill sits on the collage, bottom-right (the bubble is the positioning parent). */
.msg.image-only .msg-bubble > .msg-foot {
  position: absolute; right: 8px; bottom: 8px; margin: 0; z-index: 2;
}

/* Dialogue: the message under discussion is a compact preview (expandable). */
.dialogue-root-slot.is-collapsed .msg.is-dialogue-root .msg-bubble {
  max-height: 100px; overflow: hidden;
}
.dialogue-root-slot.is-collapsed.has-overflow .msg.is-dialogue-root .msg-bubble {
  -webkit-mask-image: linear-gradient(#000 62%, transparent);
  mask-image: linear-gradient(#000 62%, transparent);
}
.dialogue-root-slot.is-collapsed .msg-image { max-width: 72px; max-height: 48px; }
.dialogue-root-slot.is-collapsed .msg-album { width: 84px; }
.dialogue-root-slot.is-collapsed .msg-body { font-size: calc(14px * var(--text-scale, 1)); }
.dialogue-root-slot.is-collapsed .msg-body { display: flex; flex-direction: column; }
.dialogue-root-slot.is-collapsed .msg-caption { order: -1; margin: 0 0 3px; }
.dialogue-root-toggle {
  display: block; margin: 4px 0 0 2px; padding: 2px 4px; border: 0; background: none;
  color: var(--accent, #2f6fd6); font: inherit; font-size: calc(12.5px * var(--text-scale, 1));
  font-weight: 600; cursor: pointer;
}
.dialogue-root-toggle[hidden] { display: none; }

/* Reactions inside the bubble: roomy soft pills, clear gap from text and bubble edge. */
.msg-bubble > .msg-reactions {
  margin: 10px 0 4px; max-width: 100%; flex: none; gap: 6px 8px;
}
.msg-bubble .msg-reaction {
  border-color: transparent; box-shadow: none;
  background: color-mix(in srgb, var(--accent, #2f6fd6) 12%, #fff);
  padding: 6px 14px 6px 10px; gap: 7px; min-height: 34px; box-sizing: border-box;
}
.msg-bubble .msg-reaction:hover { background: color-mix(in srgb, var(--accent, #2f6fd6) 20%, #fff); border-color: transparent; }
.msg-bubble .msg-reaction.is-mine { background: color-mix(in srgb, var(--accent, #2f6fd6) 30%, #fff); border-color: transparent; }
.msg-bubble .msg-reaction-count { color: var(--accent, #2f6fd6); font-weight: 600; font-size: calc(15px * var(--text-scale, 1)); }
.msg-bubble .msg-reaction-emoji { font-size: calc(20px * var(--text-scale, 1)); line-height: 1; }
.msg-bubble .msg-reaction-emoji img.icq-smiley { width: 22px; height: 22px; }
/* Chips kept in the meta row (media / dialogue root): use the full width, push the time pill down if needed. */
.msg-meta { flex-wrap: wrap; }
.msg-meta .msg-reactions { max-width: 100%; }

/* Profile settings: every field (inputs, password rows, language select) has the same height. */
#profile-form input[type="text"],
#profile-form input[type="email"],
#profile-form input[type="password"],
#profile-form input:not([type]),
#profile-form select {
  height: 44px; min-height: 44px; box-sizing: border-box;
  padding-top: 0; padding-bottom: 0; line-height: 1.2;
}
#profile-form select {
  width: 100%; padding-left: 12px; padding-right: 12px;
  border: 1px solid #d0d4dc; border-radius: 4px; background-color: #fff;
  font: inherit; color: inherit;
}
.profile-pult-agent { margin: 0 0 8px; }
.profile-pult-agent-body { margin-top: 6px; }
.profile-pult-agent-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 14px; border: 1px solid #e8eaef; border-radius: 10px; background: #f8f9fb;
}
.profile-pult-agent-card strong { font-size: calc(14px * var(--text-scale, 1)); color: #1a1d26; }
.profile-pult-agent-note { margin: 0; font-size: calc(13px * var(--text-scale, 1)); color: #6b7080; line-height: 1.35; }
.profile-pult-agent-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Notes as sticky notes ── */
.notes-sticky-c0 { --st-bg: #fff3a8; --st-bd: #ecdc6f; }
.notes-sticky-c1 { --st-bg: #ffd9e2; --st-bd: #f3b3c3; }
.notes-sticky-c2 { --st-bg: #cfeedd; --st-bd: #a4d9bb; }
.notes-sticky-c3 { --st-bg: #d4e6ff; --st-bd: #a9c8f2; }
.notes-sticky-c4 { --st-bg: #e6dcff; --st-bd: #c7b6f0; }
.notes-sticky-c5 { --st-bg: #ffe2c2; --st-bd: #f1c291; }
.notes-item.notes-sticky {
  background: var(--st-bg); border: 1px solid var(--st-bd); border-radius: 6px 6px 14px 6px;
  box-shadow: 0 6px 14px rgba(40, 44, 60, .13), 0 1px 2px rgba(40, 44, 60, .1);
  min-height: 140px; max-height: 280px; overflow: hidden; padding: 14px 14px 12px; gap: 6px;
  transform: rotate(-.6deg); transition: transform .15s ease, box-shadow .15s ease;
}
.notes-grid > .notes-sticky:nth-child(even) { transform: rotate(.7deg); }
.notes-item.notes-sticky:hover {
  background: var(--st-bg); transform: translateY(-3px) rotate(0deg);
  box-shadow: 0 12px 22px rgba(40, 44, 60, .18);
}
.notes-sticky .notes-item-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notes-sticky .notes-item-preview { color: #4d5262; -webkit-line-clamp: 5; }
.notes-sticky .notes-item-meta { color: #7d7f6e; margin-top: auto; }
.notes-sticky-thumbs { display: flex; gap: 6px; align-items: center; }
.notes-sticky-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid rgba(0,0,0,.1); background: #fff; }
.notes-sticky-more { font-size: 12px; font-weight: 700; color: #5c6270; padding: 0 4px; }
.note-modal { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px; }
.note-modal-backdrop { position: absolute; inset: 0; background: rgba(10, 14, 22, .45); }
.note-modal-card {
  position: relative; width: min(560px, 100%); max-height: min(86vh, 720px); overflow: auto;
  background: var(--st-bg, #fff3a8); border: 1px solid var(--st-bd, #ecdc6f); border-radius: 8px 8px 18px 8px;
  padding: 18px; box-shadow: 0 24px 60px rgba(10, 14, 22, .35);
}
.note-modal-card .notes-editor-title, .note-modal-card .notes-editor-body { background: rgba(255,255,255,.62); }
.note-modal-card .notes-editor-rich { min-height: 180px; }
.note-modal-card .notes-inline-img-wrap { display: inline-block; margin: 4px 6px 4px 0; vertical-align: top; }
.note-modal-card .notes-inline-img { max-height: 84px; max-width: 120px; object-fit: cover; cursor: zoom-in; }
.note-modal-card .notes-inline-img-remove { width: 22px; height: 22px; top: 3px; right: 3px; font-size: 15px; }

/* ── avatar editor modal ── */
.avatar-crop-modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; }
.avatar-crop-backdrop { position: absolute; inset: 0; background: rgba(10, 14, 22, .55); }
.avatar-crop-card {
  position: relative; width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px;
  background: #fff; border-radius: 18px; padding: 18px; box-shadow: 0 24px 60px rgba(10, 14, 22, .35);
}
.avatar-crop-title { font-weight: 800; font-size: 17px; color: #1a1d26; }
.avatar-crop-frame { border-radius: 22%; width: 200px; height: 200px; }

/* ── Favorites feature ── */
.fav-list { display: flex; flex-direction: column; gap: 8px; }
.fav-item {
  position: relative; background: #fff; border: 1px solid #e8eaef; border-radius: 12px;
  padding: 12px 40px 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 4px;
}
.fav-item:hover { background: #fafbfc; border-color: #d5d9e2; }
.fav-item-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.fav-item-who { font-weight: 700; color: #1a1d26; }
.fav-item-where, .fav-item-time { font-size: 12px; color: #8b8e98; }
.fav-item-time { margin-left: auto; }
.fav-item-text { color: #4d5262; font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.fav-item-star { position: absolute; top: 8px; right: 8px; appearance: none; border: 0; background: transparent; padding: 4px; border-radius: 8px; cursor: pointer; color: #b9bec9; display: grid; place-items: center; }
.fav-item-star.is-on { color: #f5b301; }

/* ── paper stickies with a pin, free-form board ── */
.notes-grid.notes-board { display: block; position: relative; width: 100%; min-height: 214px; padding: 0; }
.notes-item.notes-sticky {
  position: absolute; width: 200px; height: 200px; min-height: 0; max-height: none; box-sizing: border-box;
  padding: 34px 20px 14px 22px; gap: 5px; border: 0; border-radius: 2px;
  background: linear-gradient(135deg, #fff25e 0%, #fff7a0 45%, #fffbc2 100%);
  box-shadow: 7px 9px 9px rgba(20, 22, 30, .24), 1px 1px 0 rgba(0, 0, 0, .04);
  transform: rotate(var(--rot, 0deg)); transition: box-shadow .15s ease, transform .15s ease;
  cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; overflow: hidden;
}
.notes-grid > .notes-sticky:nth-child(even) { transform: rotate(var(--rot, 0deg)); }
.notes-item.notes-sticky:hover { background: linear-gradient(135deg, #fff25e 0%, #fff7a0 45%, #fffbc2 100%); transform: rotate(var(--rot, 0deg)) translateY(-2px); box-shadow: 9px 13px 14px rgba(20, 22, 30, .28); }
.notes-item.notes-sticky.is-dragging { cursor: grabbing; transition: none; transform: rotate(0deg) scale(1.03); box-shadow: 12px 18px 22px rgba(20, 22, 30, .32); }
.notes-sticky::before {
  content: ""; position: absolute; top: 9px; left: 50%; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #ff9a86 0%, #e8402a 42%, #b3200f 100%);
  box-shadow: 4px 6px 5px rgba(0, 0, 0, .3), inset -2px -2px 3px rgba(90, 10, 0, .35);
}
.notes-sticky .notes-item-title { font-size: 16px; }
.notes-sticky .notes-item-preview { -webkit-line-clamp: 4; }
.notes-sticky-thumb { width: 38px; height: 38px; }
.note-modal-card { background: linear-gradient(135deg, #fff25e 0%, #fff7a0 45%, #fffbc2 100%); border: 0; border-radius: 3px; padding-top: 30px; }
.note-modal-card::before {
  content: ""; position: absolute; top: 8px; left: 50%; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #ff9a86 0%, #e8402a 42%, #b3200f 100%);
  box-shadow: 4px 6px 5px rgba(0, 0, 0, .3), inset -2px -2px 3px rgba(90, 10, 0, .35);
}

/* touch: only the top strip (pin) drags a sticker; the rest still scrolls the page */
.notes-sticky-grip { position: absolute; top: 0; left: 0; right: 0; height: 40px; touch-action: none; z-index: 2; }

.fav-tabs { margin-bottom: 12px; }

/* ══ Paper stickies v3: cream sheet, torn top edge, coloured tape ══ */
.notes-item.notes-sticky {
  --paper: #faf3e8; --tape: #f4a6a6; --tape-rot: -35deg;
  background: none !important; border: 0; padding: 0; overflow: visible; box-shadow: none !important;
  filter: drop-shadow(6px 8px 5px rgba(70, 48, 20, .28));
}
.notes-item.notes-sticky:hover { background: none !important; box-shadow: none !important; filter: drop-shadow(8px 11px 8px rgba(70, 48, 20, .3)); }
.notes-item.notes-sticky.is-dragging { filter: drop-shadow(12px 16px 14px rgba(70, 48, 20, .34)); }
.notes-item.notes-sticky.is-open { opacity: 0; }
.notes-sticky::before { content: none !important; }
.notes-paper, .note-sheet-paper {
  background: var(--paper);
  -webkit-mask: radial-gradient(circle 4.5px at 50% 0, transparent 96%, #000) top left / 13px 9px repeat-x, linear-gradient(#000, #000) bottom left / 100% calc(100% - 4px) no-repeat;
  mask: radial-gradient(circle 4.5px at 50% 0, transparent 96%, #000) top left / 13px 9px repeat-x, linear-gradient(#000, #000) bottom left / 100% calc(100% - 4px) no-repeat;
}
.notes-paper {
  position: absolute; inset: 0; box-sizing: border-box; padding: 30px 18px 12px 22px;
  display: flex; flex-direction: column; gap: 5px; color: #3b3226; overflow: hidden; text-align: left;
}
.notes-sticky .notes-item-title { color: #3b3226; }
.notes-sticky .notes-item-preview { color: #5b4f40; }
.notes-sticky .notes-item-meta { color: #9a8c78; }
.notes-tape, .note-sheet-tape {
  position: absolute; top: -2px; left: -22px; width: 84px; height: 26px; z-index: 3; pointer-events: none;
  transform: rotate(var(--tape-rot, -35deg));
  background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0) 40%), color-mix(in srgb, var(--tape, #f4a6a6) 86%, transparent);
  clip-path: polygon(0 0, 100% 0, 96% 12%, 100% 25%, 96% 37%, 100% 50%, 96% 62%, 100% 75%, 96% 87%, 100% 100%, 0 100%, 4% 87%, 0 75%, 4% 62%, 0 50%, 4% 37%, 0 25%, 4% 12%);
}
.notes-sticky-grip { z-index: 4; }
/* The bin in a sticker's corner: shown on hover; folding away on delete */
.notes-sticky-del {
  position: absolute; top: 6px; right: 6px; z-index: 5; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, .88); color: #9a6a5c; cursor: pointer;
  box-shadow: 0 2px 6px rgba(70, 48, 20, .18); opacity: 0; transform: scale(.8); pointer-events: none;
  transition: opacity .15s ease, transform .15s ease, color .15s ease;
}
.notes-sticky-del svg { width: 16px; height: 16px; }
@media (hover: hover) {
  .notes-item.notes-sticky:hover .notes-sticky-del, .notes-item.notes-sticky:focus-visible .notes-sticky-del { opacity: 1; transform: none; pointer-events: auto; }
}
.notes-sticky-del:hover { background: #fff; color: #d24b4e; }
.notes-item.notes-sticky.is-dragging .notes-sticky-del { opacity: 0; }
.notes-item.notes-sticky.is-gone { pointer-events: none; transition: transform .25s ease, opacity .25s ease; transform: rotate(var(--rot, 0deg)) scale(.6) translateY(24px); opacity: 0; }
.toast.toast-undo { display: flex; align-items: center; gap: 16px; padding: 10px 10px 10px 16px; border-radius: 12px; box-shadow: 0 10px 28px rgba(0, 0, 0, .25); animation: toast-undo-in .2s ease; }
.toast.toast-undo button { appearance: none; border: 0; background: transparent; color: #f0c46a; font: inherit; font-weight: 800; padding: 4px 8px; border-radius: 8px; cursor: pointer; }
.toast.toast-undo button:hover { background: rgba(255, 255, 255, .1); }
@keyframes toast-undo-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* the opened sheet */
.note-modal-backdrop { background: rgba(20, 16, 10, 0); transition: background .3s ease; }
.note-modal.is-shown .note-modal-backdrop { background: rgba(20, 16, 10, .45); }
/* Sheet + «Удалить»/«ОК» stacked under it (centered in the modal). */
.note-modal-stage {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center;
  gap: 14px; max-width: 100%; max-height: 100%;
}
.note-sheet {
  --paper: #faf3e8; --tape: #f4a6a6; --tape-rot: -35deg;
  position: relative; width: min(540px, 94vw); height: min(560px, calc(84vh - 70px)); will-change: transform;
  filter: drop-shadow(10px 14px 14px rgba(0, 0, 0, .35)); flex: none;
}
.note-sheet-tape { top: -6px; left: -30px; width: 108px; height: 34px; }
.note-sheet-paper {
  position: absolute; inset: 0; box-sizing: border-box; padding: 40px 28px 18px; display: flex; flex-direction: column; overflow: hidden;
}
/* Trash bin in the open sheet's corner (same look as sticker delete). */
.note-sheet-del {
  position: absolute; top: 10px; right: 10px; z-index: 6; width: 32px; height: 32px; border-radius: 50%;
  appearance: none; border: 0; padding: 0; cursor: pointer;
  display: grid; place-items: center; background: rgba(255, 255, 255, .92); color: #9a6a5c;
  box-shadow: 0 2px 8px rgba(70, 48, 20, .2);
  transition: background .15s ease, color .15s ease, transform .12s ease;
}
.note-sheet-del svg { width: 17px; height: 17px; display: block; }
.note-sheet-del:hover { background: #fff; color: #d24b4e; transform: scale(1.05); }
.note-sheet-del:active { transform: scale(.96); }
.note-sheet-del:disabled { opacity: .5; cursor: default; transform: none; }
.note-sheet-del:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.note-sheet .notes-editor { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; color: #3b3226; }
.note-sheet .notes-editor-title {
  background: transparent; border: 0; border-bottom: 1px dashed rgba(90, 70, 40, .35); border-radius: 0; padding: 4px 40px 8px 2px;
  font-size: 20px; color: #3b3226; box-shadow: none;
}
.note-sheet .notes-editor-body { background: transparent; border: 0; border-radius: 0; padding: 4px 2px; flex: 1 1 auto; min-height: 0; color: #3b3226; box-shadow: none; }
.note-sheet .notes-editor-title:focus, .note-sheet .notes-editor-body:focus { outline: none; box-shadow: none; border-color: rgba(90, 70, 40, .5); }
.note-sheet .notes-editor-rich { min-height: 0; overflow: auto; }
.note-sheet .notes-editor-rich.is-empty:before { color: #a89a85; }
.note-sheet .notes-inline-img-wrap { display: inline-block; margin: 4px 6px 4px 0; vertical-align: top; }
.note-sheet .notes-inline-img { max-height: 84px; max-width: 120px; object-fit: cover; cursor: zoom-in; }
.note-sheet .notes-inline-img-remove { width: 22px; height: 22px; top: 3px; right: 3px; font-size: 15px; }
.note-sheet .notes-editor-tools { justify-content: flex-start; }
/* «ОК» — under the sheet, right-aligned with the paper edge. */
.note-sheet-actions {
  position: relative; z-index: 2; display: flex; flex-direction: row; gap: 10px; align-items: center; justify-content: flex-end;
  align-self: stretch; width: min(540px, 94vw); box-sizing: border-box;
  flex: none; pointer-events: none;
}
.note-sheet-bubble {
  pointer-events: auto; appearance: none; cursor: pointer;
  min-width: 108px; height: 46px; padding: 0 20px; border-radius: 999px;
  font: inherit; font-size: 16px; font-weight: 700; line-height: 1;
  color: #1a1d26;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .22), 0 2px 8px rgba(0, 0, 0, .1), inset 0 1px 0 rgba(255, 255, 255, .85);
  -webkit-backdrop-filter: blur(16px) saturate(1.35); backdrop-filter: blur(16px) saturate(1.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.note-sheet-bubble:hover { transform: scale(1.04); box-shadow: 0 16px 32px rgba(0, 0, 0, .26), 0 3px 10px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .9); }
.note-sheet-bubble:active { transform: scale(.97); }
.note-sheet-bubble:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.note-sheet-bubble:disabled { opacity: .55; cursor: default; transform: none; }
.note-sheet-bubble.is-ok { color: #1a1d26; }
.note-sheet-colors { display: flex; flex-wrap: wrap; gap: 5px 12px; padding-top: 6px; border-top: 1px dashed rgba(90, 70, 40, .25); }
.note-sheet-colorgroup { display: flex; align-items: center; gap: 4px; }
.note-sheet-colorlabel { font-size: 10px; font-weight: 700; color: #8a7b66; margin-right: 1px; }
.note-swatch {
  appearance: none; width: 10px; height: 10px; border-radius: 50%; padding: 0; border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 0 0 1px rgba(60, 40, 10, .28); cursor: pointer; display: grid; place-items: center; font: inherit; font-size: 8px; line-height: 1; color: #5b4f40; background: #fff;
}
.note-swatch.is-on { box-shadow: 0 0 0 1.5px #3b3226; }
@media (max-width: 560px) { .note-sheet-paper { padding: 36px 18px 14px; } }

/* Notes: card wide enough for five stickers in a row (5 × 200px + 4 gaps) */
.feature-screen.is-notes .feature-card { width: min(var(--notes-w, 720px), 100%); }

/* favorite mark beside a message: peer → left of the bubble, own → right */
.msg-bubble.is-fav { position: relative; margin-left: 20px; }
.msg.mine .msg-bubble.is-fav { margin-left: 0; margin-right: 20px; }
.msg-fav-star { position: absolute; top: 50%; left: -19px; width: 16px; height: 16px; margin-top: -8px; color: #f5b301; pointer-events: none; display: grid; place-items: center; }
.msg-fav-star svg { width: 16px; height: 16px; display: block; }
.msg.mine .msg-fav-star { left: auto; right: -19px; }

.msg-submenu { z-index: 90; min-width: 180px; }
.msg-menu-item.has-submenu .msg-menu-trailing { font-size: 20px; line-height: 1; color: #8b8e98; }
/* A meeting on that day: the red mark (as its chip below). */
.calendar-mark.is-conf { background: #e5484d; }
/* «Создать на …»: chips under the chosen day, each with its colour dot. */
.calendar-make { display: grid; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed rgba(20, 32, 51, .14); }
.calendar-make-cap { font-size: calc(13.5px * var(--text-scale, 1)); font-weight: 800; color: #3b3f4a; }
.calendar-make-row { display: flex; flex-wrap: wrap; gap: 8px; }
.calendar-make-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid #e3e5eb; background: #fff; color: #3b3f4a;
  font: inherit; font-weight: 700; font-size: calc(14px * var(--text-scale, 1));
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.calendar-make-chip:hover { border-color: #9aa0ad; background: #fafbfc; }
.calendar-make-chip:active { transform: scale(.97); }
.calendar-make-chip i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.calendar-make-chip.is-note i { background: #e9963a; }
.calendar-make-chip.is-poll i { background: var(--cal-poll, #8b6fe0); }
.calendar-make-chip.is-task i { background: #5bb98a; }
.calendar-make-chip.is-meeting i { background: #e5484d; }
/* A note with «Напомнить» on its day: the orange mark (as its chip). */
.calendar-mark.is-note { background: #e9963a; }
.calendar-note-item .calendar-poll-q { font-weight: 650; }
/* Calendar: «Новая заметка» / «Новый опрос» windows. */
.calendar-make-dialog .calendar-form-label { display: block; margin: 10px 0 4px; font-size: calc(13px * var(--text-scale, 1)); font-weight: 650; color: #5b6070; }
.calendar-make-dialog .calendar-form-label:first-child { margin-top: 0; }
.calendar-make-dialog input[type=text], .calendar-make-dialog textarea { width: 100%; box-sizing: border-box; }
.calendar-poll-options { display: flex; flex-direction: column; gap: 6px; }
.calendar-poll-option { display: flex; align-items: center; gap: 6px; }
.calendar-poll-option input { flex: 1; min-width: 0; }
.calendar-make-dialog .task-add-goal { margin-top: 6px; }
.calendar-form-hint { margin: 6px 0 4px; font-size: calc(12px * var(--text-scale, 1)); color: #8b8e98; }
.calendar-make-dialog .btn.wide { margin-top: 12px; }

/* Notes: digital alarm icon + «Напомнить» in the sheet, the time on the sticker. */
.note-alarm-label { display: inline-flex; align-items: center; gap: 6px; }
.note-alarm-ico {
  display: block; flex: none; width: 16px; height: 16px;
  object-fit: contain;
  filter: drop-shadow(0 0 1px rgba(255, 120, 20, .45)) drop-shadow(0 1px 1px rgba(180, 70, 10, .28));
}
.notes-remind-btn .note-alarm-label { gap: 6px; }
.notes-remind-btn .note-alarm-ico { width: 18px; height: 18px; }
.notes-item-remind .note-alarm-ico { width: 14px; height: 14px; }
.note-reminder-head .note-alarm-label { gap: 6px; text-transform: none; letter-spacing: 0; }
.note-reminder-head .note-alarm-ico { width: 16px; height: 16px; }
.calendar-note-item .note-alarm-label { gap: 5px; }
.calendar-note-item .note-alarm-ico { width: 13px; height: 13px; }
.notes-remind-btn.is-on { border-color: #e9963a; color: #9a5a12; background: #fff5e8; }
.note-remind {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 8px 0 2px; padding: 8px 10px; border-radius: 12px;
  background: rgba(233, 150, 58, .1); border: 1px dashed rgba(233, 150, 58, .45);
}
.note-remind.hidden { display: none; }
.note-remind-label { font-weight: 700; font-size: calc(13px * var(--text-scale, 1)); color: #9a5a12; }
.note-remind .note-remind-off { margin-left: auto; }
.notes-item-remind {
  align-self: flex-start; margin: 0 0 4px; padding: 2px 8px; border-radius: 999px;
  font-size: calc(11.5px * var(--text-scale, 1)); font-weight: 700;
  background: rgba(233, 150, 58, .18); color: #8a4f0c;
}
.notes-item-remind.is-past { opacity: .6; }

/* The reminder when it comes: a card in the corner. */
.note-reminder-toast {
  position: fixed; z-index: 10070; right: 16px; bottom: calc(16px + var(--sab, 0px));
  width: min(340px, calc(100vw - 32px)); box-sizing: border-box;
  padding: 14px 16px 12px; border-radius: 16px;
  background: #fffaf0; color: #3b3220; border: 1px solid rgba(233, 150, 58, .45);
  box-shadow: 0 16px 40px rgba(20, 32, 51, .22);
  animation: note-reminder-in .35s cubic-bezier(.2, .8, .3, 1.15);
}
@keyframes note-reminder-in { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
.note-reminder-head { font-size: calc(12px * var(--text-scale, 1)); font-weight: 800; letter-spacing: .3px; text-transform: uppercase; color: #b06a17; }
.note-reminder-title { margin-top: 4px; font-size: calc(16px * var(--text-scale, 1)); font-weight: 750; }
.note-reminder-text { margin-top: 2px; font-size: calc(13.5px * var(--text-scale, 1)); opacity: .8; }
.note-reminder-text:empty { display: none; }
.note-reminder-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* Connected calendars (Яндекс, Mail.ru, CalDAV, Exchange): teal, read-only. */
.calendar-mark.is-ext { background: #1f9bb5; }
.calendar-ext-item {
  border-color: color-mix(in srgb, var(--cal-ext, #1f9bb5) 40%, transparent);
  background: color-mix(in srgb, var(--cal-ext, #1f9bb5) 8%, transparent); cursor: default;
}
.calendar-ext-item:hover { background: color-mix(in srgb, var(--cal-ext, #1f9bb5) 13%, transparent); }
.calendar-ext-btn { margin-left: 6px; }
.cal-ext-hint { margin: 8px 0 4px; font-size: calc(12.5px * var(--text-scale, 1)); color: #6b7080; line-height: 1.4; }
/* Настройки → Почта: the mailbox's calendar under its row. */
.mail-account-row.has-cal { flex-wrap: wrap; }
.mail-cal { flex: 1 1 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(20, 32, 51, .12); }
.mail-cal-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mail-cal-label { flex: 1 1 200px; min-width: 0; font-size: calc(13px * var(--text-scale, 1)); color: #5b6070; }
.mail-cal-label::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #1f9bb5; vertical-align: 1px; }
.mail-cal.is-error .mail-cal-label { color: #c4383d; }
.mail-cal.is-error .mail-cal-label::before { background: #e5484d; }
.mail-cal-actions { display: flex; gap: 6px; flex: none; }
.mail-cal-actions .btn { min-height: 32px; padding: 5px 12px; font-size: calc(13px * var(--text-scale, 1)); }
.mail-cal-form { display: flex; flex-direction: column; gap: 6px; }
.mail-cal-form input, .mail-cal-form select { width: 100%; box-sizing: border-box; }
.mail-cal-form .btn.primary { align-self: flex-start; }
/* «Календари»: the list under the button, a green tick on the shown ones. */
.cal-picker {
  position: fixed; z-index: 80; min-width: 260px; max-width: min(360px, calc(100vw - 16px));
  padding: 6px; border-radius: 14px; background: #fff; border: 1px solid #e6e8ee;
  box-shadow: 0 12px 36px rgba(16, 24, 40, .18); display: flex; flex-direction: column; gap: 2px;
  transform-origin: top right; animation: cal-picker-in .16s cubic-bezier(.2, .8, .3, 1);
}
@keyframes cal-picker-in { from { opacity: 0; transform: translateY(-4px) scale(.97); } }
.cal-picker-empty { padding: 10px 12px; font-size: calc(13px * var(--text-scale, 1)); color: #6b7080; }
.cal-picker-row {
  display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box; padding: 9px 10px; border-radius: 10px;
  cursor: pointer; outline: none; transition: background .12s ease;
}
.cal-picker-row:hover, .cal-picker-row:focus-visible { background: #f3f5f9; }
/* The calendar's colour: a dot that opens the colour picker. */
.cal-picker-dot {
  flex: none; width: 12px; height: 12px; margin: -2px; border-radius: 50%; background: #1f9bb5;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(16, 24, 40, .08); cursor: pointer; outline: none;
  transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), box-shadow .15s ease, background-color .12s ease;
}
.cal-picker-dot:hover, .cal-picker-dot:focus-visible { transform: scale(1.35); box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px rgba(16, 24, 40, .22); }
.cal-picker-row.is-error .cal-picker-name small { display: block; }
.cal-picker-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cal-picker-name span { font-weight: 400; font-size: calc(13.5px * var(--text-scale, 1)); color: #3b3f4a; overflow-wrap: anywhere; }
.cal-picker-name small { color: #c4383d; font-size: calc(11.5px * var(--text-scale, 1)); }
/* Right of the name (shown calendars only): the tick, «sync» under the pointer. */
.cal-picker-act { flex: none; position: relative; width: 26px; height: 26px; }
.cal-picker-tick, .cal-picker-sync {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 8px;
  transition: opacity .16s ease, transform .22s cubic-bezier(.2, .8, .3, 1);
}
.cal-picker-tick { color: #22a35a; animation: cal-tick-in .22s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes cal-tick-in { from { opacity: 0; transform: scale(.4); } }
.cal-picker-sync { color: #2f5bd8; opacity: 0; transform: rotate(-90deg) scale(.7); cursor: pointer; outline: none; }
.cal-picker-sync:hover, .cal-picker-sync:focus-visible { background: rgba(47, 91, 216, .1); }
.cal-picker-row:hover .cal-picker-tick, .cal-picker-row:focus-within .cal-picker-tick,
.cal-picker-row.is-syncing .cal-picker-tick { opacity: 0; transform: scale(.6); }
.cal-picker-row:hover .cal-picker-sync, .cal-picker-row:focus-within .cal-picker-sync,
.cal-picker-row.is-syncing .cal-picker-sync { opacity: 1; transform: none; }
.cal-picker-row.is-syncing .cal-picker-sync { cursor: default; background: transparent; }
.cal-picker-row.is-syncing .cal-picker-sync svg { animation: cal-sync-spin .9s linear infinite; }
@keyframes cal-sync-spin { to { transform: rotate(360deg); } }
/* No hover on touch screens: the tick stays, «sync» sits beside it. */
@media (hover: none) {
  .cal-picker-act { width: 56px; }
  .cal-picker-tick { right: auto; width: 26px; }
  .cal-picker-sync { left: auto; width: 26px; opacity: 1; transform: none; }
  .cal-picker-row:hover .cal-picker-tick, .cal-picker-row:focus-within .cal-picker-tick { opacity: 1; transform: none; }
}
.cal-picker-foot {
  margin-top: 4px; padding: 9px 10px; border: 0; border-top: 1px solid #eef0f4; border-radius: 0 0 10px 10px;
  background: transparent; color: var(--accent, #2f5bd8); font: inherit; font-weight: 400;
  font-size: calc(13px * var(--text-scale, 1)); text-align: left; cursor: pointer;
}
.cal-picker-foot:hover { background: #f3f5f9; }
/* Настройки → Календарь: a card opens on its title (no chevron). */
.cal-collapse-head { cursor: pointer; outline: none; border-radius: 8px; user-select: none; -webkit-user-select: none; }
.cal-collapse-head:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #2f5bd8) 25%, transparent); }
.cal-collapse-head:hover strong { color: var(--accent, #2f5bd8); }
.cal-collapse-head strong { transition: color .12s ease; }
.cal-collapsible.is-collapsed > .cal-collapse-body { display: none; }
.cal-collapsible:not(.is-collapsed) > .cal-collapse-body { animation: cal-collapse-in .2s cubic-bezier(.2, .8, .3, 1); }
@keyframes cal-collapse-in { from { opacity: 0; transform: translateY(-6px); } }
/* «Подключенные календари»: one block per calendar. */
.cal-src-list { display: flex; flex-direction: column; gap: 0; padding-top: 4px; border-top: 1px solid #eef0f4; }
.cal-src-item { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; }
.cal-src-item + .cal-src-item { border-top: 1px solid #eef0f4; }
.cal-src-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cal-src-head .cal-pref-text strong { font-weight: 600; font-size: calc(13.5px * var(--text-scale, 1)); }
.cal-src-head .cal-pref-text span.is-error { color: #c4383d; }
.cal-src-actions { display: flex; gap: 8px; }
.cal-src-add { padding-top: 12px; border-top: 1px solid #eef0f4; }
.cal-src-add > .btn { align-self: flex-start; }
.cal-src-add-actions { display: flex; gap: 8px; }
.cal-src-add .mail-cal-form.hidden, .cal-src-add .hidden { display: none; }
.cal-src-holidays { padding-top: 0; border-top: 0; }
/* No country chosen yet: no empty row between «Свои праздники» and the search; a chosen one takes this place. */
.cal-holiday-chips:empty { display: none; }
.cal-src-holidays > strong { font-weight: 600 !important; }
.cal-src-mail-link {
  align-self: flex-start; margin-top: 6px; padding: 0; border: 0; background: none;
  color: var(--accent, #2f5bd8); font: inherit; font-size: calc(13px * var(--text-scale, 1)); cursor: pointer;
}
.cal-src-list > .cal-custom-holidays-hint { margin-top: 10px; }
