/* KLIP admin — dark "liquid glass" control room.
   Every color, radius, shadow, font-size, z-index, duration and easing in
   this file is a var() from tokens.css; there is not a single raw literal.
   Spacing stays in plain rem/px (same convention as the archbot sheet).

   Motion policy: this file declares NO transition or animation outside the
   `@media (prefers-reduced-motion: no-preference)` section at the bottom.
   Under `reduce`, every state below still resolves — it just resolves
   instantly, which is the correct behaviour, not a degraded one. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-panel-solid);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--font-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: var(--font-2xl);
}

h3 {
  font-size: var(--font-xl);
}

h4 {
  font-size: var(--font-lg);
}

/* Visually hidden, still reachable by assistive tech: the "VIP" behind the ★
   glyph, and the "Nalaganje …" behind a skeleton. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------------- */
/* Focus — one visible ring for every interactive surface, glass included.  */
/* ---------------------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
  box-shadow: var(--ring);
}

/* ---------------------------------------------------------------------- */
/* Controls                                                                 */
/* ---------------------------------------------------------------------- */

button {
  font: inherit;
  font-size: var(--font-md);
  font-weight: 500;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.42rem 0.85rem;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 26%, transparent);
  border-color: var(--accent);
  color: var(--text);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Secondary / ghost buttons: the toolbar logout and every in-card action. */
button.logout,
.tab,
.pagination button,
.entity-toggle,
.variant-remove {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

button.logout:hover:not(:disabled),
.pagination button:hover:not(:disabled),
.entity-toggle:hover:not(:disabled),
.variant-remove:hover:not(:disabled) {
  background: var(--bg-input);
  border-color: var(--border-strong);
  color: var(--text);
}

input,
select,
textarea {
  font: inherit;
  font-size: var(--font-md);
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
}

input:hover:not(:disabled),
select:hover:not(:disabled),
textarea:hover:not(:disabled) {
  border-color: var(--border-strong);
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.5;
}

label {
  display: block;
  font-size: var(--font-sm);
  color: var(--text-faint);
  margin-bottom: 0.25rem;
}

/* ---------------------------------------------------------------------- */
/* Glass surfaces — the two elevation tiers. `.view` / `.kpi-card` /        */
/* `.feed-panel` are the only true cards; `.panel` is a FLAT inset inside   */
/* one of them, so nothing ever reads as a card inside a card.              */
/* ---------------------------------------------------------------------- */

.view,
.kpi-card,
.feed-panel,
.login-form {
  background: var(--bg-panel);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--edge);
}

.panel {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

/* ---------------------------------------------------------------------- */
/* App shell: glass top bar, wordmark, health dot, pill tabs                 */
/* ---------------------------------------------------------------------- */

.app {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-toolbar);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1.25rem;
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--edge);
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0;
  white-space: nowrap;
}

.wordmark {
  font-size: var(--font-xl);
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--text);
}

.brand-sub {
  font-size: var(--font-sm);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text-faint);
}

/* Health dot — never color-only: a labelled dot with a visible caption.
   The caption is aria-hidden because the dot itself carries the name. */
.health {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.55rem 0.2rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-input);
}

.health-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--text-faint);
  flex: none;
}

.health-text {
  font-size: var(--font-xs);
  color: var(--text-faint);
  letter-spacing: 0.01em;
}

.health-ok .health-dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent);
}

.health-ok .health-text {
  color: var(--text-muted);
}

.health-down .health-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 22%, transparent);
}

.health-down {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
}

.health-down .health-text {
  color: var(--danger);
}

/* Pill tab nav. The active indicator is a ::before fill that pops from
   scale(.92) + opacity 0 -- transform/opacity only, so it composites on the
   GPU and never touches layout. */
.tabs {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-input);
  /* min-width:0 is load-bearing: without it this flex item is sized by its
     min-content width and pushes the whole page wider than a phone viewport
     instead of scrolling inside itself. */
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  position: relative;
  isolation: isolate;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 0.34rem 0.85rem;
  white-space: nowrap;
}

.tab::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  box-shadow: var(--edge);
  opacity: 0;
  transform: scale(0.92);
}

.tab:hover:not(.tab-active) {
  color: var(--text);
}

.tab-active {
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 34%, transparent);
}

.tab-active::before {
  opacity: 1;
  transform: scale(1);
}

.topbar .logout {
  margin-left: auto;
}

