/* OneTwin Ops Console — Analytics panel shared classes (prefix an-; global so drill-card content can use them).
   Avoid .table/.row/.card/.chip/.page-title: Bootstrap and console.css already style those. */

/* ---- cards ---- */
.an-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.an-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 0;
  flex-wrap: wrap;
}
.an-card-title { font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.an-card-body { padding: 12px 18px 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.an-card-note { font-size: 11.5px; color: var(--text-faint); font-family: var(--font-mono); }

.an-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.an-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1500px) { .an-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* breadcrumb inside a drill card */
.an-crumbs { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-family: var(--font-mono); color: var(--text-faint); flex-wrap: wrap; }
.an-crumbs button { background: none; border: none; padding: 0; color: var(--text-muted); font: inherit; cursor: pointer; }
.an-crumbs button:hover { color: var(--accent); }
.an-crumbs .current { color: var(--text-2); }
.an-crumbs .sep { color: var(--text-ghost); }

/* ---- stat tiles ---- */
.an-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.an-stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 13px 16px;
  text-align: left;
  font-family: var(--font-ui);
  color: inherit;
}
button.an-stat { cursor: pointer; }
button.an-stat:hover { border-color: var(--accent-border); }
.an-stat-num { font-size: 22px; font-weight: 600; font-family: var(--font-mono); margin-top: 4px; color: var(--text); }
.an-stat-num.ok { color: var(--ok); }
.an-stat-num.danger { color: var(--danger); }
.an-stat-num.muted { color: var(--text-muted); }
.an-stat-hint { font-size: 11px; color: var(--text-faint); font-family: var(--font-mono); margin-top: 2px; }

/* ---- tables ---- */
.an-table { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.an-thead, .an-tr { display: grid; align-items: center; column-gap: 14px; padding: 0 14px; }
.an-thead { background: var(--surface-2); border-bottom: 1px solid var(--border); }
.an-thead > div { padding: 9px 0; }
.an-thead .sortable { cursor: pointer; user-select: none; }
.an-thead .sortable:hover { color: var(--text-2); }
.an-tr { border-bottom: 1px solid var(--border-soft); font-size: 12.5px; color: var(--text-2); min-height: 38px; }
.an-tr:last-child { border-bottom: none; }
.an-tr > div { padding: 8px 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-tr.clickable { cursor: pointer; }
.an-tr.clickable:hover { background: rgba(255,255,255,.025); }
.an-tr.selected { background: var(--accent-dim); }
.an-tr .wrap { white-space: normal; word-break: break-word; }
.an-num { font-family: var(--font-mono); text-align: right; }
.an-mono { font-family: var(--font-mono); }
.an-muted { color: var(--text-faint); }
.an-pager { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; border-top: 1px solid var(--border-soft); font-size: 11.5px; color: var(--text-faint); font-family: var(--font-mono); }
.an-pager-btns { display: flex; gap: 6px; }
.an-pager button { background: var(--surface-2); border: 1px solid var(--border-input); color: var(--text-2); border-radius: var(--r-sm); padding: 3px 9px; font-family: var(--font-mono); font-size: 11.5px; cursor: pointer; }
.an-pager button:disabled { color: var(--text-ghost); cursor: default; }

/* ---- small labels ---- */
.an-tag {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  /* a tag is as wide as its text even when it is a grid cell itself (it used to stretch, text stuck to the left) */
  width: fit-content; max-width: 100%; justify-self: start; align-self: center; box-sizing: border-box;
  border: 1px solid var(--border-input); border-radius: 999px;
  padding: 3px 10px; font-size: 11px; line-height: 1.5; font-family: var(--font-mono); color: var(--text-muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.an-tag.amber { color: var(--accent); border-color: var(--accent-border); background: var(--accent-dim); }
.an-tag.danger { color: var(--danger); border-color: var(--danger-border); background: var(--danger-bg); }
.an-tag.ok { color: var(--ok); border-color: var(--ok-border); background: var(--ok-bg); }

/* ---- states ---- */
.an-empty { padding: 26px 18px; text-align: center; font-size: 12.5px; color: var(--text-faint); font-family: var(--font-mono); }
.an-error { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-size: 12.5px; color: #f8b4b4; font-family: var(--font-mono);
  background: var(--danger-bg); border: 1px solid var(--danger-border); border-radius: var(--r-md); }
.an-error button { margin-left: auto; }
.an-notcollected { display: flex; align-items: center; gap: 10px; padding: 16px; border: 1px dashed var(--border-input);
  border-radius: var(--r-md); color: var(--text-muted); font-size: 12.5px; }
.an-notcollected a { color: var(--accent); text-decoration: none; margin-left: auto; font-family: var(--font-mono); font-size: 12px; }
.an-skeleton { height: 120px; border-radius: var(--r-md);
  background: linear-gradient(90deg, var(--surface-2) 0%, #151922 50%, var(--surface-2) 100%); background-size: 200% 100%;
  animation: an-shimmer 1.4s linear infinite; }
@keyframes an-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---- filter bar ---- */
.an-filter { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 32px 0; }
.an-filter .segmented button { padding: 5px 11px; font-size: 11.5px; }
.an-filter input[type=date], .an-filter select {
  background: var(--surface-2); border: 1px solid var(--border-input); border-radius: var(--r-md);
  color: var(--text); font-family: var(--font-mono); font-size: 12px; padding: 6px 9px; color-scheme: dark; outline: none;
}
.an-filter input[type=date]:focus, .an-filter select:focus { border-color: var(--accent-border); }
.an-check { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.an-check input { accent-color: var(--accent); }
.an-tz { margin-left: auto; font-size: 11px; color: var(--text-faint); font-family: var(--font-mono); }

/* ---- switch ---- */
.an-switch { position: relative; width: 34px; height: 19px; flex-shrink: 0; border-radius: 10px; border: none; cursor: pointer;
  background: #262c38; transition: background-color var(--dur-base) var(--ease); }
.an-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--text-muted); transition: transform var(--dur-base) var(--ease), background-color var(--dur-base) var(--ease); }
.an-switch.on { background: var(--accent); }
.an-switch.on::after { transform: translateX(15px); background: var(--accent-ink); }
.an-switch:disabled { opacity: .45; cursor: default; }

/* ---- slide-over ---- */
.an-slide { position: fixed; inset: 0; z-index: 220; }
.an-slide-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(620px, 92vw); z-index: 221;
  background: var(--panel); border-left: 1px solid var(--border-input); box-shadow: -24px 0 64px rgba(0,0,0,.5);
  display: flex; flex-direction: column; animation: an-slide-in var(--dur-slow) var(--ease) backwards;
}
@keyframes an-slide-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- geo note ---- */
.an-geo { font-size: 10.5px; color: var(--text-ghost); font-family: var(--font-mono); line-height: 1.5; }

/* ---- text blocks ---- */
.an-pre { font-family: var(--font-mono); font-size: 12px; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
  background: var(--input-bg); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; color: var(--text-2);
  max-height: 420px; overflow: auto; margin: 0; }
.an-frame { display: block; }
.an-frame.dim { color: var(--text-faint); }
.an-frame.app { color: var(--text); }

/* ---- legend ---- */
.an-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-muted); }
.an-legend span { display: inline-flex; align-items: center; gap: 6px; }
.an-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.an-legend i.line { height: 2px; width: 14px; border-radius: 1px; }

/* ---- confirm dialog (copy of Main.razor.css's scoped confirm styles) ---- */
.an-confirm { z-index: 240; }  /* above .an-modal (230): a confirmation can open over a dialog (consent publish) */
.an-confirm .confirm-panel { padding: 24px 26px; display: flex; flex-direction: column; gap: 14px; }
.an-confirm .confirm-head { display: flex; align-items: center; gap: 9px; }
.an-confirm .confirm-icon { color: var(--danger); }
.an-confirm .confirm-title { font-size: 15px; font-weight: 600; color: var(--text); }
.an-confirm .confirm-target { display: flex; flex-direction: column; gap: 3px; padding: 10px 13px; background: var(--input-bg);
  border: 1px solid var(--border-hard); border-left: 2px solid var(--danger); border-radius: var(--r-md); }
.an-confirm .target-name { font-size: 13.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-confirm .confirm-text { font-size: 12.5px; color: var(--text-muted); line-height: 1.55; margin: 0; }
.an-confirm .confirm-text p { margin: 0 0 8px; }
.an-confirm .confirm-text ul { margin: 0 0 8px; padding-left: 18px; }
.an-confirm .field { padding: 0 !important; }
.an-confirm .confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.an-confirm .btn-danger-solid, .an-btn-danger {
  display: inline-flex; align-items: center; gap: 7px; background: var(--danger); color: #14161b; font-size: 12.5px; font-weight: 700;
  font-family: var(--font-ui); padding: 9px 16px; border: none; border-radius: var(--r-md); cursor: pointer; }
.an-confirm .btn-danger-solid:hover:not(:disabled), .an-btn-danger:hover:not(:disabled) { background: #fca5a5; }
.an-confirm .btn-danger-solid:disabled, .an-btn-danger:disabled { opacity: .5; cursor: default; }

/* ---- charts ---- */
.an-chart { position: relative; width: 100%; }
.an-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.an-chart text { font-family: var(--font-mono); font-size: 10.5px; fill: var(--text-faint); }
.an-chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.an-chart .axis { stroke: var(--chart-axis); stroke-width: 1; }
.an-chart .hit { fill: transparent; cursor: pointer; outline: none; }
.an-chart .hit:focus-visible { stroke: var(--accent-border); stroke-width: 1; }
.an-chart .hover-band { fill: rgba(255,255,255,.035); }
.an-chart .crosshair { stroke: var(--text-ghost); stroke-width: 1; stroke-dasharray: 3 3; }
.an-chart .label-in { fill: var(--text-2); font-size: 11px; }
.an-chart .value-in { fill: var(--text-muted); }
.an-chart .placeholder { fill: url(#an-hatch); }
.an-tip {
  position: absolute; pointer-events: none; z-index: 5; transform: translate(-50%, calc(-100% - 10px));
  background: var(--surface-3); border: 1px solid var(--border-hard); border-radius: var(--r-md);
  padding: 7px 10px; font-size: 11.5px; color: var(--text-2); font-family: var(--font-mono); white-space: nowrap;
  box-shadow: 0 10px 28px rgba(0,0,0,.45);
}
.an-tip b { color: var(--text); font-weight: 600; }
.an-tip-row { display: flex; align-items: center; gap: 7px; }
.an-tip i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.an-tip.left { transform: translate(-100%, -50%); margin-left: -10px; }

/* ---- funnel ---- */
.an-funnel { display: flex; flex-direction: column; gap: 6px; flex: 1 0 auto; justify-content: space-evenly; }
.an-funnel-step { display: grid; grid-template-columns: 170px 1fr 80px 130px; align-items: center; gap: 12px;
  background: none; border: none; padding: 5px 0; color: var(--text-2); font-family: var(--font-ui); font-size: 12.5px; text-align: left; cursor: pointer; }
.an-funnel-step:disabled { cursor: default; }
.an-funnel-step:hover:not(:disabled) .an-funnel-track { background: #171c25; }
.an-funnel-track { height: 18px; background: var(--surface-2); border-radius: var(--r-sm); overflow: hidden; display: block; }
.an-funnel-bar { display: block; height: 100%; background: var(--accent); border-radius: var(--r-sm);
  transition: width 520ms cubic-bezier(.3,.7,.2,1); animation: an-grow-x 520ms cubic-bezier(.25,.8,.25,1) backwards; transform-origin: 0 50%; }
.an-funnel-value, .an-funnel-conv { animation: an-fade-up 300ms var(--ease) backwards; }
.an-funnel-track { height: 22px; }
.an-funnel-value { font-family: var(--font-mono); text-align: right; color: var(--text); }
.an-funnel-conv { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }

.an-link { font-size: 12px; font-family: var(--font-mono); color: var(--text-muted); text-decoration: none; }
.an-link:hover { color: var(--accent); }
.an-switcher button { padding: 5px 10px; font-size: 11.5px; }

/* ---- user data settings ---- */
.an-uds-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.an-uds-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; margin-top: 6px; }
.an-uds-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-2); padding: 4px 0; min-width: 0; }
.an-lockable { transition: opacity 320ms var(--ease), filter 320ms var(--ease); }
.an-stack { display: flex; flex-direction: column; gap: 18px; }
.an-lockable.locked { opacity: .38; filter: grayscale(.8); pointer-events: none; user-select: none; }

/* ---- user detail ---- */
.an-user-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.an-user-name { font-size: 19px; font-weight: 600; color: var(--text); }
.an-user-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }
.an-user-meta b { color: var(--text-2); font-weight: 500; }
.an-user-meta.an-user-line { align-items: center; min-height: 24px; }
.an-backlink { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 11px; box-sizing: border-box;
  background: var(--surface-2); border: 1px solid var(--border-input); border-radius: var(--r-md); color: var(--text-2);
  font-size: 12.5px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: color 150ms var(--ease), border-color 150ms var(--ease), transform 200ms var(--ease); }
.an-backlink:hover { color: var(--accent); border-color: var(--accent-border); }
.an-backlink:hover svg { transform: translateX(-2px); }
.an-backlink svg { transition: transform 200ms var(--ease); }
.an-user-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.an-online { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 10px; padding: 8px 12px; border-radius: var(--r-md);
  background: var(--ok-bg); border: 1px solid var(--ok-border); font-size: 12px; font-family: var(--font-mono); color: var(--ok); }
.an-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.an-progress { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.an-progress > span { display: block; height: 100%; background: var(--accent); transition: width var(--dur-base) var(--ease); }

/* ---- session timeline ---- */
.an-timeline { display: flex; flex-direction: column; }
.an-tl-row { display: grid; grid-template-columns: 66px 18px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 5px 8px;
  border-radius: var(--r-sm); font-size: 12.5px; color: var(--text-2); }
.an-tl-row:hover { background: rgba(255,255,255,.02); }
.an-tl-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
.an-tl-icon { font-family: var(--font-mono); color: var(--text-ghost); text-align: center; }
.an-tl-text { min-width: 0; word-break: break-word; }
.an-tl-row:has(.an-tl-text > span:first-child) .an-tl-text > span:first-child { font-family: var(--font-mono); font-size: 12px; }
.an-tl-row.error .an-tl-icon { color: var(--danger); font-weight: 700; }
.an-tl-row.leading { background: rgba(255,197,61,.035); }
.an-tl-row.focus { background: var(--danger-bg); outline: 1px solid var(--danger-border); }
.an-tl-error { background: none; border: none; padding: 0; color: #f8b4b4; font: inherit; font-family: var(--font-mono); font-size: 12px; cursor: pointer; text-align: left; }
.an-tl-error:hover { text-decoration: underline; }

/* ---- error status select ---- */
.an-status { background: var(--surface-2); border: 1px solid var(--border-input); border-radius: var(--r-sm); color: var(--text-2);
  font-family: var(--font-mono); font-size: 11.5px; padding: 3px 6px; color-scheme: dark; cursor: pointer; }
.an-status.new { color: var(--accent); border-color: var(--accent-border); }
.an-status.investigating { color: var(--series-1); }
.an-status.resolved { color: var(--ok); border-color: var(--ok-border); }

/* ---- data settings ---- */
.an-master { border-color: var(--accent-border); }
.an-master.off { border-color: var(--danger-border); background: var(--danger-bg); }
.an-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 24px; }
.an-type-row { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
.an-type-row .an-switch { margin-top: 2px; }
.an-type-row.off .an-type-name { color: var(--text-muted); }
.an-type-name { font-size: 13px; font-weight: 600; color: var(--text); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.an-consent-form { display: flex; flex-direction: column; gap: 14px; }
.an-consent-form textarea { resize: vertical; font-family: var(--font-ui); line-height: 1.5; }
.an-consent-form .invalid { border-color: var(--danger-border); }
.an-text-titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.an-text-titles > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-text-part { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.an-text-part-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.an-text-part-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.an-text-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 900px) { .an-text-split { grid-template-columns: minmax(0, 1fr); } }
/* text box and preview share one height: the taller content, at least 240px (consent-preview.js fit); grows with the text */
.an-consent-form textarea.an-text-body { min-height: 240px; resize: none; overflow: hidden; font-family: var(--font-mono); font-size: 12.5px; }
.an-legal-preview { min-height: 240px; overflow: hidden; padding: 14px 18px; border: 1px solid var(--border-input); border-radius: var(--r-md);
    background: var(--input-bg); color: var(--text-2); font-size: 13.5px; line-height: 1.6; overflow-wrap: anywhere; }
/* same structure as the public legal pages (legal.css): title, version line, body */
.an-legal-preview .legal-doc > h1 { margin: 0 0 4px; font-size: 20px; color: var(--text); line-height: 1.3; }
.an-legal-preview .legal-version { margin: 0 0 18px; font-size: 12px; color: var(--text-muted); }
.an-legal-preview .legal-body h1 { margin: 28px 0 12px; font-size: 18px; color: var(--text); }
.an-legal-preview .legal-body h2 { margin: 22px 0 10px; font-size: 15.5px; color: var(--text); }
.an-legal-preview .legal-body h3 { margin: 18px 0 8px; font-size: 14px; color: var(--text); }
.an-legal-preview .legal-body > :first-child { margin-top: 0; }
.an-legal-preview .legal-body p { margin: 0 0 10px; }
.an-legal-preview .legal-body hr { margin: 22px 0; border: 0; border-top: 1px solid var(--border); }
.an-legal-preview .legal-body ul, .an-legal-preview .legal-body ol { margin: 0 0 10px; padding-left: 22px; }
.an-legal-preview .legal-body ul { list-style: disc; }
.an-legal-preview .legal-body ol { list-style: decimal; }
.an-legal-preview .legal-body li + li { margin-top: 3px; }
.an-legal-preview .legal-body strong { color: var(--text); font-weight: 600; }
.an-legal-preview .legal-body a { color: var(--accent); text-decoration: underline; }
.an-legal-preview .legal-table-wrap { margin: 12px 0; overflow-x: auto; }
.an-legal-preview .legal-body table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 12.5px; overflow-wrap: normal; }
.an-legal-preview .legal-body th, .an-legal-preview .legal-body td { padding: 6px 8px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.an-legal-preview .legal-body th { background: var(--surface-2); color: var(--text); }
.an-legal-preview .legal-error { color: var(--danger); margin: 0; }

/* ---- alerts drawer ---- */
.an-alert { padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.an-alert.unread { border-color: var(--accent-border); }
.an-alert-head { display: flex; align-items: center; gap: 8px; }
.an-alert-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.an-alert-text { font-size: 12.5px; color: var(--text-2); word-break: break-word; }
.an-alert-actions { display: flex; gap: 14px; }

/* ---- floating chart tooltip (analytics.js initTips) ---- */
.an-tip-float {
  position: fixed; display: none; pointer-events: none; z-index: 400; white-space: pre; max-width: 420px;
  background: var(--surface-3); border: 1px solid var(--border-hard); border-radius: var(--r-md);
  padding: 7px 10px; font-size: 11.5px; line-height: 1.5; color: var(--text-2); font-family: var(--font-mono);
  box-shadow: 0 10px 28px rgba(0,0,0,.45);
}
.an-chart .hit:hover { fill: rgba(255,255,255,.045); }
.an-chart rect.cell:hover { stroke: var(--accent); stroke-width: 1.5; }
.an-chart circle.hit:hover { fill: rgba(255,197,61,.18); }

/* ---- layout polish: sticky header, panes, equal cards, "show all" ---- */
.an-sticky { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--border-soft); padding-bottom: 12px; }
.an-sticky .an-tabs { border-bottom: none; padding-top: 12px; }
.an-tab { position: relative; transition: color var(--dur-base) var(--ease); }
.an-tab.active { border-bottom-color: transparent; }
.an-pane { display: none; flex-direction: column; gap: 18px; }
/* opacity only: a transform here would trap the fixed side panels and dialogs inside the pane */
.an-pane.active { display: flex; animation: an-pane-in var(--dur-slow) var(--ease) backwards; }
@keyframes an-pane-in { from { opacity: 0; } to { opacity: 1; } }

.an-grid-2 > .an-card, .an-grid-2 > div > .an-card { height: 400px; }
.an-grid-2 > .an-card > .an-card-body, .an-grid-2 > div > .an-card > .an-card-body { min-height: 0; }
.an-grid-2 { align-items: stretch; }

.an-showall { align-self: flex-start; background: none; border: 1px solid var(--border-input); border-radius: var(--r-sm);
  color: var(--text-muted); font-family: var(--font-mono); font-size: 11.5px; padding: 4px 10px; cursor: pointer; }
.an-showall { animation: an-fade-up 280ms var(--ease) backwards; }
.an-showall:hover { color: var(--accent); border-color: var(--accent-border); }

.an-nodata { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border: 1px dashed var(--border-input);
  border-radius: var(--r-lg); color: var(--text-muted); font-size: 13px; }

/* ---- Map tab (globe from wwwroot/js/analytics-map.js) ---- */
.an-map { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; }
.an-map-stage { position: relative; height: 580px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); overflow: hidden; }
.an-map-globe { position: absolute; inset: 0; }
.an-map-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-family: var(--font-mono); font-size: 12px; }
.an-map-hint { position: absolute; left: 14px; bottom: 10px; z-index: 2; pointer-events: none;
  font-family: var(--font-mono); font-size: 10.5px; color: var(--text-faint); }
.an-map-list { height: 580px; overflow-y: auto; }
.an-map-list .an-map-item { display: flex; justify-content: space-between; gap: 10px; padding: 7px 6px; font-size: 13px;
  border-bottom: 1px solid var(--border-soft); cursor: pointer; border-radius: var(--r-sm); }
.an-map-list .an-map-item:hover { background: rgba(255,255,255,.03); }
.an-map-list .an-map-item.sel { background: var(--accent-dim); }
.an-map-list .an-map-item b { font-family: var(--font-mono); font-weight: 400; color: var(--text-muted); white-space: nowrap; }
.an-map-list .an-map-item .f { color: var(--danger); }
.an-map-circles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.an-map-anchor { position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; border-radius: 50%;
  will-change: transform; transition: opacity 160ms; }
.an-map-anchor.leaving { pointer-events: none !important; }
.an-map-circle { pointer-events: none; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font: 600 11px var(--font-mono); color: var(--accent-ink);
  box-shadow: 0 0 0 4px rgba(255,197,61,.18), 0 4px 14px rgba(0,0,0,.5);
  animation: an-circle-in 320ms cubic-bezier(.2,.8,.3,1.2) backwards; }
.an-map-circle.users { background: var(--accent); }
.an-map-circle.failed { background: var(--danger); box-shadow: 0 0 0 4px rgba(248,113,113,.2), 0 4px 14px rgba(0,0,0,.5); }
.an-map-circle.multi { outline: 2px solid rgba(255,255,255,.25); outline-offset: 2px; }
.an-map-circle.out { animation: an-circle-out 380ms ease-in both; }
@keyframes an-circle-in { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes an-circle-out { from { transform: scale(1); opacity: 1; } to { transform: scale(.35); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .an-map-circle, .an-map-circle.out { animation-duration: 1ms; } }
.an-map-tip { position: fixed; display: none; pointer-events: none; z-index: 10000; white-space: pre;
  background: var(--panel); border: 1px solid var(--border-hard); border-radius: var(--r-md); padding: 6px 9px;
  font: 11.5px var(--font-mono); color: var(--text-2); box-shadow: 0 10px 28px rgba(0,0,0,.45); }
.an-map-stage .float-tooltip-kap { font: 11.5px var(--font-mono) !important; color: var(--text-2) !important; }
.an-map-stage .float-tooltip-kap:not(:empty) { background: var(--panel) !important; border: 1px solid var(--border-hard);
  border-radius: var(--r-md); padding: 6px 9px !important; }
.an-map-stage.over-circle .float-tooltip-kap { display: none !important; }
@media (max-width: 1100px) { .an-map { grid-template-columns: 1fr; } .an-map-list { height: auto; max-height: 320px; } }

/* ---- motion: sliding indicators (positioned by analytics.js initSliders) ---- */
.an-tabs { position: relative; }
.an-tab-line { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; border-radius: 2px; background: var(--accent);
  pointer-events: none; transition: transform 320ms cubic-bezier(.3,.7,.2,1), width 320ms cubic-bezier(.3,.7,.2,1), opacity 160ms; }
[data-slide].segmented .seg-pill { left: 0; width: 0; opacity: 0;
  transition: transform 280ms cubic-bezier(.3,.7,.2,1), width 280ms cubic-bezier(.3,.7,.2,1), opacity 160ms; }
[data-slide].segmented button { background: none !important; transition: color 200ms var(--ease); }

/* ---- drill cards: fixed header with back arrow and path; the body slides ---- */
.an-card-head { min-height: 52px; }
.an-card-title { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; }
.an-card-title > span:first-child { overflow: hidden; text-overflow: ellipsis; }
/* back button: same height/border/radius as the view switchers next to it; folded (width 0) at the root */
.an-card-title .an-back { flex: none; box-sizing: border-box; width: 0; height: 35px; margin: 0 -6px 0 0; padding: 0; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; opacity: 0; transform: scale(.7);
  border: 1px solid var(--border-input); border-radius: var(--r-md); background: var(--surface-2); color: var(--text-2);
  cursor: pointer; pointer-events: none;
  transition: width 300ms cubic-bezier(.3,.7,.2,1), margin 300ms cubic-bezier(.3,.7,.2,1), opacity 220ms var(--ease),
    transform 300ms cubic-bezier(.2,.8,.3,1.25), color 150ms, border-color 150ms; }
.an-card-title.drilled .an-back { width: 35px; margin-right: 4px; opacity: 1; transform: none; pointer-events: auto; }
.an-card-title .an-back:hover { color: var(--accent); border-color: var(--accent-border); }
.an-card-title .an-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.an-card-title .an-crumb-root { color: var(--text); font-weight: 600; cursor: default; transition: color 250ms var(--ease); }
.an-card-title.drilled .an-crumb-root { color: var(--text-muted); cursor: pointer; }
.an-crumb-sep { animation: an-fade 240ms var(--ease) backwards; }
.an-crumb-root, .an-crumb { background: none; border: none; padding: 0; font: inherit; color: var(--text-muted); cursor: pointer;
  transition: color 150ms; }
.an-card-title.drilled .an-crumb-root:hover, .an-crumb:hover { color: var(--accent); }
.an-crumb-sep { color: var(--text-ghost); }
.an-crumb.current { color: var(--text); overflow: hidden; text-overflow: ellipsis; max-width: 260px;
  animation: an-fade-right 240ms var(--ease) backwards; }
.an-view { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.an-view.fwd { animation: an-slide-from-right 300ms cubic-bezier(.25,.8,.25,1) backwards; }
.an-view.back { animation: an-slide-from-left 300ms cubic-bezier(.25,.8,.25,1) backwards; }
.an-view.swap { animation: an-fade-up 260ms var(--ease) backwards; }
.an-subbar { display: flex; align-items: center; gap: 10px; font-size: 12px; }
@keyframes an-slide-from-right { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes an-slide-from-left { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes an-fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes an-fade-right { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@keyframes an-pop-in { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .an-view, .an-crumb.current, .an-crumb-sep { animation: none !important; }
  .an-card-title .an-back, .an-card-body { transition: none !important; }
  .an-tab-line, [data-slide].segmented .seg-pill { transition: none !important; }
}

/* ---- toggle switch (filter bar "Internal accounts") ---- */
.an-toggle { position: relative; display: inline-flex; align-items: center; gap: 9px; height: 34px; padding: 0 12px 0 8px;
  background: var(--surface-2); border: 1px solid var(--border-input); border-radius: var(--r-md); cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--text-muted); user-select: none;
  transition: border-color 200ms var(--ease), color 200ms var(--ease), background-color 200ms var(--ease); }
.an-toggle:hover { border-color: var(--accent-border); }
.an-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.an-toggle-track { position: relative; width: 30px; height: 17px; border-radius: 9px; background: var(--border-input);
  transition: background-color 240ms var(--ease); flex: none; }
.an-toggle-knob { position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--text-muted);
  box-shadow: 0 1px 3px rgba(0,0,0,.4); transition: transform 260ms cubic-bezier(.3,.7,.3,1.25), background-color 240ms var(--ease); }
.an-toggle.on { color: var(--text); background: var(--accent-dim); border-color: var(--accent-border); }
.an-toggle.on .an-toggle-track { background: var(--accent); }
.an-toggle.on .an-toggle-knob { transform: translateX(13px); background: var(--accent-ink); }
.an-toggle input:focus-visible + .an-toggle-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.an-toggle:active .an-toggle-knob { width: 16px; }
.an-toggle.on:active .an-toggle-knob { transform: translateX(10px); }

/* ---- chart motion: line draws in, area rises, dots and bars pop/grow (replayed when the data changes) ---- */
.an-anim .an-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: an-draw 700ms cubic-bezier(.4,.1,.2,1) forwards; }
.an-anim .an-area { transform-box: fill-box; transform-origin: 50% 100%; animation: an-rise 650ms cubic-bezier(.25,.8,.25,1) backwards; }
.an-anim .an-dot { transform-box: fill-box; transform-origin: center; animation: an-dot-in 260ms cubic-bezier(.2,.8,.3,1.4) backwards; }
.an-anim .an-bar { transform-box: fill-box; transform-origin: 50% 100%; animation: an-grow-y 420ms cubic-bezier(.25,.8,.25,1) backwards; }
.an-anim .an-hbar { transform-box: fill-box; transform-origin: 0 50%; animation: an-grow-x 420ms cubic-bezier(.25,.8,.25,1) backwards; }
.an-anim .an-line-thin { animation: an-fade 500ms 300ms var(--ease) backwards; }
@keyframes an-draw { to { stroke-dashoffset: 0; } }
@keyframes an-rise { from { opacity: 0; transform: scaleY(.2); } to { opacity: 1; transform: none; } }
@keyframes an-dot-in { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: none; } }
@keyframes an-grow-y { from { transform: scaleY(0); } to { transform: none; } }
@keyframes an-grow-x { from { transform: scaleX(0); } to { transform: none; } }
@keyframes an-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .an-anim .an-line { stroke-dasharray: none; stroke-dashoffset: 0; animation: none; }
  .an-anim .an-area, .an-anim .an-dot, .an-anim .an-bar, .an-anim .an-hbar, .an-anim .an-line-thin { animation: none; }
}

/* ---- overlays: exit animations (OverlayState) and the centred modal ---- */
.an-slide.closing .an-slide-panel { animation: an-slide-out 240ms var(--ease) both; }
@keyframes an-slide-out { from { transform: none; opacity: 1; } to { transform: translateX(40px); opacity: 0; } }
.an-slide.closing, .an-modal.closing { pointer-events: none; }
.an-modal { position: fixed; inset: 0; z-index: 230; display: flex; align-items: center; justify-content: center; padding: 4vh 3vw; }
.an-modal .scrim { position: absolute; inset: 0; z-index: 0; }  /* console.css gives the scrim z-index 200: keep it under the panel */
.an-modal-panel { position: relative; z-index: 2; width: min(900px, 94vw); max-height: 92vh; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--border-hard); border-radius: var(--r-modal);
  box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: an-modal-in 300ms cubic-bezier(.2,.8,.3,1.1) backwards; }
.an-modal-panel .dialog-body { overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.an-modal-panel .dialog-body > * { flex-shrink: 0; }  /* the body scrolls; its blocks keep their height */
.an-modal.closing .an-modal-panel { animation: an-modal-out 220ms var(--ease) both; }
@keyframes an-modal-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes an-modal-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(8px) scale(.97); } }
@media (prefers-reduced-motion: reduce) { .an-modal-panel, .an-slide-panel { animation-duration: 1ms !important; } }

/* ---- card sizing: cards in a row stretch to the tallest; chart heights glide when they change ---- */
.an-grid-2 > .an-card, .an-grid-2 > div > .an-card { height: auto; min-height: 0; }  /* a row is as tall as its taller card */
/* body height = what the content needs, set by analytics.js syncHeights and glided by this transition; in a row the
   shorter card's body grows (flex) and its fill boxes take the space. No container-type/transform here: either would
   trap the fixed "Show all" dialogs inside the card. */
.an-card-body { flex: 1 0 auto; box-sizing: border-box; transition: height 380ms cubic-bezier(.3,.7,.2,1); }
.an-card-body.an-gliding { overflow-y: clip; }
.an-view { flex: 1; }
/* content never squeezes to fit a body that hasn't glided yet: it keeps its height (clipped while gliding), so the
   height analytics.js measures is the real one */
.an-card-body > *, .an-view > *, .an-col > * { flex-shrink: 0; }
.an-fill { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow-y: clip; }
.an-fill > .an-table { flex: 1 0 auto; }
.an-fill[data-fill="rows"] { justify-content: center; }  /* a few bar rows, stretched to the cap, sit in the middle */
.an-size { position: relative; }
.an-size > svg { width: 100%; height: auto; display: block; }
.an-anim .an-cell { animation: an-fade 360ms var(--ease) backwards; }

/* ---- summary strip ---- */
.an-summary { margin-top: auto; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 1px;
  background: var(--border-soft); border: 1px solid var(--border-soft); border-radius: var(--r-lg); overflow: hidden; }
.an-summary-item { background: var(--surface); padding: 9px 12px; min-width: 0; animation: an-fade-up 320ms var(--ease) backwards; }
.an-summary-value { font-family: var(--font-mono); font-size: 17px; color: var(--text); margin-top: 3px; white-space: nowrap; }
.an-summary-value.ok { color: var(--ok); }
.an-summary-value.danger { color: var(--danger); }
.an-summary-sub { font-size: 11px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (prefers-reduced-motion: reduce) { .an-card-body { transition: none; } .an-summary-item, .an-anim .an-cell { animation: none; } }

/* ---- entrances everywhere: cards rise in (staggered per pane), table rows and numbers fade in ---- */
.an-pane.active .an-card, .an-pane.active .an-stat { animation: an-card-in 420ms cubic-bezier(.25,.8,.25,1) backwards; }
.an-pane.active .an-card:nth-child(2), .an-pane.active .an-stat:nth-child(2) { animation-delay: 40ms; }
.an-pane.active .an-card:nth-child(3), .an-pane.active .an-stat:nth-child(3) { animation-delay: 80ms; }
.an-pane.active .an-card:nth-child(4), .an-pane.active .an-stat:nth-child(4) { animation-delay: 120ms; }
.an-pane.active .an-card:nth-child(5), .an-pane.active .an-stat:nth-child(5) { animation-delay: 160ms; }
.an-pane.active .an-card:nth-child(n+6), .an-pane.active .an-stat:nth-child(n+6) { animation-delay: 200ms; }
@keyframes an-card-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.an-tr { animation: an-fade-up 260ms var(--ease) backwards; }
.an-tr:nth-child(2) { animation-delay: 20ms; } .an-tr:nth-child(3) { animation-delay: 40ms; } .an-tr:nth-child(4) { animation-delay: 60ms; }
.an-tr:nth-child(5) { animation-delay: 80ms; } .an-tr:nth-child(6) { animation-delay: 100ms; } .an-tr:nth-child(n+7) { animation-delay: 120ms; }
.an-tr { transition: background-color 150ms var(--ease); }
.an-stat-num { animation: an-fade-up 300ms var(--ease) backwards; }
.an-skeleton { animation: an-shimmer 1.4s linear infinite, an-fade 200ms var(--ease) backwards; }
.an-error, .an-empty, .an-nodata { animation: an-fade-up 260ms var(--ease) backwards; }
.an-stat { transition: border-color 200ms var(--ease), transform 200ms var(--ease), background-color 200ms var(--ease); }
button.an-stat:hover { transform: translateY(-2px); }
.an-card { transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease); }
@media (prefers-reduced-motion: reduce) {
  .an-pane.active .an-card, .an-pane.active .an-stat, .an-tr, .an-stat-num, .an-error, .an-empty, .an-nodata { animation: none !important; }
}

/* ---- filter bar: range text cross-slides, the custom date inputs open while the controls on the right slide aside ---- */
.an-range-box { overflow-x: clip; overflow-clip-margin: 6px; transition: width 320ms cubic-bezier(.3,.7,.2,1); flex: none; }
.an-range-inner { display: inline-flex; align-items: center; width: max-content; }
.an-range-custom { display: inline-flex; align-items: center; gap: 12px; animation: an-fade-right 300ms var(--ease) backwards; }
.an-range { display: inline-grid; font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); white-space: nowrap; }
.an-range > span { grid-area: 1 / 1; }
.an-range > .in { animation: an-range-in 320ms cubic-bezier(.25,.8,.25,1) backwards; }
.an-range > .out { animation: an-range-out 260ms var(--ease) both; pointer-events: none; }
@keyframes an-range-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
@keyframes an-range-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-9px); } }
@media (prefers-reduced-motion: reduce) { .an-range-box { transition: none; } .an-range > span, .an-range-custom { animation: none; } }

