/* Dashboard module (Phase 3). Tokens only. */

/* 2026-07-13 — capped narrower than the shared --content-max (1280px):
   at full width the KPI/announcement columns read as too spread out on a
   large monitor. This is a Dashboard-specific cap, not a change to the
   global token (which every other page still uses unmodified). */
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-6); align-items: start; max-width: 1180px; margin: 0 auto; }
.dash-main { min-width: 0; display: flex; flex-direction: column; gap: var(--space-8); }
/* min-width:0 is essential: as a grid item, .dash-aside otherwise takes its
   min-content width, which on a phone is wider than the 1-column track and
   pushes the whole page past the viewport (content then gets clipped, not
   scrolled). With it, the column shrinks and card text wraps to fit. */
.dash-aside { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.dashboard-grid > * { min-width: 0; }

/* Greeting — the page's one hero element; everything else on the page is
   subordinate to it, so it gets the boldest weight and biggest size on
   the screen (visual-hierarchy anchor for prompt #10's "3 seconds to
   orient" ask). */
.greeting-block { padding-bottom: var(--space-4); border-bottom: 1px solid var(--color-border); }
.greeting-block h1 { max-width: 22ch; font-size: var(--text-3xl); font-weight: var(--font-extrabold); margin-bottom: var(--space-1); text-wrap: balance; }
.greeting-block p { color: var(--color-fg-muted); text-transform: capitalize; font-size: var(--text-sm); }

/* Daily briefing: the home screen opens with work that needs a decision,
   not a decorative KPI hero. The left side owns identity and repeat actions;
   the right side is built only from live, permission-scoped signals already
   returned by the dashboard's existing API calls. */
.dash-briefing {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--color-primary) 16%, var(--color-border));
  border-radius: 24px;
  background: var(--color-surface);
  box-shadow: 0 18px 46px color-mix(in srgb, var(--color-primary) 8%, transparent);
}
.dash-briefing__intro {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 30px;
  overflow: hidden;
  background:
    radial-gradient(360px 210px at 100% 0, color-mix(in srgb, var(--color-primary) 18%, transparent), transparent 74%),
    linear-gradient(145deg, color-mix(in srgb, var(--color-primary-soft) 48%, var(--color-surface)), var(--color-surface));
}
.dash-briefing__intro::after {
  position: absolute;
  right: -42px;
  bottom: -70px;
  width: 180px;
  height: 180px;
  border: 1px solid color-mix(in srgb, var(--color-primary) 14%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 0 28px color-mix(in srgb, var(--color-primary) 4%, transparent), 0 0 0 58px color-mix(in srgb, var(--color-primary) 3%, transparent);
  content: '';
  pointer-events: none;
}
.dash-briefing__eyebrow { display: inline-flex; width: max-content; align-items: center; gap: 9px; margin-bottom: 13px; color: var(--color-primary); font-size: 10px; font-weight: var(--font-extrabold); letter-spacing: .11em; text-transform: uppercase; }
.dash-briefing__eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--color-success); box-shadow: 0 0 0 5px var(--color-success-soft); }
.dash-briefing__intro h1 { position: relative; z-index: 1; max-width: 18ch; margin: 0; font-family: 'Sora', var(--font-sans); font-size: clamp(1.75rem, 3vw, 2.45rem); letter-spacing: -.045em; line-height: 1.12; text-wrap: balance; }
.dash-briefing__intro > p { position: relative; z-index: 1; margin: 8px 0 0; color: var(--color-fg-muted); font-size: var(--text-sm); text-transform: capitalize; }
.dash-briefing__actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 25px; }
.dash-briefing__action { display: inline-flex; min-height: 38px; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid color-mix(in srgb, var(--color-primary) 14%, var(--color-border)); border-radius: 11px; background: color-mix(in srgb, var(--color-surface) 88%, transparent); color: var(--color-fg); font: inherit; font-size: 11px; font-weight: var(--font-semibold); text-decoration: none; cursor: pointer; transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast), background var(--dur-fast); }
.dash-briefing__action .icon { width: 16px; height: 16px; color: var(--color-primary); }
.dash-briefing__action:hover { border-color: var(--color-primary); background: var(--color-surface); transform: translateY(-1px); }
.dash-briefing__action:focus-visible { outline: 3px solid var(--color-primary-soft); outline-offset: 2px; }

