/* ── Eyebrow / section labels ─────────────────────────────────────────── */
.eyebrow {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--muted-2); display: flex; gap: 8px;
  align-items: center; margin: 0 0 14px;
}
/* Inside a stack the eyebrow is that stack's first line, not a section label with
   air under it — the container's own `gap` is the spacing. One rule for the three
   stacks that do this, so a fourth is a selector rather than a fourth override. */
.panel-head-text .eyebrow,
.search-head-titles .eyebrow,
.sa-history > summary .eyebrow { margin: 0; }

/* ── Panel header: icon + title/subtitle stack + optional big count ─────── */
.panel-head {
  display: flex; align-items: center; gap: 14px; margin: 0 0 18px;
  padding-right: 26px;  /* reserve the top-right corner for the widget cog */
}
.panel-head > .icon {
  width: 26px; height: 26px; flex: none; color: var(--muted); stroke-width: 1.75;
}
.panel-head-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.panel-head-title {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  letter-spacing: .6px; text-transform: uppercase; color: var(--text-strong); line-height: 1.1;
}
.panel-head-sub { font-size: 12.5px; color: var(--muted); line-height: 1.2; }
.panel-head-n {
  margin-left: auto; align-self: center; font-family: var(--font-mono);
  font-weight: 700; font-size: 40px; line-height: 1; letter-spacing: -1.5px;
  color: var(--text-strong);
}
/* Phone: the icon marks the top of the header instead of its middle. Centring is
   right while the text is one or two lines — which is what it is on a desktop
   column — but the same subtitle wraps to four on a phone («Локації позначених
   підрозділів видно автоматично. Тут — спільні місця поза підрозділами: госпіталі,
   полігони, пункти прийому.»), and a centred icon then sits beside the *third* line
   with the title floating above it, reading as a stray glyph rather than as the
   header's marker. `align-self` on the icon rather than `align-items` on the header, so
   the count — a 40px figure the header is balanced around — is not dragged along and
   does not have to opt back out of it. The 2px is optical: a 26px icon box against a
   16.5px title line. */
@media (max-width: 560px) {
  .panel-head > .icon { align-self: flex-start; margin-top: 2px; }
}

/* ── Panels (soft rounded surfaces) ───────────────────────────────────── */
.panel {
  position: relative;
  background: var(--surface), var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.panel > h3:first-child, .panel > .eyebrow:first-child { margin-top: 0; }
.panel h3 {
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
  letter-spacing: -.1px; margin: 0 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.panel h3 .count {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  letter-spacing: 1px; margin-left: auto;
}
.panel h3 .count::before, .panel h3 .count::after { display: none; }

/* Corner brackets retired — `.hud` is now a no-op the templates can keep carrying. */
.hud::before, .hud::after { content: none; }

/* ── Per-widget settings cog (top-right of every dashboard card) ───────── */
.widget-cog {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0;
  color: var(--muted-2); background: transparent;
  border: 1px solid transparent; border-radius: 3px; cursor: pointer;
  opacity: .45;
  transition: opacity .12s, color .12s, background .12s, border-color .12s;
}
.panel:hover .widget-cog, .stat:hover .widget-cog,
.widget-cog:hover, .widget-cog:focus-visible { opacity: 1; }
.widget-cog:hover {
  color: var(--text); background: var(--panel-2); border-color: var(--border-bright);
}
.widget-cog:focus-visible { outline: none; color: var(--text); border-color: var(--signal); }
.widget-cog svg { display: block; }
/* Not-yet-wired cogs (widgets with no settings): dimmer, inert, no hover affordance. */
.widget-cog:disabled { cursor: default; opacity: .22; }
.widget-cog:disabled:hover { color: var(--muted-2); background: transparent; border-color: transparent; }
.panel:hover .widget-cog:disabled, .stat:hover .widget-cog:disabled { opacity: .3; }

/* Two panels side by side, wrapping to one column when they no longer fit. Here
   rather than on the one page that first needed it: `components/check-tree.css`
   refines this grid, and a component refining a rule from `pages/` inverts the
   layer order the stylesheet list is built on. Its only user today is the
   access-group editor. */
.panel-pair {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(var(--panel-col), 1fr));
}