/* ---- failed sign-ins by reason: one row per reason (name, share bar, total, share, trend) ---- */
.an-reasons { display: flex; flex-direction: column; border: 1px solid var(--border-soft); border-radius: var(--r-md); overflow: hidden; }
.an-reason { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(60px, 1fr) 48px 42px 96px; align-items: center; gap: 12px;
  padding: 8px 12px; font-size: 12.5px; color: var(--text-2); border-bottom: 1px solid var(--border-soft); animation: an-fade-up 260ms var(--ease) backwards; }
.an-reason:last-child { border-bottom: none; }
.an-reason-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-share { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.an-share > span { display: block; height: 100%; border-radius: 3px; background: var(--danger); transform-origin: 0 50%;
  animation: an-grow-x 500ms cubic-bezier(.25,.8,.25,1) backwards; }

/* side-by-side blocks inside a card that still fill it (Training › Searches) */
.an-grow { flex: 1 0 auto; }
.an-col { display: flex; flex-direction: column; min-width: 0; }

/* status pill with a dot (sign-in results); a table swap that keeps the old rows dimmed while the new ones load */
.an-tag.dot { gap: 6px; padding: 3px 11px 3px 9px; }
.an-tag.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.an-swap { display: flex; flex-direction: column; flex: 1 0 auto; gap: 12px; transition: opacity 200ms var(--ease); }
.an-swap.busy { opacity: .5; pointer-events: none; }

/* ---- error detail: message → where → stack → steps before the error → environment (smaller) ---- */
.an-err-msg { font-family: var(--font-mono); font-size: 15px; line-height: 1.5; color: var(--text); white-space: pre-wrap; word-break: break-word;
  padding: 12px 14px; background: var(--danger-bg); border: 1px solid var(--danger-border); border-left: 3px solid var(--danger); border-radius: var(--r-md); }
.an-err-where { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.an-err-method { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--accent); }
.an-pre.tall { max-height: 560px; }
.an-pre .an-frame.app { color: var(--text); font-weight: 600; }
.an-err-meta { font-size: 11.5px; margin-top: 4px; }
.an-err-env .micro-label { font-size: 10px; }
.an-steps-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.an-steps-open { margin-left: auto; background: none; border: none; cursor: pointer; }
.an-common { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 12px; font-size: 12.5px; color: var(--text-2);
  background: var(--accent-dim); border: 1px solid var(--accent-border); border-radius: var(--r-md); animation: an-fade-up 300ms var(--ease) backwards; }
.an-common-count { font-family: var(--font-mono); font-weight: 700; color: var(--accent); }
.an-common-step { font-family: var(--font-mono); font-size: 12px; color: var(--text); }
.an-steps-box { animation: an-fade 260ms var(--ease) backwards; }
.an-steps { list-style: none; margin: 0; padding: 6px 0; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--input-bg);
  display: flex; flex-direction: column; }