.dash-focus { min-width: 0; padding: 22px; border-left: 1px solid var(--color-border); background: color-mix(in srgb, var(--color-surface-2) 66%, var(--color-surface)); }
.dash-focus__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.dash-focus__head > span { color: var(--color-fg-muted); font-size: 10px; font-weight: var(--font-extrabold); letter-spacing: .1em; text-transform: uppercase; }
.dash-focus__head > b { padding: 4px 7px; border-radius: var(--radius-full); background: var(--color-danger-soft); color: var(--color-danger); font-size: 10px; }
.dash-focus__list { display: flex; flex-direction: column; gap: 5px; }
.dash-focus__item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 14px; min-height: 48px; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; color: var(--color-fg); text-decoration: none; transition: background var(--dur-fast), transform var(--dur-fast) var(--ease-out); }
.dash-focus__item:hover { background: var(--color-surface); transform: translateX(2px); }
.dash-focus__icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: var(--color-primary-soft); color: var(--color-primary); }
.dash-focus__icon .icon { width: 16px; height: 16px; }
.dash-focus__item--warning .dash-focus__icon { background: var(--color-warning-soft); color: var(--color-warning); }
.dash-focus__item--danger .dash-focus__icon { background: var(--color-danger-soft); color: var(--color-danger); }
.dash-focus__copy { display: flex; min-width: 0; flex-direction: column; gap: 1px; }
.dash-focus__copy b { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.dash-focus__copy small { color: var(--color-fg-subtle); font-size: 10px; }
.dash-focus__item > strong { min-width: 24px; color: var(--color-fg); font-family: 'Sora', var(--font-sans); font-size: 15px; text-align: right; }
.dash-focus__arrow { width: 14px; height: 14px; color: var(--color-fg-subtle); }
.dash-focus__clear { display: flex; min-height: 154px; align-items: center; justify-content: center; gap: 13px; padding: 18px; text-align: left; }
.dash-focus__clear > span { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 14px; background: var(--color-success-soft); color: var(--color-success); }
.dash-focus__clear .icon { width: 20px; height: 20px; }
.dash-focus__clear b { font-size: var(--text-sm); }
.dash-focus__clear p { max-width: 28ch; margin: 3px 0 0; color: var(--color-fg-muted); font-size: var(--text-xs); }
.dash-briefing--skeleton { min-height: 258px; }
.dash-briefing--skeleton .dash-briefing__intro { gap: 13px; }
.dash-briefing--skeleton .dash-briefing__actions { display: flex; margin-top: 12px; }
.dash-briefing--skeleton .dash-briefing__actions .skeleton { height: 36px; border-radius: 11px; }
.dash-briefing--skeleton .dash-focus__list .skeleton--block { height: 48px; min-height: 48px; border-radius: 12px; }

@media (max-width: 720px) {
  .dash-briefing { grid-template-columns: 1fr; border-radius: 20px; }
  .dash-briefing__intro { padding: 24px 20px 20px; }
  .dash-briefing__intro h1 { font-size: clamp(1.65rem, 8vw, 2.1rem); }
  .dash-briefing__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 21px; }
  .dash-briefing__action { min-height: 44px; justify-content: flex-start; }
  .dash-focus { padding: 17px 14px; border-top: 1px solid var(--color-border); border-left: 0; }
  .dash-focus__item { min-height: 51px; }
  .dash-focus__clear { min-height: 108px; }
  .dash-briefing--skeleton .dash-briefing__actions { display: grid; }
}

@media (max-width: 380px) {
  .dash-briefing__actions { grid-template-columns: 1fr; }
}

/* Mobile-only stand-in for the header search (hidden below 900px, see
   layout.css) — full-width and placed where the eye lands first, right
   after the greeting. Desktop keeps the header's version; this stays
   hidden there so the two never show at once. */
.dash-search {
  display: none;
  position: relative; align-items: center;
  margin: var(--space-5) 0 var(--space-2);
}
.dash-search > .icon { position: absolute; left: var(--space-4); width: 18px; height: 18px; color: var(--color-fg-subtle); pointer-events: none; }
.dash-search input {
  width: 100%; height: 48px; padding: 0 var(--space-4) 0 var(--space-12);
  font: inherit; font-size: var(--text-base); color: var(--color-fg);
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-full);
  box-shadow: var(--shadow-xs);
}
.dash-search input:focus { outline: none; border-color: var(--color-ring); box-shadow: 0 0 0 3px var(--color-primary-soft); }
@media (max-width: 900px) { .dash-search { display: flex; } }