main {
  padding: 1.5rem 1.25rem 3rem;
  max-width: 1180px;
  margin: 0 auto;
}

.view {
  padding: 1.25rem 1.35rem 1.4rem;
  margin-bottom: 1.25rem;
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

/* One line of orientation under a view heading — what this list is and what
   acting on it does. Measure-capped, because a full 1180 px line of prose is
   unreadable next to 13 px card text. */
.view-lead {
  margin: 0 0 1rem;
  max-width: 62ch;
  font-size: var(--font-md);
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------- */
/* Pregled stanja — KPI grid + live feed. These cards ARE the surfaces:     */
/* the dashboard is not wrapped in a `.view`, so no card sits in a card.    */
/* ---------------------------------------------------------------------- */

.dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dashboard-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.dashboard-header h2 {
  margin: 0;
}

.dashboard-stamp {
  font-size: var(--font-xs);
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.kpi-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.1rem 1.1rem;
  min-width: 0;
}

/* Reserves two lines so a label that wraps ("Poslana obvestila danes") does
   not push its number out of line with the rest of the row. */
.kpi-label {
  margin: 0;
  font-size: var(--font-xs);
  font-weight: 600;
  line-height: 1.4;
  min-height: 2.8em;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.kpi-value {
  margin: 0;
  font-size: clamp(var(--font-3xl), 5vw, calc(var(--font-3xl) * 1.6));
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.kpi-delta,
.kpi-note {
  margin: 0;
  font-size: var(--font-sm);
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.kpi-delta-up {
  color: var(--ok);
}

.kpi-delta-down {
  color: var(--danger);
}

.kpi-delta-flat {
  color: var(--text-faint);
}

/* The sparkline inherits its stroke from `currentColor`. `margin-top: auto`
   pins it to the card floor, so every chart in the row shares a baseline
   however tall the grid stretches the cards. The fixed height (with
   preserveAspectRatio="none" + vector-effect on the polyline) keeps the chart
   the same 40px band at every card width instead of growing to a 4:1 slab on
   a one-column phone layout; the stroke stays exactly 2px either way. */
.kpi-spark {
  display: block;
  width: 100%;
  height: 40px;
  margin-top: auto;
  padding-top: 0.6rem;
  color: var(--accent);
  overflow: visible;
}

.feed-panel {
  padding: 1.15rem 1.35rem 1.25rem;
}

.feed-panel h3 {
  margin-bottom: 0.75rem;
}

.feed-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.feed-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.8rem 0.6rem;
  border-top: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.feed-item:first-child {
  border-top: 0;
}

.feed-item:hover {
  background: var(--bg-input);
}

.feed-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: var(--font-xs);
  font-weight: 600;
}

.feed-time {
  margin-left: auto;
  font-size: var(--font-xs);
  color: var(--text-faint);
  white-space: nowrap;
}

/* A VIP marker inside the entity chip stays flat -- a bordered pill inside a
   bordered pill is one nesting level too many. */
.chip .badge {
  margin-left: 0.1rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--warn-text);
}

.feed-title {
  margin: 0;
  font-size: var(--font-lg);
  font-weight: 500;
  color: var(--text);
  overflow-wrap: anywhere;
}

.feed-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: var(--font-sm);
  color: var(--text-faint);
}

/* ---------------------------------------------------------------------- */
/* Forms / filters                                                          */
/* ---------------------------------------------------------------------- */

.filters {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.field label {
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.field input,
.field select,
.field textarea {
  width: 100%;
}

/* A standing note is prose, not a value -- it gets the full row rather than
   one 160px grid cell. */
.field-wide {
  grid-column: 1 / -1;
}

/* S9-02: the per-mention decision note sits between the snippet and the
   decision buttons -- label, field, save, on one line where there is room. */
.review-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.5rem 0;
}

.review-note label {
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.review-note input {
  flex: 1 1 16rem;
}

/* A submit button dropped straight into the grid would otherwise stretch to
   fill a whole 1fr cell and read as the loudest thing on the panel. */
.field-grid > button {
  align-self: end;
  justify-self: start;
}

.entity-form,
.edit-panel {
  margin-bottom: 1.25rem;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--font-md);
  color: var(--text-muted);
  margin: 0.5rem 0.75rem 0.5rem 0;
}

.checkbox-label input {
  accent-color: var(--accent);
}

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}

.hint {
  display: block;
  font-size: var(--font-xs);
  color: var(--text-faint);
  margin-top: 0.2rem;
}

/* ---------------------------------------------------------------------- */
/* Entitete — a card per entity. These sit INSIDE the `.view` glass panel,   */
/* so they are flat insets (the `.panel` tier), never a second glass card:   */
/* one card inside another card is the thing this sheet refuses to do.       */
/* ---------------------------------------------------------------------- */

/* No align-items: the cards in a row stretch to a shared height, which is what
   lets `.entity-meta`'s margin-top:auto put every chip row on one baseline
   however long the names above them wrap. */
.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
  gap: 0.75rem;
}

.entity-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.9rem 1rem 0.95rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 0;
}