.an-steps li { display: grid; grid-template-columns: 76px 20px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 5px 14px;
  font-size: 12.5px; color: var(--text-2); animation: an-fade-up 260ms var(--ease) backwards; }
.an-step-ago { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); text-align: right; }
.an-step-icon { font-family: var(--font-mono); color: var(--text-ghost); text-align: center; }
.an-step-text { min-width: 0; word-break: break-word; }
.an-steps li.err { background: var(--danger-bg); color: #f8b4b4; font-weight: 600; }
.an-steps li.err .an-step-icon, .an-steps li.err .an-step-ago { color: var(--danger); }

/* overlays close with their blur: console.css keeps the backdrop blur static (cheap while open), so without this the
   blur stayed at full strength until the overlay was removed and then vanished at once (a flash) */
.an-modal .scrim.closing, .an-slide .scrim.closing { animation: an-unblur 220ms var(--ease) forwards; }
@keyframes an-unblur { from { backdrop-filter: blur(var(--scrim-blur)); -webkit-backdrop-filter: blur(var(--scrim-blur)); }
  to { backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0); } }
.an-note-tag { transition: opacity 260ms var(--ease), filter 260ms var(--ease); }
.an-note-tag.faint { opacity: .4; filter: grayscale(1); }

/* ---- tables: frame to the card bottom with ruled empty space, centred empty state, "Show all" as the table's footer ---- */
.an-table { display: flex; flex-direction: column; }
.an-table > * { flex-shrink: 0; }
.an-table-rest { flex: 1 0 0; min-height: 0;
  background: repeating-linear-gradient(to bottom, transparent 0 37px, rgba(255,255,255,.035) 37px 38px); }