.dash-section__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.dash-section__head--compact { margin-bottom: var(--space-2); }
.dash-section__head > div { min-width: 0; }
/* The classic flex min-width:auto trap: neither side has flex-shrink set,
   so both default to 1 and shrink together under pressure — but a .btn has
   no fixed width, so its own minimum is its longest unbroken word
   ("Переглянути"), and the browser wraps "всі"/"всіх" onto a second line
   inside it rather than shrinking the button below that word's width. The
   title on the left already has min-width:0 above specifically so IT'S the
   side that gives way (wrapping/truncating its own text is fine); the
   button should just keep its natural single-line size instead of also
   fighting for the same shrinking space. */
.dash-section__head > .btn { flex-shrink: 0; white-space: nowrap; }
.dash-section__eyebrow {
  display: block; margin-bottom: 3px; color: var(--color-primary);
  font-size: 10px; font-weight: var(--font-bold); letter-spacing: .08em; text-transform: uppercase;
}
.dash-section h2 { font-size: var(--text-lg); }
.btn--sm { min-height: 34px; padding: 0 var(--space-3); font-size: var(--text-xs); }

/* Active surveys are time-sensitive, so they sit above the announcement
   feed and read as an action rather than another passive list. */
.dash-surveys {
  padding: var(--space-5); border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-xl); background: var(--color-primary-soft);
}
.dash-surveys .dash-section__head { margin-bottom: var(--space-3); }
.dash-survey-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: var(--space-3); }
.dash-survey-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--space-3);
  padding: var(--space-4); color: inherit; text-decoration: none;
}
.dash-survey-card__icon {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: var(--radius-md); background: var(--color-primary-soft); color: var(--color-primary);
}
.dash-survey-card__copy { display: flex; min-width: 0; flex-direction: column; }
.dash-survey-card__copy b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-sm); }
.dash-survey-card__copy small { color: var(--color-fg-muted); font-size: var(--text-xs); }
.dash-survey-card__action { grid-column: 2; color: var(--color-primary); font-size: var(--text-xs); font-weight: var(--font-semibold); }

/* Announcements — 2026-07-13: the one card on the page that should feel
   like the most important thing here (prompt #8's visual-hierarchy ask —
   "Головне оголошення має одразу привертати увагу"), so it gets the
   biggest title and the only left-accent border on the page. Pinned gets
   an actual labeled badge instead of a bare dot; shorter image so the
   card reads as a scannable feed item, not a a full-bleed photo post. */
.ann-list { display: flex; flex-direction: column; gap: var(--space-3); }
.announcement-card { padding: var(--space-5); animation: card-in var(--dur-base) var(--ease-out) both; }
.announcement-card.is-pinned { border-left: 3px solid var(--color-primary); }
.announcement-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.announcement-card__title-row { display: flex; flex-direction: column; gap: var(--space-1); }
.announcement-card__head h3 { font-size: var(--text-lg); font-weight: var(--font-bold); margin: 0; }
.announcement-card__pin {
  display: inline-flex; align-items: center; gap: 4px; align-self: flex-start;
  padding: 1px var(--space-2); border-radius: var(--radius-full);
  background: var(--color-primary-soft); color: var(--color-primary);
  font-size: var(--text-xs); font-weight: var(--font-semibold);
}
.announcement-card__actions { display: flex; gap: var(--space-1); flex-shrink: 0; }
.announcement-card__actions button { display: grid; place-items: center; border: 0; background: transparent; cursor: pointer; padding: var(--space-1); border-radius: var(--radius-sm); color: var(--color-fg-muted); }
.announcement-card__actions button:hover { background: var(--color-surface-hover); color: var(--color-fg); }
.announcement-card__body { margin-top: var(--space-2); color: var(--color-on-surface); font-size: var(--text-sm); line-height: var(--leading-relaxed); white-space: pre-wrap; }
.announcement-card__img { display: block; width: 100%; max-height: 160px; object-fit: cover; margin-top: var(--space-3); border-radius: var(--radius-md); }
.announcement-card__meta { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-3); font-size: var(--text-xs); color: var(--color-fg-subtle); }
.announcement-rich { white-space: normal; }
.announcement-rich > :first-child { margin-top: 0; }
.announcement-rich > :last-child { margin-bottom: 0; }
.announcement-rich p { margin: 0 0 var(--space-2); }
.announcement-rich h2 { margin: var(--space-3) 0 var(--space-2); font-size: var(--text-lg); }
.announcement-rich h3 { margin: var(--space-3) 0 var(--space-1); font-size: var(--text-base); }
.announcement-rich ul, .announcement-rich ol { margin: var(--space-2) 0; padding-left: var(--space-6); }
.announcement-rich blockquote { margin: var(--space-3) 0; padding: var(--space-2) var(--space-3); border-left: 3px solid var(--color-primary); border-radius: 0 var(--radius-md) var(--radius-md) 0; background: var(--color-primary-soft); }
.announcement-rich pre { margin: var(--space-3) 0; padding: var(--space-3); overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--text-xs); white-space: pre-wrap; }
.announcement-rich hr { margin: var(--space-4) 0; border: 0; border-top: 1px solid var(--color-border-strong); }
.announcement-rich a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }
.ann-text--small { font-size: var(--text-xs); }
.ann-text--large { font-size: var(--text-lg); }
.ann-align--left { text-align: left; }
.ann-align--center { text-align: center; }
.ann-align--right { text-align: right; }
.ann-align--justify { text-align: justify; }