.entity-card:hover {
  border-color: var(--border-strong);
}

/* Deactivated: dimmed, not hidden — it is still findable, just clearly not
   in play. The "Neaktivna" badge is the non-opacity half of that signal. */
.entity-card-inactive {
  opacity: 0.62;
}

.entity-card-inactive:hover,
.entity-card-inactive:focus-within {
  opacity: 1;
}

/* An open editor spans the whole grid row instead of stretching one column
   into a tower and dragging its neighbours' heights with it. */
.entity-card-open {
  grid-column: 1 / -1;
  border-color: var(--border-strong);
}

.entity-head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
}

/* The disc's hue comes from tokens.css reading the per-card --avatar-hue that
   admin.js sets as a plain number. Nothing here knows a color. */
.entity-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: var(--font-md);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.entity-ident {
  min-width: 0;
}

.entity-name {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  margin: 0;
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}

.entity-vip {
  color: var(--warn-text);
  font-size: var(--font-md);
  line-height: 1;
}

.entity-context {
  margin: 0.15rem 0 0;
  font-size: var(--font-sm);
  color: var(--text-faint);
  overflow-wrap: anywhere;
}

.entity-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.entity-kind,
.entity-tier,
.entity-owner {
  font-size: var(--font-xs);
  color: var(--text-muted);
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.entity-tier {
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
  background: var(--accent-soft);
}

.entity-meta .badge {
  margin-left: 0;
}

/* The row's actions travel together at its end. Grouping them means that on a
   narrow card the PAIR wraps to the next line, instead of "Brifing" ending
   line one and "Uredi" stranded underneath it. */
.entity-actions {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
}

/* The editor inside an expanded card: a divided region, not a nested panel. */
.edit-panel {
  border-top: 1px solid var(--border);
  padding-top: 0.9rem;
}

/* ---------------------------------------------------------------------- */
/* Viri — a source-health list. Dead sources first (sorted in JS), status    */
/* carried by a dot AND its word, so color is never the only signal.         */
/* ---------------------------------------------------------------------- */

.source-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.source-card {
  padding: 0.8rem 0.95rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.source-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.source-name {
  margin: 0;
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* A fixed status column so every source NAME starts at the same x and the list
   scans as one column, not as a ragged edge behind three different words. */
.source-state {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  order: -1;
  min-width: 7.5rem;
}

.source-status {
  font-size: var(--font-xs);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.source-dot {
  width: 9px;
  height: 9px;
  border-radius: var(--radius-pill);
  flex: none;
}

.source-dot-ok {
  background: var(--ok);
}

.source-dot-warn {
  background: var(--warn-text);
}

.source-dot-down {
  background: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 22%, transparent);
}

/* The left edge repeats the state at card scale, so a long list scans in one
   pass without reading a single label. */
.source-card-ok {
  border-left-color: color-mix(in srgb, var(--ok) 45%, transparent);
}

.source-card-warn {
  border-left-color: var(--warn-text);
}

.source-card-down {
  border-left-color: var(--danger);
}

.source-card-ok .source-status {
  color: var(--ok);
}

.source-card-warn .source-status {
  color: var(--warn-text);
}

.source-card-down .source-status {
  color: var(--danger);
}

.source-url {
  margin: 0.35rem 0 0;
  font-size: var(--font-sm);
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.source-meta {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin: 0.45rem 0 0;
  font-size: var(--font-sm);
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.source-lag {
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------- */
/* Iskanje — a card per mention, sharing the review card's snippet styling.  */
/* ---------------------------------------------------------------------- */

.mention-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.mention-card {
  padding: 0.85rem 1rem 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.mention-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.mention-date {
  margin-left: auto;
  font-size: var(--font-xs);
  color: var(--text-faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.mention-title {
  margin: 0.45rem 0 0;
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}

.mention-title a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
}

.mention-title a:hover {
  color: var(--accent-strong);
  border-bottom-color: var(--accent);
}

.mention-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.55rem;
  font-size: var(--font-sm);
  color: var(--text-faint);
}

.status-badge {
  font-size: var(--font-2xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.12rem 0.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}

.status-pending_review {
  color: var(--warn-text);
  border-color: color-mix(in srgb, var(--warn-text) 38%, transparent);
}

.status-confirmed {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 38%, transparent);
}

.status-auto_confirmed {
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
}

.status-rejected {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 38%, transparent);
}

/* ---------------------------------------------------------------------- */
/* Badges                                                                   */
/* ---------------------------------------------------------------------- */

.badge {
  display: inline-block;
  font-size: var(--font-2xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  margin-left: 0.4rem;
  vertical-align: middle;
}

.badge-vip {
  background: color-mix(in srgb, var(--warn-text) 16%, transparent);
  border-color: color-mix(in srgb, var(--warn-text) 40%, transparent);
  color: var(--warn-text);
}

.badge-inactive {
  background: var(--bg-input);
  color: var(--text-faint);
}

.badge-source {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent-strong);
  margin-left: 0.5rem;
}

/* ---------------------------------------------------------------------- */
/* Variants                                                                 */
/* ---------------------------------------------------------------------- */

.variants-panel {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.variant-chips {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* Generated and learned variants are server-owned: quiet, and with no delete
   control at all, because DELETE returns 422 for them. */
.variant-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.18rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-input);
  max-width: 100%;
}

/* A hand-added variant is the only editable one, so it is the only one that
   carries accent weight. */
.variant-chip-manual {
  border-color: color-mix(in srgb, var(--accent) 34%, transparent);
  background: var(--accent-soft);
}

.variant-name {
  color: var(--text);
  font-size: var(--font-md);
  overflow-wrap: anywhere;
}

.variant-source {
  font-size: var(--font-2xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.variant-chip-manual .variant-source {
  color: var(--accent-strong);
}

.variant-remove {
  padding: 0 0.3rem;
  border: 0;
  border-radius: var(--radius-pill);
  font-size: var(--font-xl);
  line-height: 1;
}

.variant-add {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

/* Capped: a variant is a name, not a paragraph, and a full-width input
   promises room the content never needs. */
.variant-add .field {
  flex: 1 1 12rem;
  max-width: 24rem;
}

.variant-add button {
  margin-top: 1.35rem;
}

/* ---------------------------------------------------------------------- */
/* Inline field validation — said next to the field it is about, never in a  */
/* banner at the top of a form the user has to go looking for.              */
/* ---------------------------------------------------------------------- */

.field-error {
  margin: 0.3rem 0 0;
  font-size: var(--font-xs);
  color: var(--danger);
}

input[aria-invalid="true"] {
  border-color: var(--danger);
}

/* ---------------------------------------------------------------------- */
/* Review queue                                                            */
/* ---------------------------------------------------------------------- */

.review-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.review-item {
  padding: 0.95rem 1.05rem;
}

.review-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.review-source {
  color: var(--text-faint);
  font-size: var(--font-sm);
  margin-left: auto;
}

.review-title {
  margin: 0.2rem 0;
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--text);
}

.review-snippet {
  margin: 0.4rem 0;
  color: var(--text-muted);
  font-size: var(--font-md);
}

.review-snippet mark {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-radius: var(--radius-sm);
  padding: 0 0.2rem;
}

/* The fact line: the score, and — in Kuracija's auto mode — when the mail
   actually went out. One row, so the eye reads them as one footnote. */
.review-confidence {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin: 0.2rem 0 0.6rem;
  font-size: var(--font-sm);
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* Separator instead of a second border or dot element. */
.review-sent::before {
  content: "·";
  margin-right: 0.85rem;
}

.review-actions {
  display: flex;
  gap: 0.5rem;
}

.review-actions button:last-child {
  background: transparent;
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
}

.review-actions button:last-child:hover:not(:disabled) {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  color: var(--danger);
}

/* ---------------------------------------------------------------------- */
/* Shared state boxes: loading / empty / error                              */
/* ---------------------------------------------------------------------- */

.state-box {
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  margin: 0.5rem 0;
  font-size: var(--font-md);
}

.loading {
  color: var(--text-faint);
}

.empty {
  color: var(--text-faint);
  background: var(--bg-input);
  border: 1px dashed var(--border-strong);
  text-align: center;
}

.error-box {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.error-box button {
  background: transparent;
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
}

.error-box button:hover:not(:disabled) {
  background: color-mix(in srgb, var(--danger) 18%, transparent);
  color: var(--danger);
}

/* A background refresh that failed while stale data is still on screen. */
.stale-note {
  margin: 0;
}

/* ---------------------------------------------------------------------- */
/* Skeletons — placeholders that occupy EXACTLY the space their content     */
/* will: same container class, same item height. Swapping one for the other */
/* must not move a single pixel. The shapes are aria-hidden; the visually    */
/* hidden "Nalaganje …" is what a screen reader gets.                        */
/* ---------------------------------------------------------------------- */

.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.skeleton {
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border);
}

.skeleton-row {
  height: 2.4rem;
}

/* Heights mirror the loaded card they stand in for (measured in Chrome, all
   within a pixel or two of the real thing). */
.skeleton-kpi {
  height: 11.25rem;
}

.skeleton-entity {
  height: 7.6rem;
}

.skeleton-source {
  height: 6.25rem;
}

.skeleton-mention {
  height: 8.6rem;
}

/* ---------------------------------------------------------------------- */
/* Toasts — the result of an ACTION. Bottom right, above every other layer, */
/* on the same glass as the top bar. Success clears itself; an error waits   */
/* for its × because it may still need reading.                             */
/* ---------------------------------------------------------------------- */

.toast-host {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: var(--z-modal-picker);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  /* The host spans the corner but must not swallow clicks where it is empty. */
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0.6rem 0.7rem 0.6rem 0.85rem;
  background: var(--glass-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--ok);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow), var(--edge);
  color: var(--text);
  font-size: var(--font-md);
  pointer-events: auto;
}

.toast-error {
  border-left-color: var(--danger);
  color: var(--danger);
}

.toast-text {
  overflow-wrap: anywhere;
}

.toast-close {
  flex: none;
  margin-left: auto;
  padding: 0 0.3rem;
  border: 0;
  background: transparent;
  color: var(--text-faint);
  font-size: var(--font-xl);
  line-height: 1;
}

.toast-close:hover:not(:disabled) {
  background: transparent;
  color: var(--text);
}

/* ---------------------------------------------------------------------- */
/* Pagination                                                               */
/* ---------------------------------------------------------------------- */

.pagination {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  font-size: var(--font-sm);
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------- */
/* Login                                                                    */
/* ---------------------------------------------------------------------- */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-form {
  width: 100%;
  max-width: 340px;
  padding: 1.75rem 1.6rem;
  box-shadow: var(--glow), var(--edge);
}

.login-form .brand {
  margin-bottom: 1.25rem;
}

.login-form .wordmark {
  font-size: var(--font-3xl);
}

.login-form input {
  width: 100%;
}

.login-form button[type="submit"] {
  width: 100%;
  margin-top: 1rem;
  padding: 0.55rem 0.85rem;
}

/* ---------------------------------------------------------------------- */
/* Responsive                                                              */
/* ---------------------------------------------------------------------- */

@media (max-width: 1023px) {
  main {
    padding: 1rem 0.75rem 2rem;
  }

  .toast-host {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    align-items: stretch;
  }

  .toast {
    max-width: none;
  }

  .view {
    padding: 1rem;
  }

  .topbar {
    padding: 0.6rem 0.75rem;
    gap: 0.6rem;
  }

  .health-text {
    display: none;
  }

  .tabs {
    order: 3;
    width: 100%;
  }

  .feed-time {
    margin-left: 0;
  }
}

/* ---------------------------------------------------------------------- */
/* Motion — the ONLY section of this sheet that declares transitions.       */
/* Gated on `no-preference`, so `reduce` users get every state change       */
/* instantly rather than a softened one. Durations/easings are tokens.      */
/* ---------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  /* Profile cards lift on hover. Gated and tokenized like every other motion
     here -- under `reduce` the hover state still resolves, just instantly. */
  .profile-card {
    transition:
      border-color var(--motion-duration-fast) var(--motion-ease),
      transform var(--motion-duration-fast) var(--motion-ease),
      box-shadow var(--motion-duration-fast) var(--motion-ease);
  }

  button,
  input,
  select,
  .health,
  .health-dot,
  .health-text {
    transition:
      background-color var(--motion-duration-fast) var(--motion-ease),
      border-color var(--motion-duration-fast) var(--motion-ease),
      color var(--motion-duration-fast) var(--motion-ease),
      box-shadow var(--motion-duration-fast) var(--motion-ease);
  }

  /* The active-tab indicator: transform + opacity only, so it composites
     on the GPU. Starts at scale(.92), never at scale(0) -- an indicator
     that grows out of nothing reads as a glitch. */
  .tab::before {
    transition:
      opacity var(--motion-duration-base) var(--motion-ease),
      transform var(--motion-duration-base) var(--motion-ease);
  }

  /* Press feedback: the control acknowledges the click before the network
     does. Subtle on purpose -- this fires dozens of times per session. */
  button:active:not(:disabled) {
    transform: scale(0.97);
  }

  .feed-item {
    transition: background-color var(--motion-duration-fast) var(--motion-ease);
  }

  /* Tab switch: a fade and a 4 px rise, nothing that travels. The panel is
     remounted per view (key=${view} in App), so this replays on every switch
     and never on a data refresh inside one view. */
  @keyframes panel-enter {
    from {
      opacity: 0;
      transform: translateY(4px);
    }
  }

  .tab-panel {
    animation: panel-enter var(--motion-duration-base) var(--motion-ease) both;
  }

  /* Hover lift. Card surfaces only, and only on a real pointer: on touch,
     :hover sticks after a tap and the card would stay lifted. */
  @media (hover: hover) and (pointer: fine) {
    .kpi-card,
    .entity-card,
    .source-card,
    .mention-card {
      transition:
        transform var(--motion-duration-fast) var(--motion-ease),
        border-color var(--motion-duration-fast) var(--motion-ease);
    }

    .kpi-card:hover,
    .entity-card:hover,
    .source-card:hover,
    .mention-card:hover {
      transform: translateY(-2px);
    }
  }

  /* Skeleton pulse: opacity only, so it composites and costs nothing while a
     request is in flight. Slower than any interaction -- it is a heartbeat,
     not a blink. */
  @keyframes skeleton-pulse {
    50% {
      opacity: 0.45;
    }
  }

  .skeleton {
    animation: skeleton-pulse var(--motion-duration-pulse) var(--motion-ease) infinite;
  }

  /* Toasts enter from the edge they live on, so the motion says where they
     came from and a dismissal reads as a return. */
  @keyframes toast-enter {
    from {
      opacity: 0;
      transform: translateY(8px) scale(0.98);
    }
  }

  .toast {
    animation: toast-enter var(--motion-duration-base) var(--motion-ease) both;
  }
}

/* ---------------------------------------------------------------------- */
/* S9-01: the member briefing. On screen it is one more glass view; on     */
/* paper it is the whole page, which is what the @media print block below  */
/* is for.                                                                 */
/* ---------------------------------------------------------------------- */

.briefing-actions {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.briefing-period {
  margin: 0;
}

.briefing-actions button:last-child {
  margin-left: auto;
}

.briefing-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.briefing-head .entity-vip {
  margin-left: 0.35rem;
}

.briefing-context,
.briefing-period-line {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-size: var(--font-sm);
}

.briefing-note {
  border-left: 3px solid var(--accent);
  background: var(--bg-input);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  margin: 0 0 1rem;
}

.briefing-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}

.briefing-totals dt {
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.briefing-totals dd {
  margin: 0.1rem 0 0;
  font-size: var(--font-xl);
  font-weight: 600;
}

.briefing-sources {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.briefing-sources li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
}

.briefing-mentions {
  margin: 0;
  padding-left: 1.2rem;
}

.briefing-mentions li {
  margin-bottom: 0.9rem;
}

.briefing-mention-head {
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.briefing-mention-meta {
  color: var(--text-muted);
  font-size: var(--font-sm);
  white-space: nowrap;
}

.briefing-snippet {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
}

.briefing-mention-note {
  margin: 0.15rem 0 0;
  font-size: var(--font-sm);
  color: var(--accent-strong);
}

/* ---------------------------------------------------------------------- */
/* Print: the briefing IS the page. Everything that exists to navigate the */
/* app is chrome on paper, and the dark theme would burn a cartridge, so   */
/* print resets to black on white.                                         */
/* ---------------------------------------------------------------------- */

@media print {
  .topbar,
  .briefing-actions,
  .tabs,
  .toast-host {
    display: none !important;
  }

  body {
    background: var(--print-bg) !important;
    background-image: none !important;
    color: var(--print-text);
  }

  .view,
  .briefing {
    background: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none;
  }

  .briefing-context,
  .briefing-period-line,
  .briefing-mention-meta,
  .briefing-snippet,
  .briefing-totals dt,
  .briefing-mention-note {
    color: var(--print-muted) !important;
  }

  .briefing-note {
    background: none !important;
    border-left: 3px solid var(--print-rule);
  }

  /* A member's entry must not be split across two sheets mid-thought. */
  .briefing-mentions li {
    break-inside: avoid;
  }
}

/* ---------------------------------------------------------------------- */
/* S9-03: Dnevnik — the audit trail. A dense read-only list; a failed login */
/* is the one row that must catch the eye, so it carries a warn edge AND    */
/* its own label text (color is never the only signal).                     */
/* ---------------------------------------------------------------------- */

.audit-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.audit-row {
  display: grid;
  grid-template-columns: minmax(6rem, 8rem) minmax(9rem, 12rem) 1fr auto;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
}

.audit-row-warn {
  border-left-color: var(--warn);
  background: var(--bg-input);
}

.audit-actor {
  font-weight: 600;
}

.audit-action {
  color: var(--text-muted);
}

.audit-detail {
  color: var(--text-faint);
  overflow-wrap: anywhere;
}

.audit-time {
  color: var(--text-faint);
  font-size: var(--font-sm);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .audit-row {
    grid-template-columns: 1fr auto;
  }
}

/* ---------------------------------------------------------------------- */
/* S9-04: gold-set labelling. The entry point is a quiet action on the      */
/* Priklic KPI card; the view itself is one flat `.panel` per article       */
/* inside the `.view` glass, and each hit is a row separated by a hairline  */
/* — never a card inside a card inside a card. An undecided row keeps an    */
/* accent edge, so "what is left" is readable without counting.            */
/* ---------------------------------------------------------------------- */

/* `margin-top: auto` pins the action to the card floor, the same way the
   sparkline is pinned, so the KPI row keeps one baseline however tall the
   grid stretches the cards. */
.kpi-action {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 0.42rem;
  min-height: 2.5rem;
  background: transparent;
  color: var(--accent-strong);
  border-color: var(--border);
  font-size: var(--font-sm);
}

.kpi-action:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}

.gold-back {
  margin-bottom: 0.75rem;
}

.gold-back-button,
.gold-cancel,
.gold-add-open,
.gold-toggle {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.gold-back-button:hover:not(:disabled),
.gold-cancel:hover:not(:disabled),
.gold-add-open:hover:not(:disabled),
.gold-toggle:hover:not(:disabled) {
  background: var(--bg-input);
  border-color: var(--border-strong);
  color: var(--text);
}

/* The count is the sentence; the bar is its shape. A native <progress>
   carries the value to assistive tech without a role= of our own. */
.gold-progress {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin: 0 0 1.1rem;
  font-size: var(--font-md);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.gold-progress-bar {
  flex: 1 1 12rem;
  max-width: 22rem;
  height: 0.4rem;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--bg-input);
  color: var(--accent);
  overflow: hidden;
}

.gold-progress-bar::-webkit-progress-bar {
  background: var(--bg-input);
  border-radius: var(--radius-pill);
}

.gold-progress-bar::-webkit-progress-value {
  background: var(--accent);
  border-radius: var(--radius-pill);
}

.gold-progress-bar::-moz-progress-bar {
  background: var(--accent);
  border-radius: var(--radius-pill);
}

.gold-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.gold-article {
  padding: 1rem 1.1rem 0.9rem;
}

.gold-article-title {
  margin: 0 0 0.2rem;
  font-size: var(--font-lg);
  font-weight: 600;
  line-height: 1.35;
}

.gold-article-title a {
  color: var(--text);
  text-decoration: none;
}

.gold-article-title a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.gold-article-meta {
  margin: 0 0 0.6rem;
  font-size: var(--font-sm);
  color: var(--text-faint);
}

.gold-hits {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gold-hit {
  padding: 0.7rem 0 0.8rem 0.75rem;
  border-top: 1px solid var(--border);
  border-left: 2px solid var(--accent);
}

/* Decided: the edge steps back, the row stays fully legible. */
.gold-hit-done {
  border-left-color: transparent;
}

.gold-hit-head {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.gold-hit-name {
  font-weight: 600;
  color: var(--text);
}

.gold-hit-alias,
.gold-hit-position {
  font-size: var(--font-xs);
  color: var(--text-faint);
}

.gold-hit-position {
  margin-left: auto;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gold-hit-context {
  margin: 0.2rem 0 0;
  font-size: var(--font-sm);
  color: var(--text-muted);
}

.gold-snippet {
  margin: 0.45rem 0 0.65rem;
  font-size: var(--font-md);
  color: var(--text-muted);
  max-width: 78ch;
}

.gold-snippet mark {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-radius: var(--radius-sm);
  padding: 0 0.2rem;
}

/* A row a human added has no snippet to show, and must not look like one
   whose snippet failed to load. */
.gold-manual {
  margin: 0.45rem 0 0.65rem;
  font-size: var(--font-md);
  font-style: italic;
  color: var(--text-faint);
}

.gold-choice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Comfortably past the 44 px touch floor: this is the one control in the app
   that gets pressed hundreds of times in a sitting. */
.gold-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
}

.gold-toggle-yes[aria-pressed="true"] {
  background: color-mix(in srgb, var(--ok) 16%, transparent);
  border-color: color-mix(in srgb, var(--ok) 55%, transparent);
  color: var(--ok);
}

.gold-toggle-no[aria-pressed="true"] {
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  border-color: color-mix(in srgb, var(--danger) 50%, transparent);
  color: var(--danger);
}

/* The check is what makes the chosen state readable without colour. */
.gold-toggle-mark {
  font-weight: 700;
}

.gold-saving {
  font-size: var(--font-xs);
  color: var(--text-faint);
}

.gold-hit-error {
  margin: 0.4rem 0 0;
  font-size: var(--font-xs);
  color: var(--danger);
}

.gold-add {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

.gold-add-form {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.gold-add-form .field {
  flex: 1 1 14rem;
  max-width: 26rem;
}

.gold-add-form button {
  margin-top: 1.35rem;
}

.gold-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.gold-empty-hint {
  margin: 0;
  max-width: 52ch;
  text-align: center;
  font-size: var(--font-md);
  color: var(--text-faint);
}

.skeleton-gold {
  height: 13.5rem;
}

@media (max-width: 720px) {
  /* Thumb-first: the two verdicts share the row's full width, and the
     position tag stops being pushed to a line of its own. */
  .gold-choice .gold-toggle {
    flex: 1 1 10rem;
    justify-content: center;
  }

  .gold-hit-position {
    margin-left: 0;
  }

  .gold-add-form .field {
    max-width: none;
  }
}

/* ---------------------------------------------------------------------------
   Profili -- the landing view: one card per member in the news right now.
   --------------------------------------------------------------------------- */

.view-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.window-switch {
  display: flex;
  gap: 0.35rem;
}

/* The chip is already the app's small-pill primitive; only the pressed state
   is new, and it inverts rather than recolouring so the active window reads at
   a glance without adding a second accent. */
.chip[aria-pressed] {
  cursor: pointer;
}

.chip-active {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--surface);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 0.85rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.profile-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
  height: 100%;
  padding: 0.9rem;
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: inherit;
  font: inherit;
}

.profile-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.profile-card:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.profile-card-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.profile-card-name {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  font-weight: 650;
  /* Member names are long and the grid is narrow; two lines then ellipsis keeps
     every card the same height without hiding half the list. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.profile-card-stats {
  font-size: var(--font-sm);
  color: var(--text-muted);
}

.profile-card-stats strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.profile-card-foot {
  margin-top: auto;
  font-size: var(--font-xs);
  color: var(--text-faint);
}

/* Article rows in a profile drill-down. The whole row is the link -- the title
   alone would be a small target for a list you skim. */
.article-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.6rem;
}

.article-item {
  padding: 0.8rem 0.95rem;
}

.article-link {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-decoration: none;
  color: inherit;
}

.article-link:hover .article-title {
  text-decoration: underline;
}

.article-title {
  font-weight: 600;
}

.article-meta {
  font-size: var(--font-xs);
  color: var(--text-faint);
}

.linklike {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-strong);
  font: inherit;
  cursor: pointer;
}

.linklike:hover {
  text-decoration: underline;
}