.an-table > .an-empty { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 96px; padding: 22px 18px; }
.an-table > .an-empty::before { content: ""; width: 26px; height: 26px; border-radius: 50%; border: 1.5px dashed var(--border-input); }
.an-table-foot { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 36px; flex-shrink: 0;
  background: var(--surface-2); border: none; border-top: 1px solid var(--border); color: var(--text-muted);
  font-family: var(--font-mono); font-size: 11.5px; cursor: pointer; animation: an-foot-in 280ms var(--ease) backwards;
  transition: color 150ms var(--ease), background-color 150ms var(--ease); }
.an-table-foot span { transition: transform 200ms var(--ease); }
.an-table-foot:hover { color: var(--accent); background: var(--accent-dim); }
.an-table-foot:hover span { transform: translateX(3px); }
@keyframes an-foot-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.an-thead { position: relative; }
.an-tr:nth-child(even of .an-tr) { background: rgba(255,255,255,.012); }
.an-tr.clickable:hover { background: rgba(255,197,61,.05); }
.an-tr.selected { box-shadow: inset 2px 0 0 var(--accent); background: var(--accent-dim) !important; }

/* ---- consent (2026-11-20: optional consent) ---- */
.an-consent { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; min-width: 0; }
.an-tag.dot:not(.ok):not(.danger):not(.amber)::before { background: var(--text-ghost); }
.an-consent-strip { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); font-size: 12.5px;
  animation: an-fade-up 300ms var(--ease) backwards; }