/* Announcement composer */
.ann-language-tabs {
  display: flex; align-items: center; gap: var(--space-2); padding: 4px;
  border-radius: var(--radius-lg); background: var(--color-surface-2);
}
.ann-language-tabs button {
  display: inline-flex; align-items: center; justify-content: center; flex: 1; gap: 7px;
  min-height: 40px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-md);
  background: transparent; color: var(--color-fg-muted); cursor: pointer;
  font: inherit; font-size: var(--text-xs); font-weight: var(--font-semibold);
}
.ann-language-tabs button.is-active { background: var(--color-surface); box-shadow: var(--shadow-xs); color: var(--color-fg); }
.ann-language-tabs button > span {
  display: grid; place-items: center; width: 23px; height: 19px; border-radius: 6px;
  background: var(--color-primary-soft); color: var(--color-primary); font-size: 8px; font-weight: var(--font-extrabold);
}
.ann-language-tabs button > i {
  padding: 2px 5px; border-radius: var(--radius-full); background: var(--color-warning-soft);
  color: var(--color-warning); font-size: 8px; font-style: normal;
}
.ann-language-tabs button > i.is-optional { background: var(--color-surface-hover); color: var(--color-fg-muted); }
.ann-language-hint { margin: calc(-1 * var(--space-2)) 0 0; color: var(--color-fg-muted); font-size: var(--text-xs); }
.ann-editor-field, .ann-image-field { display: flex; flex-direction: column; gap: var(--space-2); }
.ann-editor-field > .modal-label, .ann-image-field > .modal-label { display: block; }
.ann-editor-toolbar {
  position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: var(--space-2);
  border: 1px solid var(--color-border); border-bottom: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--color-surface-2);
}
.ann-tool-group { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); }
.ann-tool-group--selects { gap: 4px; }
.ann-tool-btn, .ann-tool-select {
  height: 34px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--color-fg); font: inherit; font-size: var(--text-sm);
}
.ann-tool-btn { display: grid; place-items: center; min-width: 34px; padding: 0 var(--space-2); cursor: pointer; }
.ann-tool-btn:hover, .ann-tool-btn:focus-visible, .ann-tool-select:hover, .ann-tool-select:focus-visible { border-color: var(--color-border); background: var(--color-surface); outline: none; }
.ann-tool-select { width: 150px; padding: 0 28px 0 var(--space-2); cursor: pointer; }
.ann-tool-select--size { width: 84px; font-weight: var(--font-semibold); }
.ann-tool-btn--labeled { display: inline-flex; gap: 5px; min-width: 80px; font-size: var(--text-xs); font-weight: var(--font-semibold); }
.ann-tool-btn--labeled > span { font-size: var(--text-base); font-weight: var(--font-bold); }
.ann-align-icon { display: flex; width: 16px; flex-direction: column; align-items: stretch; gap: 2px; }
.ann-align-icon i { display: block; width: 100%; height: 2px; border-radius: var(--radius-full); background: currentColor; }
.ann-align-icon i:nth-child(2) { width: 70%; }
.ann-align-icon--left { align-items: flex-start; }
.ann-align-icon--center { align-items: center; }
.ann-align-icon--right { align-items: flex-end; }
.ann-unlink-icon { position: absolute; z-index: 1; margin: -11px 0 0 -12px; color: var(--color-danger); font-size: 13px; font-weight: var(--font-bold); }
.ann-tool-btn--emoji { font-size: 1.1rem; }
.ann-emoji-picker {
  display: grid; grid-template-columns: repeat(12, 36px); justify-content: end; flex: 1 0 100%;
  gap: 3px; padding: var(--space-2);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-surface); box-shadow: var(--shadow-lg);
}
.ann-emoji-picker[hidden] { display: none; }
.ann-emoji-picker button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: var(--radius-sm); background: transparent; font-size: 1.15rem; cursor: pointer; }
.ann-emoji-picker button:hover, .ann-emoji-picker button:focus-visible { background: var(--color-surface-hover); outline: none; transform: scale(1.08); }
.ann-editor {
  min-height: 220px; max-height: 420px; overflow-y: auto; padding: var(--space-4);
  border: 1px solid var(--color-border); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--color-surface); color: var(--color-fg); font-size: var(--text-sm); line-height: var(--leading-relaxed);
}
.ann-editor:focus { border-color: var(--color-ring); outline: none; box-shadow: 0 0 0 3px var(--color-primary-soft); }
.ann-editor:empty::before { color: var(--color-fg-subtle); content: attr(data-placeholder); pointer-events: none; }
.ann-editor p { margin: 0 0 var(--space-2); }
.ann-editor h2 { margin: var(--space-3) 0 var(--space-2); font-size: var(--text-xl); }
.ann-editor h3 { margin: var(--space-3) 0 var(--space-1); font-size: var(--text-lg); }
.ann-editor ul, .ann-editor ol { margin: var(--space-2) 0; padding-left: var(--space-6); }
.ann-editor blockquote { margin: var(--space-3) 0; padding: var(--space-2) var(--space-3); border-left: 3px solid var(--color-primary); background: var(--color-primary-soft); }
.ann-editor pre { margin: var(--space-3) 0; padding: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--text-xs); white-space: pre-wrap; }
.ann-editor hr { margin: var(--space-4) 0; border: 0; border-top: 1px solid var(--color-border-strong); }
.ann-editor a { color: var(--color-primary); text-decoration: underline; }