.an-consent-strip > .micro-label { margin-right: 6px; }
.an-consent-strip button { background: none; border: 1px solid transparent; border-radius: var(--r-sm); padding: 3px 8px;
  color: var(--text-muted); font: inherit; cursor: pointer; transition: border-color 150ms var(--ease), color 150ms var(--ease); }
.an-consent-strip button b { font-family: var(--font-mono); font-weight: 600; color: var(--text); margin-right: 3px; }
.an-consent-strip button.ok b { color: var(--ok); }
.an-consent-strip button.danger b { color: var(--danger); }
.an-consent-strip button.amber b { color: var(--accent); }
.an-consent-strip button:hover { border-color: var(--border-input); color: var(--text-2); }
.an-consent-bar { display: flex; flex: 1 1 160px; max-width: 320px; height: 6px; margin: 0 8px; border-radius: 3px; overflow: hidden;
  background: var(--surface-2); }
.an-consent-bar i { display: block; height: 100%; transition: width 400ms var(--ease); }
.an-consent-bar i.ok { background: var(--ok); } .an-consent-bar i.danger { background: var(--danger); }
.an-consent-bar i.amber { background: var(--accent); } .an-consent-bar i.muted { background: var(--text-ghost); }
.an-consent-strip .an-card-note { margin-left: auto; }
.an-collect-off { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; border-radius: var(--r-md);
  background: var(--danger-bg); border: 1px solid var(--danger-border); color: #f8b4b4; font-size: 12.5px;
  animation: an-fade-up 300ms var(--ease) backwards; }