.ann-image-drop {
  position: relative; min-height: 132px; padding: var(--space-4); overflow: hidden;
  border: 1px dashed var(--color-border-strong); border-radius: var(--radius-lg);
  background: var(--color-surface-2); cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.ann-image-drop:hover, .ann-image-drop:focus-visible, .ann-image-drop.is-dragover { border-color: var(--color-primary); background: var(--color-primary-soft); outline: none; }
.ann-image-drop.is-uploading { pointer-events: none; }
.ann-image-drop__empty { display: flex; align-items: center; justify-content: center; gap: var(--space-3); min-height: 98px; text-align: left; }
.ann-image-drop__empty[hidden] { display: none; }
.ann-image-drop__empty p { margin: 3px 0 0; color: var(--color-fg-muted); font-size: var(--text-xs); }
.ann-image-drop__icon { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: var(--radius-lg); background: var(--color-surface); color: var(--color-primary); box-shadow: var(--shadow-sm); }
.ann-image-drop__icon .icon { width: 21px; height: 21px; }
.ann-image-preview { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-4); }
.ann-image-preview[hidden] { display: none; }
.ann-image-preview img { width: 100%; height: 180px; border-radius: var(--radius-md); object-fit: cover; background: var(--color-surface); }
.ann-image-preview__actions { display: flex; flex-direction: column; gap: var(--space-2); }
.ann-image-progress { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: var(--space-2); background: var(--color-overlay); color: var(--color-on-primary); font-size: var(--text-sm); font-weight: var(--font-semibold); }
.ann-image-progress[hidden] { display: none; }
.ann-image-progress span { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: var(--radius-full); animation: ann-upload-spin .7s linear infinite; }
@keyframes ann-upload-spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .ann-language-tabs button { padding: 0 var(--space-2); }
  .ann-language-tabs button > i { display: none; }
  .ann-editor-toolbar { align-items: stretch; gap: 4px; padding: 6px; }
  .ann-tool-group--selects { width: 100%; }
  .ann-tool-select { flex: 1; width: auto; min-width: 0; }
  .ann-tool-select--size { flex: 0 0 84px; }
  .ann-tool-btn--labeled { min-width: 76px; }
  /* Round 2 (2026-08-02) — dropping just the border/background wasn't
     enough: every OTHER group (bold/italic/…, bullets/numbers, alignment,
     etc.) is still its own flex item that wraps onto its own line the
     moment the next group doesn't fit next to it, so a 4-icon group left-
     aligns on a row and everything to its right stays blank — exactly the
     "не використовується простір" the boxes were hiding, just without the
     box drawn around it.
     `display: contents` removes the group <div> from the box tree entirely
     (its children become direct flex items of .ann-editor-toolbar instead),
     so buttons from DIFFERENT groups can now share a row and wrap together
     — B/I/U/S, then the two list buttons, then alignment icons, etc. all
     pack left-to-right filling each line before wrapping, the way a normal
     toolbar does, instead of one group per line. The paragraph/size selects
     stay a real box; that group is meant to keep its own full-width row. */
  .ann-tool-group:not(.ann-tool-group--selects) {
    display: contents;
  }
  .ann-tool-btn { min-width: 32px; height: 32px; }
  /* The "Список"/"Список" (bulleted/numbered list) buttons carry a text
     label alongside their icon — the widest buttons in the bar by far, and
     the main reason two groups after them wouldn't fit on the same row.
     The label is decorative once the icon+aria-label carry the meaning (the
     button keeps its aria-label/title either way), so hiding it collapses
     these to icon-only width matching every other button, buying back
     roughly 130px of row width for the rest of the toolbar to use. */
  .ann-tool-btn--labeled { min-width: 32px; }
  .ann-tool-btn__label { display: none; }
  /* A thin rule between logical clusters — bold/italic/underline/strike |
     lists | alignment | indent/link | divider/clear/emoji — now that the
     group <div>s that used to imply this separation are gone from the box
     tree. Still findable via sibling combinators: display:contents changes
     what renders, not the DOM structure those combinators walk, so "first
     real button/select of a group that follows another group" still
     resolves correctly. */
  .ann-tool-group:not(.ann-tool-group--selects) + .ann-tool-group:not(.ann-tool-group--selects) > :first-child {
    margin-inline-start: 6px;
    padding-inline-start: 6px;
    border-left: 1px solid var(--color-border);
  }
  .ann-emoji-picker { grid-template-columns: repeat(6, 1fr); }
  .ann-emoji-picker button { width: 100%; }
  .ann-editor { min-height: 190px; }
  .ann-image-preview { grid-template-columns: 1fr; }
  .ann-image-preview__actions { flex-direction: row; }
}

/* Recent joins (horizontal scroll) */
.joins-scroll { display: flex; gap: var(--space-3); overflow-x: auto; padding-bottom: var(--space-2); scroll-snap-type: x proximity; }
.join-card { flex: 0 0 150px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: var(--space-1); padding: var(--space-4); text-align: center; transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast); }
.join-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.join-card__name { font-weight: var(--font-semibold); font-size: var(--text-sm); }
.join-card__meta { font-size: var(--text-xs); color: var(--color-fg-muted); }
.join-card__date { font-size: var(--text-xs); color: var(--color-fg-subtle); font-variant-numeric: tabular-nums; }

/* One consolidated home for new colleagues, birthdays, anniversaries and
   today's absences. This replaces four visually disconnected widgets. */
.people-events-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.people-event-card { min-height: 178px; padding: var(--space-4); }
.people-event-list { display: flex; flex-direction: column; gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.people-event-list a { display: flex; align-items: center; gap: var(--space-3); min-width: 0; color: inherit; text-decoration: none; }
.people-event-list a > span:last-child { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.people-event-list b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-sm); }
.people-event-list small { overflow: hidden; color: var(--color-fg-muted); font-size: var(--text-xs); text-overflow: ellipsis; white-space: nowrap; }

/* Aside — KPI cards, round 2 (2026-07-13). Feedback on round 1: icon chip
   too dominant relative to the number. Shrunk the icon down to a small
   corner mark, the number is now the loudest thing in the card (text-3xl),
   and a real trend line (see dashboard.js — only "Усього" gets one, from
   data already in hand; the other 3 KPIs have no honest client-side trend
   source, so they stay without one rather than showing a made-up figure). */
.stat-chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
.dash-aside__title { display: flex; flex-direction: column; gap: 2px; margin-bottom: calc(var(--space-2) * -1); }
.dash-aside__title span { font-size: var(--text-sm); font-weight: var(--font-bold); }
.dash-aside__title small { color: var(--color-fg-muted); font-size: var(--text-xs); }
.stat-chip {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1);
  min-height: 142px; padding: var(--space-4); background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); text-align: left; color: inherit; text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