.an-collect-off b { color: var(--text); font-weight: 600; }
.an-empty.reason { color: #f8b4b4; }
.an-consent-history { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.an-consent-history > div { display: grid; grid-template-columns: 140px 130px 60px minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 7px 12px; font-size: 12.5px; color: var(--text-2); border-bottom: 1px solid var(--border-soft); }
.an-consent-history > div:last-child { border-bottom: none; }
.an-uds-declined { margin-top: 8px; padding: 9px 12px; border-radius: var(--r-md); font-size: 12.5px; color: #f8b4b4;
  background: var(--danger-bg); border: 1px solid var(--danger-border); }
.an-lockable.faded { opacity: .55; transition: opacity 320ms var(--ease); }
.an-user-consent { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.an-mini-btn { background: var(--surface-2); border: 1px solid var(--border-input); border-radius: var(--r-sm); padding: 2px 9px;
  color: var(--text-2); font-family: var(--font-ui); font-size: 11.5px; font-weight: 600; cursor: pointer;
  transition: color 150ms var(--ease), border-color 150ms var(--ease); }
.an-mini-btn:hover { color: var(--accent); border-color: var(--accent-border); }

/* ---- account e-mails: language pick (password reset, resend) ---- */
.an-lang-pick { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.an-lang-seg { display: inline-flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--border-input); border-radius: var(--r-md); padding: 3px; }
.an-lang-seg button { background: none; border: none; border-radius: var(--r-sm); padding: 4px 12px; font-family: var(--font-mono); font-size: 11.5px;
  font-weight: 600; color: var(--text-muted); cursor: pointer; transition: color 150ms var(--ease), background-color 150ms var(--ease); }
.an-lang-seg button:hover { color: var(--text); }
.an-lang-seg button.active { background: var(--accent); color: var(--accent-ink); }
.an-lang-seg button:disabled { cursor: default; }
.an-confirm .confirm-text .an-confirm-warn { margin: 12px 0 8px; padding: 8px 11px; border: 1px solid var(--accent-border); background: var(--accent-dim); border-radius: var(--r-md);
  color: var(--accent); font-size: 12.5px; }

/* ---- alert rules: per-rule e-mail switch ---- */
.an-rule-mail { display: inline-flex; align-items: center; gap: 7px; margin: 2px 0 0; flex-shrink: 0; cursor: pointer;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
.an-switch.small { width: 28px; height: 16px; }
.an-switch.small::after { width: 12px; height: 12px; }
.an-switch.small.on::after { transform: translateX(12px); }

/* ---- alert e-mail recipients (two lists of admins) ---- */
.an-recipients { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: stretch; }  /* both cards as tall as the taller one */
@media (max-width: 1100px) { .an-recipients { grid-template-columns: minmax(0, 1fr); } }
.an-recipient-warn { display: flex; align-items: center; gap: 9px; padding: 8px 11px; border-radius: var(--r-md); font-size: 12.5px;
  color: var(--danger); background: var(--danger-bg); border: 1px solid var(--danger-border); }
.an-recipient-warn.soft { color: var(--text-muted); background: var(--surface-2); border-color: var(--border-input); }
.an-recipient-list { display: flex; flex-direction: column; flex-shrink: 0; }
.an-recipient { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.an-recipient-who { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.an-recipient-name { font-size: 13px; font-weight: 600; color: var(--text); }
.an-recipient-mail { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; }
.an-recipient-note { font-family: var(--font-mono); font-size: 11px; color: var(--danger); }
.an-recipient.faded .an-recipient-name, .an-recipient.faded .an-recipient-mail { opacity: .5; }
.an-recipient-add { display: flex; align-items: center; gap: 10px; padding-top: 4px; flex-shrink: 0; }  /* no margin-top:auto: syncHeights would count the stretched space as need and the cards would grow forever */
.an-recipient-add select { padding: 6px 8px; font-size: 12px; min-width: 0; flex: 1; max-width: 340px; }
.an-recipient-add .btn-secondary { padding: 6px 14px; }
/* recipient cards: every change animates, also in the shorter card of the row (which only stretches, so its own height
   never glides). Things that come in only fade/slide (no height animation): syncHeights measures them the moment they
   are added. Things that go fold away in place, then the list is read again and the card glides. */
.an-recipient-top > .an-swap { position: relative; }
.an-recipient-top .an-recipient-warn { margin-top: 12px; }
.an-swap-in { animation: an-fade-up 260ms var(--ease) backwards; }
.an-card-head > .an-swap-in { animation-name: an-fade; }
/* replaced: fades out over the new band (absolute: not counted as content) */
.an-swap-over { position: absolute; left: 0; right: 0; top: 0; pointer-events: none; animation: an-out-fade 240ms var(--ease) forwards; }
/* nothing replaces it: folds away */
.an-swap-fold { overflow: hidden; pointer-events: none; animation: an-out-fold 240ms var(--ease) forwards; }
.an-recipient { animation: an-fade-up 260ms var(--ease) backwards; }
.an-recipient.leaving { overflow: hidden; pointer-events: none; animation: an-out-fold 240ms var(--ease) forwards; }
@keyframes an-out-fade { from { opacity: 1; } to { opacity: 0; } }
@keyframes an-out-fold {
  from { opacity: 1; max-height: 80px; }
  to { opacity: 0; max-height: 0; margin-top: 0; padding-top: 0; padding-bottom: 0; border-top-width: 0; border-bottom-width: 0; }
}
/* Add with nothing picked does nothing: look like it */
.an-recipient-add .btn-secondary:disabled { opacity: .4; cursor: not-allowed; }
.an-recipient-add select:has(option:checked[value=""]) { color: var(--text-faint); }
@media (prefers-reduced-motion: reduce) {
  .an-swap-in, .an-recipient, .an-swap-over, .an-swap-fold, .an-recipient.leaving { animation-duration: 1ms; }
}
.an-recipient-add select option { color: var(--text-2); }