a.stat-chip:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--color-border-strong); }
.stat-chip__icon {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: var(--radius-sm);
  background: var(--color-primary-soft); color: var(--color-primary); flex-shrink: 0; margin-bottom: var(--space-1);
}
.stat-chip__icon .icon { width: 13px; height: 13px; }
.stat-chip--success .stat-chip__icon { background: var(--color-success-soft); color: var(--color-success); }
.stat-chip--warning .stat-chip__icon { background: var(--color-warning-soft); color: var(--color-warning); }
.stat-chip--danger .stat-chip__icon { background: var(--color-danger-soft); color: var(--color-danger); }
.stat-chip__value { display: block; font-size: var(--text-3xl); font-weight: var(--font-extrabold); color: var(--color-fg); line-height: 1; font-variant-numeric: tabular-nums; }
.stat-chip__label { font-size: var(--text-xs); color: var(--color-fg-muted); line-height: var(--leading-tight); }
.stat-chip__trend { font-size: var(--text-xs); font-weight: var(--font-semibold); color: var(--color-success); margin-top: 2px; }

/* Operational signal rail: overview numbers stay scannable without turning
   the right column into a second dashboard. Actionable signals are rendered
   as compact rows, while the four core team metrics retain a 2x2 footprint. */
.dash-overview {
  padding: var(--space-4);
  border-radius: 18px;
  background:
    radial-gradient(220px 130px at 100% 0, color-mix(in srgb, var(--color-primary) 10%, transparent), transparent 72%),
    var(--color-surface);
}
.dash-overview__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.dash-overview__icon {
  display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center;
  border-radius: 11px; color: var(--color-primary); background: var(--color-primary-soft);
}
.dash-overview__icon .icon { width: 17px; height: 17px; }
.dash-overview .dash-aside__title { margin: 0; }
.dash-overview .stat-chips { gap: 8px; }
.dash-overview .stat-chip {
  min-height: 102px; padding: 12px; border-radius: 13px;
  background: color-mix(in srgb, var(--color-surface-2) 72%, var(--color-surface)); box-shadow: none;
}
.dash-overview .stat-chip__value { font-size: 1.55rem; }
.dash-overview .stat-chip__icon { width: 20px; height: 20px; }
.dash-overview__signals {
  display: flex; flex-direction: column; gap: 3px; margin-top: 12px;
  padding-top: 10px; border-top: 1px solid var(--color-border);
}
.dash-overview .stat-chip--compact {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto;
  min-height: 38px; align-items: center; gap: 8px; padding: 5px 7px;
  border: 0; border-radius: 9px; background: transparent;
}
.dash-overview .stat-chip--compact:hover { background: var(--color-surface-hover); box-shadow: none; transform: none; }
.dash-overview .stat-chip--compact .stat-chip__icon { margin: 0; }
.dash-overview .stat-chip--compact .stat-chip__value { grid-column: 3; grid-row: 1; font-size: 1rem; }
.dash-overview .stat-chip--compact .stat-chip__label {
  grid-column: 2; grid-row: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.dash-card { padding: var(--space-5); }
.dash-card h3 { font-size: var(--text-sm); font-weight: var(--font-semibold); color: var(--color-fg-muted); margin: 0; }
.dash-empty { color: var(--color-fg-subtle); font-size: var(--text-sm); }

/* 2026-07-13 — the 4 aside cards (birthdays/anniversaries/absences/links)
   used to be identical bare-text headers, indistinguishable at a glance.
   Each now gets its own icon + tint (dashboard.js's dashCardHead()) so the
   column doesn't read as one undifferentiated stack. Tones deliberately
   echo existing meanings elsewhere on the page rather than inventing new
   ones: absence reuses the KPI row's "on leave" amber, birthdays get the
   one spare hue (orange) since there's no neutral "celebration" token. */
.dash-card__head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.dash-card__icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: var(--radius-sm); flex-shrink: 0; background: var(--color-primary-soft); color: var(--color-primary); }
.dash-card__icon .icon { width: 15px; height: 15px; }
.dash-card--cake .dash-card__icon { background: var(--color-orange-soft); color: var(--color-orange); }
.dash-card--palm .dash-card__icon { background: var(--color-warning-soft); color: var(--color-warning); }
.dash-card--link .dash-card__icon { background: var(--color-success-soft); color: var(--color-success); }

.absent-list, .birthday-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.absent-list li, .birthday-item { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-sm); }
.birthday-item__name { flex: 1; font-weight: var(--font-medium); }
.birthday-item__when { font-size: var(--text-xs); color: var(--color-primary); font-weight: var(--font-semibold); }

/* Company links (Phase 19) */
.company-links-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.company-links-list a { display: block; font-size: var(--text-sm); color: var(--color-primary); text-decoration: none; }
.company-links-list a:hover { text-decoration: underline; }

.links-manage-list { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); max-height: 40vh; overflow-y: auto; }
.links-manage-row { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); background: var(--color-surface-2); border-radius: var(--radius-md); font-size: var(--text-sm); }
.links-manage-row__label { font-weight: var(--font-medium); flex-shrink: 0; }
.links-manage-row__url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-fg-muted); }
.links-manage-row button { flex-shrink: 0; border: 0; background: transparent; color: var(--color-fg-muted); cursor: pointer; padding: var(--space-1); border-radius: var(--radius-sm); }
.links-manage-row button:hover { background: var(--color-surface-hover); color: var(--color-fg); }
.links-manage-row button:disabled { opacity: 0.35; cursor: default; }

.quick-actions { display: flex; flex-direction: column; gap: var(--space-2); }
.quick-actions .btn { width: 100%; }

/* Leave balances and actions are visible together — no carousel or duplicate
   quick-action button elsewhere on the dashboard. */
.leave-widget { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); }
.leave-widget__head { display: flex; align-items: center; gap: var(--space-2); }
.leave-widget__head > div { flex: 1; min-width: 0; }
.leave-widget__head .hdr-icon { color: var(--color-fg-muted); text-decoration: none; }
.leave-widget__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-md); flex-shrink: 0; background: var(--color-primary-soft); color: var(--color-primary); }
.leave-widget__icon .icon { width: 18px; height: 18px; }
.leave-widget__title { margin: 0; font-size: var(--text-sm); font-weight: var(--font-bold); line-height: var(--leading-tight); }
.leave-widget__head p { margin: 2px 0 0; color: var(--color-fg-muted); font-size: var(--text-xs); }
.leave-widget__types { display: flex; flex-direction: column; gap: var(--space-2); }
.leave-type-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-2);
  width: 100%; padding: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-surface-2); color: var(--color-fg); text-align: left; cursor: pointer;
}
.leave-type-row:hover { border-color: var(--color-primary); background: var(--color-primary-soft); }
.leave-type-row__dot { width: 9px; height: 9px; border-radius: var(--radius-full); }
.leave-type-row__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-sm); font-weight: var(--font-semibold); }
.leave-type-row__balance { color: var(--color-fg-muted); font-size: var(--text-xs); white-space: nowrap; }
.leave-type-row__balance b { color: var(--color-fg); }
.leave-type-row__action { grid-column: 2 / -1; color: var(--color-primary); font-size: var(--text-xs); font-weight: var(--font-semibold); }

/* Skeleton loaders */
.skeleton { height: 16px; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--color-surface-2) 25%, var(--color-surface-hover) 50%, var(--color-surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; margin-bottom: var(--space-2); }
.skeleton--block { height: 96px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

/* Row-shaped skeleton (avatar + two text lines) — People's list and the
   leave-approvals queue, see app-shared.js's skeletonRows(). Layered on
   top of the plain .skeleton block above (same shimmer, same file, so
   there's no cross-file cascade-order fight over which .skeleton height
   wins — every element below carries both classes). */
.skeleton-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4); margin-bottom: var(--space-2); }
.skeleton-avatar.skeleton { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; margin-bottom: 0; }
.skeleton-lines { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.skeleton-lines .skeleton { margin-bottom: 0; }
.skeleton-line--40 { width: 40%; }
.skeleton-line--65 { width: 65%; }

.modal-check { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); }
.empty-state--sm { padding: var(--space-8) var(--space-4); }

/* Onboarding self-service widget (Phase 82) — up to 3 nearest pending
   checklist items, same list-item shape as .mood-neg-item. */
.onb-widget-list { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.onb-widget-list li {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding: var(--space-2); border-radius: var(--radius-md); background: var(--color-surface-2); font-size: var(--text-sm);
}
.onb-widget-list li small { color: var(--color-fg-muted); font-size: var(--text-xs); white-space: nowrap; }

@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .dash-aside__title { margin-top: var(--space-2); }
  .dash-aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .dash-overview { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  /* Smaller greeting so "Good evening, Alice!" doesn't wrap awkwardly on a
     phone; the KPI chips already stay a comfortable 2-up. */
  .greeting-block h1 { font-size: var(--text-2xl); }
  .people-events-grid { grid-template-columns: 1fr; }
  .dash-section__head { align-items: flex-start; gap: var(--space-3); }
  .dash-aside { grid-template-columns: 1fr; }
  .dash-overview { padding: var(--space-3); }
  .dash-overview .stat-chip { min-height: 88px; padding: 10px; }
  .dash-overview .stat-chip__value { font-size: 1.35rem; }
  .dash-overview .stat-chip__label { white-space: normal; }
}
