/* Panel components and layout (UI.md §4–§8). Logical properties only. Colours come from tokens.css (--sh-*).
   Radius hierarchy: surfaces (cards, tables, modals) 14px · controls (buttons, inputs, nav items) 9px · chips pill. */

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga", "calt";
}

/* Info is a calm blue (Bootstrap's cyan sits too close to petrol). */
:root, [data-bs-theme="light"] {
  --bs-info-text-emphasis: #1F4F8F;
  --bs-info-bg-subtle: #E8EFF9;
  --bs-info-border-subtle: #BDD0EC;
}
[data-bs-theme="dark"] {
  --bs-info-text-emphasis: #A4C3F0;
  --bs-info-bg-subtle: #14233A;
  --bs-info-border-subtle: #27466F;
}

/* ---------- typography ---------- */
/* Headings use the narrower widths of Instrument Sans; body text stays at full width for reading. */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-stretch: 92%; letter-spacing: -0.012em; }
#main-content h1 { font-size: 1.75rem; font-weight: 650; font-stretch: 90%; letter-spacing: -0.016em; line-height: 1.15; }
#main-content h1 + p { margin-top: 0.25rem; }
.tracking-tight { letter-spacing: -0.015em; }
.tabular-nums, .tabular { font-variant-numeric: tabular-nums; }
.text-caption { font-size: 0.8125rem; }
p { max-width: 75ch; }
.table p, .card p, .modal p, .dropdown-menu p { max-width: none; }

/* Links: a quiet underline that keeps links recognisable in running text. */
a { text-decoration-thickness: 1px; text-underline-offset: 0.2em;
    text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
    transition: color 0.15s ease, text-decoration-color 0.15s ease; }
a:hover { text-decoration-color: currentColor; }

/* The short link is the hero object (UI.md §1): petrol text in the panel font, medium weight, tabular figures — no
   fill or border. Copying it flashes a soft petrol highlight behind it (see "copy feedback"). */
.short-url {
  display: inline-block;
  max-width: 100%;
  align-self: flex-start;   /* .card is a flex column: keep it to its text width */
  font-weight: 560;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.005em;
  color: var(--sh-shorturl-color);
  border-radius: 4px;
}
.short-url.small { font-size: 0.9375em; }
/* fragments/short-link.html: host muted, back-half strong, a quiet copy button that answers on hover. */
.short-link { display: inline-flex; align-items: center; gap: 0.25rem; max-width: 100%; min-width: 0; vertical-align: middle; }
.short-link .short-url { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.short-url-host { color: var(--sh-muted); font-weight: 450; }
.short-url-slug { color: var(--sh-shorturl-color); font-weight: 620; }
.short-link-copy { display: inline-grid; place-items: center; flex-shrink: 0; width: 1.75rem; height: 1.75rem; padding: 0; border: 0;
  border-radius: 7px; background: transparent; color: var(--sh-muted); font-size: 0.875rem; text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, scale 0.15s var(--sh-ease-out); }
.short-link-copy:hover { background: var(--sh-petrol-subtle); color: var(--sh-petrol-text); }
.short-link-copy:active { scale: 0.9; }
.short-link-copy:focus-visible { outline: 2px solid var(--sh-petrol); outline-offset: 1px; }
.short-link-copy.is-copied { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); }
.short-link-lg { font-size: 1.1875rem; }
.slug-input { font-weight: 560; font-variant-numeric: tabular-nums; }
.short-link-lg .short-link-copy { width: 2rem; height: 2rem; font-size: 0.9375rem; }

/* ---------- shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
  width: var(--sh-sidebar-width);
  flex-shrink: 0;
  background: var(--sh-canvas);
  border-inline-end: 1px solid color-mix(in srgb, var(--sh-line) 70%, transparent);
}
@media (min-width: 768px) {
  .app-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; }
}
@media (max-width: 767.98px) {
  .app-sidebar.offcanvas-md { --bs-offcanvas-bg: var(--sh-canvas); --bs-offcanvas-width: 288px; }
}
.app-sidebar .offcanvas-body { display: flex; flex-direction: column; padding: 1.125rem 0.875rem; }
.app-brand { display: flex; align-items: center; gap: 0.625rem; font-weight: 650; font-size: 1.0625rem; font-stretch: 88%;
  letter-spacing: -0.01em; padding: 0.125rem 0.5rem 1.25rem; color: var(--sh-ink); text-decoration: none; }
.app-brand:hover { color: var(--sh-ink); }
.app-brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: var(--sh-petrol); color: var(--sh-on-petrol); font-size: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 1px 2px rgba(11, 60, 57, 0.25); }

/* Section headers are toggles (sidebar.html groupToggle); sentence case reads faster than tracked capitals. */
.nav-section { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: 0;
  border-radius: 7px; text-align: start; font-size: 0.8125rem; font-weight: 600; color: var(--sh-muted);
  padding: 1.125rem 0.75rem 0.375rem; transition: color 0.15s ease; }
.nav-section:hover { color: var(--sh-ink); }
.nav-section:focus-visible { outline: 2px solid var(--sh-petrol); outline-offset: -2px; }
.nav-section-chevron { font-size: 0.6875rem; opacity: 0.7; transition: transform 0.24s var(--sh-ease-out); }

/* Collapsible groups: the row animates between 1fr and 0fr; hidden links leave the tab order (visibility) only after
   the animation. The state comes from <html data-nav-collapsed> before first paint, so nothing animates on load or
   after a boosted swap — one line per group in each selector list. */
.nav-group { display: grid; grid-template-rows: auto 1fr; transition: grid-template-rows 0.24s var(--sh-ease-out); }
.nav-group > nav { min-height: 0; overflow: hidden; transition: visibility 0s linear 0s; }
:root[data-nav-collapsed~="links"] [data-nav-group="links"],
:root[data-nav-collapsed~="insights"] [data-nav-group="insights"],
:root[data-nav-collapsed~="developers"] [data-nav-group="developers"],
:root[data-nav-collapsed~="account"] [data-nav-group="account"],
:root[data-nav-collapsed~="platform"] [data-nav-group="platform"] { grid-template-rows: auto 0fr; }
:root[data-nav-collapsed~="links"] [data-nav-group="links"] > nav,
:root[data-nav-collapsed~="insights"] [data-nav-group="insights"] > nav,
:root[data-nav-collapsed~="developers"] [data-nav-group="developers"] > nav,
:root[data-nav-collapsed~="account"] [data-nav-group="account"] > nav,
:root[data-nav-collapsed~="platform"] [data-nav-group="platform"] > nav { visibility: hidden; transition: visibility 0s linear 0.24s; }
:root[data-nav-collapsed~="links"] [data-nav-group="links"] .nav-section-chevron,
:root[data-nav-collapsed~="insights"] [data-nav-group="insights"] .nav-section-chevron,
:root[data-nav-collapsed~="developers"] [data-nav-group="developers"] .nav-section-chevron,
:root[data-nav-collapsed~="account"] [data-nav-group="account"] .nav-section-chevron,
:root[data-nav-collapsed~="platform"] [data-nav-group="platform"] .nav-section-chevron { transform: rotate(-90deg); }

.app-sidebar .nav { gap: 2px !important; }
.app-sidebar .nav-link { position: relative; display: flex; align-items: center; gap: 0.6875rem; color: var(--sh-ink-soft);
  border-radius: var(--sh-radius-control); padding: 0.4375rem 0.75rem; font-weight: 500; font-size: 0.90625rem;
  transition: background-color 0.15s ease, color 0.15s ease; }
.app-sidebar .nav-link:hover { background: color-mix(in srgb, var(--sh-surface) 70%, transparent); color: var(--sh-ink); }
.app-sidebar .nav-link:focus-visible { box-shadow: inset 0 0 0 2px var(--sh-petrol); outline: 0; }
.app-sidebar .nav-link .bi { font-size: 1rem; opacity: 0.8; }
.app-sidebar .nav-link.active { background: var(--sh-surface); color: var(--sh-petrol-text); font-weight: 600;
  box-shadow: 0 1px 2px rgba(16, 42, 39, 0.06), 0 0 0 1px var(--sh-line); }
.app-sidebar .nav-link.active .bi { opacity: 1; color: var(--sh-petrol); }
.app-sidebar .nav-link.active::before { content: ""; position: absolute; inset-inline-start: -0.875rem; top: 22%; bottom: 22%;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--sh-petrol); }
.app-sidebar-footer { margin-top: auto; padding: 1rem 0.75rem 0.25rem; font-size: 0.75rem; color: var(--sh-muted); }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-navbar {
  height: var(--sh-navbar-height);
  background-color: color-mix(in srgb, var(--sh-canvas) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid color-mix(in srgb, var(--sh-line) 70%, transparent);
  z-index: 1020;
}
.app-content { max-width: 1440px; width: 100%; margin-inline: auto; padding: 1.75rem 2rem 3rem; }
@media (max-width: 991.98px) { .app-content { padding: 1.5rem 1.25rem 2.5rem; } }
@media (max-width: 767.98px) { .app-content { padding: 1.25rem 1rem 2rem; } }

.acting-banner { background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis);
  border-bottom: 1px solid var(--bs-warning-border-subtle); font-size: 0.8125rem; }

/* ---------- account switcher ---------- */
.account-avatar { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; font-size: 0.6875rem;
  font-weight: 700; color: var(--sh-on-petrol); background: var(--sh-petrol); flex-shrink: 0; }
.account-switcher .dropdown-menu { width: 300px; max-height: 420px; overflow-y: auto; }
.account-switcher .btn { max-width: 260px; }
/* Phones: the navbar's six controls must fit 360px without a horizontal scroll (!important beats gap-2 / px-3). */
@media (max-width: 575.98px) {
  .app-navbar, .app-navbar > .ms-auto { gap: 0.375rem !important; }
  .app-navbar { padding-inline: 0.75rem !important; }
  .account-switcher .btn { max-width: 132px; }
  .app-navbar .dropdown-toggle::after { display: none; }
}

/* ---------- cards ---------- */
.card {
  --bs-card-bg: var(--sh-surface);
  --bs-card-border-color: var(--sh-line);
  --bs-card-border-radius: var(--sh-radius-surface);
  --bs-card-inner-border-radius: calc(var(--sh-radius-surface) - 1px);
  --bs-card-cap-bg: transparent;
  --bs-card-cap-padding-y: 0.875rem;
  box-shadow: 0 1px 2px rgba(16, 42, 39, 0.04);
}
[data-bs-theme="dark"] .card { box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.04); }
.kpi-value { font-size: 2.25rem; font-weight: 600; font-stretch: 80%; letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums; line-height: 1.1; margin-block: 0.25rem; }
/* KPI card (dashboard): icon + label, the figure, and a footer (link or change against the previous period). */
.kpi-card { padding: 1.125rem 1.25rem; }
.kpi-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.84375rem; font-weight: 550; color: var(--sh-muted); }
.kpi-label .bi { display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 8px;
  background: var(--sh-petrol-subtle); color: var(--sh-petrol-text); font-size: 0.9375rem; }
.kpi-card .kpi-value { margin-block: 0.625rem 0.25rem; }
.kpi-domain { font-size: 1.125rem; font-weight: 600; font-stretch: 92%; margin-block: 0.625rem 0.375rem; }
.kpi-date { font-size: 1.0625rem; font-weight: 600; font-stretch: 94%; font-variant-numeric: tabular-nums; margin-block: 0.625rem 0.25rem; }
/* Label/value list on a card (link settings): label column, hairline between rows; stacks on phones. */
.facts > div { display: grid; grid-template-columns: minmax(10rem, 16rem) 1fr; gap: 0.25rem 1.5rem; padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--sh-line); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { font-weight: 500; color: var(--sh-muted); }
.facts dd { margin: 0; font-weight: 500; }
@media (max-width: 575.98px) { .facts > div { grid-template-columns: 1fr; } }
.kpi-foot { margin-top: auto; padding-top: 0.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; font-size: 0.8125rem; }
.kpi-delta { display: inline-flex; align-items: center; gap: 0.125rem; padding: 0.0625rem 0.5rem; border-radius: 999px;
  font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi-delta.is-up { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); }
.kpi-delta.is-down { background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); }

/* ---------- buttons ---------- */
.btn {
  --bs-btn-font-weight: 550;
  --bs-btn-font-size: 0.90625rem;
  --bs-btn-border-radius: var(--sh-radius-control);
  --bs-btn-padding-x: 0.875rem;
  --bs-btn-focus-box-shadow: 0 0 0 3px var(--bs-focus-ring-color);
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.2s ease, transform 0.1s ease,
    translate 0.2s var(--sh-ease-out);
}
.btn-sm { --bs-btn-font-size: 0.84375rem; --bs-btn-border-radius: 7px; --bs-btn-padding-x: 0.625rem; }
.btn:not(.btn-sm):not(.btn-lg) { min-height: 38px; }
.btn:active { transform: scale(0.98); }
.btn-primary {
  --bs-btn-color: var(--sh-on-petrol);
  --bs-btn-bg: var(--sh-petrol);
  --bs-btn-border-color: var(--sh-petrol);
  --bs-btn-hover-color: var(--sh-on-petrol);
  --bs-btn-hover-bg: var(--sh-petrol-hover);
  --bs-btn-hover-border-color: var(--sh-petrol-hover);
  --bs-btn-active-color: var(--sh-on-petrol);
  --bs-btn-active-bg: var(--sh-petrol-press);
  --bs-btn-active-border-color: var(--sh-petrol-press);
  --bs-btn-disabled-color: var(--sh-on-petrol);
  --bs-btn-disabled-bg: var(--sh-petrol);
  --bs-btn-disabled-border-color: var(--sh-petrol);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 1px 2px rgba(11, 60, 57, 0.22);
}
.btn-outline-primary {
  --bs-btn-color: var(--sh-petrol-text);
  --bs-btn-border-color: var(--sh-petrol-border);
  --bs-btn-hover-color: var(--sh-petrol-text);
  --bs-btn-hover-bg: var(--sh-petrol-subtle);
  --bs-btn-hover-border-color: var(--sh-petrol);
  --bs-btn-active-color: var(--sh-on-petrol);
  --bs-btn-active-bg: var(--sh-petrol);
  --bs-btn-active-border-color: var(--sh-petrol);
  --bs-btn-disabled-color: var(--sh-petrol-text);
  --bs-btn-disabled-border-color: var(--sh-petrol-border);
}
/* Secondary actions are quiet: surface fill, hairline border. */
.btn-outline-secondary {
  --bs-btn-color: var(--sh-ink);
  --bs-btn-bg: var(--sh-surface);
  --bs-btn-border-color: color-mix(in srgb, var(--sh-line-strong) 45%, var(--sh-line));
  --bs-btn-hover-color: var(--sh-ink);
  --bs-btn-hover-bg: var(--sh-raised);
  --bs-btn-hover-border-color: var(--sh-line-strong);
  --bs-btn-active-color: var(--sh-ink);
  --bs-btn-active-bg: var(--sh-line);
  --bs-btn-active-border-color: var(--sh-line-strong);
  --bs-btn-disabled-color: var(--sh-muted);
  --bs-btn-disabled-bg: var(--sh-surface);
  --bs-btn-disabled-border-color: var(--sh-line);
  box-shadow: 0 1px 1px rgba(16, 42, 39, 0.04);
}
.btn-outline-danger { --bs-btn-bg: var(--sh-surface); }
/* Dark: Bootstrap's red text reaches only 3.8:1 on the dark surface; the lighter emphasis red passes (6.8:1). */
[data-bs-theme="dark"] .btn-outline-danger { --bs-btn-color: var(--bs-danger-text-emphasis); --bs-btn-border-color: var(--bs-danger-border-subtle); }
.btn-link { --bs-btn-color: var(--sh-petrol); --bs-btn-hover-color: var(--sh-petrol-hover); text-decoration: none; }
.btn-link:hover { text-decoration: underline; }

/* ---------- inputs ---------- */
.form-control, .form-select { font-size: 0.90625rem; background-color: var(--sh-surface); border-color: var(--sh-line-strong);
  border-radius: var(--sh-radius-control); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.form-control:not(textarea):not(.form-control-sm), .form-select:not(.form-select-sm) { min-height: 38px; }
.form-control-sm, .form-select-sm { border-radius: 7px; }
.form-control::placeholder { color: var(--sh-muted); opacity: 0.85; }
.form-control:focus, .form-select:focus { background-color: var(--sh-surface); border-color: var(--sh-petrol);
  box-shadow: 0 0 0 3px var(--bs-focus-ring-color); }
.form-control:disabled, .form-select:disabled, .form-control[readonly] { background-color: var(--sh-raised); }
.form-label { font-size: 0.84375rem; font-weight: 550; color: var(--sh-ink-soft); margin-bottom: 0.375rem; }
.form-text { color: var(--sh-muted); font-size: 0.8125rem; }
.form-check-input { border-color: var(--sh-line-strong); }
.form-check-input:checked { background-color: var(--sh-petrol); border-color: var(--sh-petrol); }
.form-check-input:focus { border-color: var(--sh-petrol); box-shadow: 0 0 0 3px var(--bs-focus-ring-color); }
.form-check-input:indeterminate { background-color: var(--sh-petrol); border-color: var(--sh-petrol); }
.input-group-text { background: var(--sh-raised); border-color: var(--sh-line-strong); color: var(--sh-muted); }

/* Tom Select (tag inputs, filters) in the same skin as .form-control. */
.ts-wrapper .ts-control { background: var(--sh-surface); border-color: var(--sh-line-strong); border-radius: var(--sh-radius-control);
  min-height: 38px; padding: 0.3125rem 0.625rem; font-size: 0.90625rem; color: var(--sh-ink); }
.ts-wrapper.focus .ts-control { border-color: var(--sh-petrol); box-shadow: 0 0 0 3px var(--bs-focus-ring-color); }
/* A select upgraded by Tom Select keeps its form-select class on the wrapper, which then draws the border (the theme
   removes the inner control's border with !important): the control fills the remaining 36px, the wrapper gets the
   focus ring. */
.ts-wrapper.form-select, .ts-wrapper.form-control { padding: 0; min-height: 38px; border-color: var(--sh-line-strong); }
.ts-wrapper.form-select .ts-control, .ts-wrapper.form-control .ts-control { min-height: 36px; border-radius: calc(var(--sh-radius-control) - 1px); }
.ts-wrapper.form-select.focus, .ts-wrapper.form-control.focus { border-color: var(--sh-petrol); box-shadow: 0 0 0 3px var(--bs-focus-ring-color); }
.ts-wrapper.form-select.focus .ts-control, .ts-wrapper.form-control.focus .ts-control { box-shadow: none; }
.ts-wrapper.multi .ts-control > div { background: var(--sh-petrol-subtle); color: var(--sh-petrol-text);
  border: 1px solid var(--sh-petrol-border); border-radius: 999px; padding: 0 0.5rem; margin: 2px 4px 2px 0; }
.ts-wrapper.plugin-remove_button .item .remove { border-inline-start-color: var(--sh-petrol-border); }
.ts-dropdown { background: var(--sh-surface); border-color: var(--sh-line); border-radius: 12px; box-shadow: var(--sh-shadow-pop);
  margin-top: 6px; overflow: hidden; animation: sh-pop 0.16s var(--sh-ease-out); }
.ts-dropdown .option, .ts-dropdown .create { padding: 0.45rem 0.75rem; }
.ts-dropdown .active { background: var(--sh-petrol-subtle); color: var(--sh-petrol-text); }

/* ---------- tables ---------- */
.table-shell { border: 1px solid var(--sh-line); border-radius: var(--sh-radius-surface); background: var(--sh-surface);
  overflow: hidden; box-shadow: 0 1px 2px rgba(16, 42, 39, 0.04); }
.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--sh-ink);
  --bs-table-border-color: var(--sh-line);
  --bs-table-hover-bg: var(--sh-raised);
  --bs-table-hover-color: var(--sh-ink);
  --bs-table-striped-bg: var(--sh-raised);
  margin-bottom: 0;
  font-size: 0.90625rem;
  font-variant-numeric: tabular-nums;
}
.table > thead th { background: var(--sh-raised); color: var(--sh-muted); font-size: 0.8125rem; font-weight: 600;
  white-space: nowrap; border-bottom-width: 1px; }
.table td, .table th { padding: 0.75rem 1rem; vertical-align: middle; }
.table-sm td, .table-sm th { padding: 0.5rem 0.75rem; }
.table > tbody > tr > * { transition: background-color 0.12s ease; }
.table > tbody > tr:last-child > * { border-bottom: 0; }
/* Titles in rows: ink, underline on hover only (the row position already marks them as links). */
.table a:not(.btn):not(.dropdown-item) { color: var(--sh-ink); font-weight: 550; text-decoration: none; }
.table a:not(.btn):not(.dropdown-item):hover { color: var(--sh-petrol); text-decoration: underline; }
.link-cell { max-width: 22rem; }
.table .link-title { font-weight: 600; }
.table-shell-header { display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 1rem; border-bottom: 1px solid var(--sh-line); }
.table-cards-toolbar { padding: 0.625rem 1rem; border-bottom: 1px solid var(--sh-line); background: var(--sh-raised); }

/* Phones: a .table-cards table turns each row into a card (UI.md §4). Cells declare their role:
   data-cell="select" (checkbox, top left) · "primary" (title, top) · "aside" (figure, top right; data-label is shown
   under it) · "detail" (full-width lines below, in source order). Cells hidden with d-none stay hidden. */
@media (max-width: 767.98px) {
  .table-cards > thead { display: none; }
  .table-cards, .table-cards > tbody { display: block; }
  .table-cards > tbody > tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; row-gap: 0.375rem;
    padding: 0.875rem 1rem; border-bottom: 1px solid var(--sh-line); }
  .table-cards > tbody > tr:last-child { border-bottom: 0; }
  .table-cards > tbody > tr > td { display: block; grid-column: 2 / -1; min-width: 0; padding: 0; border: 0; }
  .table-cards > tbody > tr > td[data-cell="select"] { grid-column: 1; grid-row: 1; align-self: start; margin-inline-end: 0.75rem; padding-top: 0.125rem; }
  .table-cards > tbody > tr > td[data-cell="primary"] { grid-column: 2; grid-row: 1; max-width: none; }
  .table-cards > tbody > tr > td[data-cell="aside"] { grid-column: 3; grid-row: 1; align-self: start; margin-inline-start: 0.75rem; font-weight: 600; }
  .table-cards > tbody > tr > td[data-cell="aside"].small { font-weight: 500; }
  .table-cards > tbody > tr > td[data-cell="aside"][data-label]::after { content: attr(data-label); display: block; font-size: 0.75rem;
    font-weight: 500; color: var(--sh-muted); }
}

/* ---------- badges, alerts, lists ---------- */
.badge { font-weight: 550; font-size: 0.75rem; border-radius: 999px; padding: 0.3em 0.65em; letter-spacing: 0.005em; }
.alert { --bs-alert-border-radius: 12px; --bs-alert-padding-y: 0.875rem; font-size: 0.90625rem; }
.list-group { --bs-list-group-bg: var(--sh-surface); --bs-list-group-border-color: var(--sh-line);
  --bs-list-group-active-bg: var(--sh-petrol); --bs-list-group-active-border-color: var(--sh-petrol);
  --bs-list-group-action-hover-bg: var(--sh-raised); --bs-list-group-border-radius: 12px; }
.progress { --bs-progress-bg: var(--sh-raised); --bs-progress-border-radius: 999px; }
.progress-bar { --bs-progress-bar-bg: var(--sh-petrol); transition: width 0.6s var(--sh-ease-out); }
.nav-underline { --bs-nav-link-color: var(--sh-muted); --bs-nav-link-hover-color: var(--sh-ink);
  --bs-nav-underline-link-active-color: var(--sh-ink); --bs-nav-underline-border-width: 2px; }
.nav-underline .nav-link.active { border-bottom-color: var(--sh-petrol); font-weight: 600; }
.nav-underline .nav-link { transition: color 0.15s ease, border-color 0.2s ease; }
/* Tab rows never wrap: on narrow screens they scroll sideways. */
.nav-underline { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.nav-underline .nav-link { white-space: nowrap; }

/* ---------- menus, modals, toasts, offcanvas ---------- */
.dropdown-menu {
  --bs-dropdown-bg: var(--sh-surface);
  --bs-dropdown-border-color: var(--sh-line);
  --bs-dropdown-border-radius: 12px;
  --bs-dropdown-inner-border-radius: 11px;
  --bs-dropdown-padding-x: 0.375rem;
  --bs-dropdown-padding-y: 0.375rem;
  --bs-dropdown-item-padding-y: 0.4375rem;
  --bs-dropdown-item-border-radius: 7px;
  --bs-dropdown-font-size: 0.90625rem;
  --bs-dropdown-link-color: var(--sh-ink);
  --bs-dropdown-link-hover-color: var(--sh-ink);
  --bs-dropdown-link-hover-bg: var(--sh-raised);
  --bs-dropdown-link-active-color: var(--sh-petrol-text);
  --bs-dropdown-link-active-bg: var(--sh-petrol-subtle);
  --bs-dropdown-header-color: var(--sh-muted);
  --bs-dropdown-divider-bg: var(--sh-line);
  --bs-box-shadow-sm: var(--sh-shadow-pop);
  box-shadow: var(--sh-shadow-pop);
}
.dropdown-item { border-radius: var(--bs-dropdown-item-border-radius); transition: background-color 0.12s ease; }
.dropdown-item.active .bi, .dropdown-item:active .bi { color: var(--sh-petrol); }
.dropdown-menu.show { animation: sh-pop 0.16s var(--sh-ease-out); }

.modal { --bs-modal-bg: var(--sh-surface); --bs-modal-border-color: var(--sh-line); --bs-modal-border-radius: 16px;
  --bs-modal-inner-border-radius: 15px; --bs-modal-box-shadow: var(--sh-shadow-pop); --bs-modal-header-border-color: var(--sh-line);
  --bs-modal-footer-border-color: var(--sh-line); }
.modal-content { box-shadow: var(--sh-shadow-pop); }
.modal.fade .modal-dialog { transform: translateY(12px) scale(0.985); transition: transform 0.24s var(--sh-ease-out); }
.modal.show .modal-dialog { transform: none; }
.modal-backdrop { --bs-backdrop-bg: #0A1A18; --bs-backdrop-opacity: 0.42; }
.offcanvas { --bs-offcanvas-bg: var(--sh-surface); --bs-offcanvas-border-color: var(--sh-line); }

.toast { --bs-toast-border-radius: 12px; --bs-toast-font-size: 0.90625rem; box-shadow: var(--sh-shadow-pop); }
/* Toasts sit under the navbar so they never cover its buttons (overrides the top-0 utility). */
.app-shell ~ #toast-container { top: calc(var(--sh-navbar-height) + 0.25rem) !important; }
.toast.show { animation: sh-toast-in 0.28s var(--sh-ease-out); }

/* ---------- copy feedback ---------- */
[data-copy].is-copied { --bs-btn-color: var(--bs-success-text-emphasis); --bs-btn-bg: var(--bs-success-bg-subtle);
  --bs-btn-border-color: var(--bs-success-border-subtle); --bs-btn-hover-bg: var(--bs-success-bg-subtle); }
[data-copy].is-copied .bi { display: inline-block; animation: sh-stamp 0.42s var(--sh-ease-out); }
.short-url:has(+ [data-copy].is-copied) { animation: sh-flash 1.2s ease-out; }

/* ---------- motion: answers to actions (UI.md §5 Motion) ---------- */
.dropdown-toggle::after { transition: rotate 0.22s var(--sh-ease-out); }
.dropdown-toggle[aria-expanded="true"]::after { rotate: 180deg; }
.btn .bi-plus-lg { display: inline-block; transition: rotate 0.3s var(--sh-ease-out); }
.btn:hover .bi-plus-lg { rotate: 90deg; }
.btn-primary:hover { translate: 0 -1px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 8px 18px -8px color-mix(in srgb, var(--sh-petrol) 70%, transparent); }
.btn-primary:active { translate: 0 0; }
.app-sidebar .nav-link .bi { transition: translate 0.2s var(--sh-ease-out), opacity 0.15s ease; }
.app-sidebar .nav-link:hover .bi { translate: 2px 0; }
.form-label { transition: color 0.15s ease; }
:focus-within > .form-label { color: var(--sh-petrol-text); }
.ts-wrapper.multi .ts-control > .item { animation: sh-chip-in 0.22s var(--sh-ease-out); }
/* After a boosted navigation the active marker glides from the previously active item (app.js sets --sh-glide-from
   and .is-gliding); the new item's highlight fades in behind it. */
.app-sidebar .nav-link.active.is-gliding { animation: sh-active-in 0.34s ease backwards; }
.app-sidebar .nav-link.active.is-gliding::before { animation: sh-glide 0.46s var(--sh-ease-out) backwards; }
/* Auto-hiding toasts show their remaining time; hovering restarts it, as Bootstrap restarts the delay. */
.toast.has-timer { position: relative; overflow: hidden; }
.toast.has-timer::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: currentColor;
  opacity: 0.35; transform-origin: left center; animation: sh-countdown var(--sh-toast-delay, 4s) linear forwards; }
.toast.has-timer:hover::after { animation: none; }
/* Theme switch: app.js reveals the new theme in a circle from the theme button (View Transitions API). */
:root.sh-theme-switch::view-transition-old(root), :root.sh-theme-switch::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
:root.sh-theme-switch::view-transition-new(root) { z-index: 1; }

/* ---------- settings ---------- */
.setting-row { padding: 1rem 0; border-bottom: 1px solid var(--sh-line); }
.setting-row:last-child { border-bottom: 0; }
.setting-source { font-size: 0.75rem; color: var(--sh-muted); }

/* ---------- auth layout ---------- */
.auth-split { display: grid; min-height: 100vh; grid-template-columns: 1fr; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 4.5rem 1.5rem 2rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card > section > .card { box-shadow: var(--sh-shadow-pop); border-radius: 18px; }
.auth-tools { position: fixed; top: 1rem; inset-inline-end: 1rem; z-index: 10; }

/* Brand panel: petrol in both themes. The tagline is the type moment (narrow, large); the demo below is the one
   orchestrated animation of the panel — a long URL steps back, its short link drops in, the click line draws. */
.auth-hero { display: none; }
@media (min-width: 992px) {
  .auth-split { grid-template-columns: minmax(400px, 44%) 1fr; }
  .auth-hero { position: relative; display: flex; flex-direction: column; gap: 2.5rem; padding: 2.5rem 3rem 3rem; overflow: hidden;
    color: #fff; background:
      radial-gradient(120% 70% at 0% 0%, rgba(38, 170, 160, 0.45) 0%, transparent 60%),
      radial-gradient(90% 60% at 100% 100%, rgba(3, 30, 28, 0.55) 0%, transparent 70%),
      linear-gradient(160deg, #0B6E69 0%, #075450 55%, #053936 100%); }
  .auth-shell { padding-top: 2rem; }
}
.auth-hero-brand, .auth-hero-brand:hover { color: #fff; padding: 0; }
.auth-hero-brand .app-brand-mark { background: #fff; color: #0B6E69; box-shadow: none; }
.auth-hero-body { margin-block: auto; display: grid; gap: 2rem; }
.auth-hero-tagline { margin: 0; max-width: 17ch; font-size: clamp(2rem, 2.6vw, 2.75rem); font-weight: 600; font-stretch: 82%;
  letter-spacing: -0.025em; line-height: 1.08; animation: sh-rise 0.7s var(--sh-ease-out) backwards; }

.link-demo { max-width: 30rem; padding: 1.25rem 1.5rem 1rem; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 18px;
  background: rgba(255, 255, 255, 0.07); backdrop-filter: blur(6px); box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.45);
  animation: sh-rise 0.7s var(--sh-ease-out) 0.15s backwards; }
.link-demo-long { font-size: 0.8125rem; line-height: 1.5; color: rgba(255, 255, 255, 0.85); overflow-wrap: anywhere;
  animation: demo-step-back 0.6s var(--sh-ease-out) 0.9s both; }
.link-demo-short { display: flex; align-items: center; gap: 0.125rem; margin-top: 0.875rem; font-size: 1.5rem; font-weight: 600;
  font-stretch: 92%; letter-spacing: -0.01em; animation: demo-drop-in 0.6s var(--sh-ease-out) 1.15s backwards; }
.link-demo-host { color: rgba(255, 255, 255, 0.72); font-weight: 450; }
.link-demo-slug { color: #fff; }
.link-demo-copy { margin-inline-start: auto; display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px;
  background: rgba(255, 255, 255, 0.14); font-size: 0.875rem; font-weight: 400; }
.link-demo-chart { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 1rem; margin-top: 1rem; padding-top: 0.875rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14); }
.link-demo-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.link-demo-line { stroke-dasharray: 100; stroke-dashoffset: 0; animation: demo-draw 1.1s var(--sh-ease-out) 1.6s backwards; }
.link-demo-area { animation: sh-fade 0.8s ease 2.2s backwards; }
.link-demo-count { display: grid; text-align: end; font-size: 1.5rem; font-weight: 600; font-stretch: 85%; line-height: 1.1;
  font-variant-numeric: tabular-nums; animation: sh-rise 0.5s var(--sh-ease-out) 2.3s backwards; }
.link-demo-count small { font-size: 0.75rem; font-weight: 500; font-stretch: 100%; color: rgba(255, 255, 255, 0.7); }

/* Error pages: the status code is the visual. Status pages (errors, suspended, no access) show no brand panel. */
.error-card { padding: 2rem 1.75rem; }
.auth-split:has(.error-card) { grid-template-columns: 1fr; }
.auth-split:has(.error-card) .auth-hero { display: none; }
.auth-split:has(.error-card) .auth-card > .d-lg-none { display: block !important; }
.error-code { margin-bottom: 0.75rem; font-size: 5.5rem; font-weight: 700; font-stretch: 75%; letter-spacing: -0.04em; line-height: 0.9;
  font-variant-numeric: tabular-nums; color: var(--sh-petrol);
  background: linear-gradient(180deg, var(--sh-petrol) 30%, color-mix(in srgb, var(--sh-petrol) 45%, var(--sh-surface)));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: demo-drop-in 0.6s var(--sh-ease-out) 0.1s backwards; }

/* Admin system status: overall health as a soft pill with a dot (pings while not green). */
.health-pill { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.375rem 0.875rem; border-radius: 999px; font-weight: 600;
  font-size: 0.875rem; border: 1px solid; }
.health-dot { position: relative; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; }
.health-pill.is-green { color: var(--bs-success-text-emphasis); background: var(--bs-success-bg-subtle); border-color: var(--bs-success-border-subtle); }
.health-pill.is-amber { color: var(--bs-warning-text-emphasis); background: var(--bs-warning-bg-subtle); border-color: var(--bs-warning-border-subtle); }
.health-pill.is-red { color: var(--bs-danger-text-emphasis); background: var(--bs-danger-bg-subtle); border-color: var(--bs-danger-border-subtle); }
.health-pill:not(.is-green) .health-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: currentColor;
  animation: sh-ping 1.8s ease-out infinite; }

.list-group-item-warning { --bs-list-group-bg: color-mix(in srgb, var(--bs-warning-bg-subtle) 55%, var(--sh-surface));
  --bs-list-group-color: var(--sh-ink); box-shadow: inset 3px 0 0 var(--bs-warning); }

/* Skip link: off screen until focused with the keyboard. */
.skip-link { position: fixed; top: -4rem; inset-inline-start: 1rem; z-index: 3000; padding: 0.5rem 0.875rem; border-radius: var(--sh-radius-control);
  background: var(--sh-surface); color: var(--sh-petrol-text); font-weight: 600; box-shadow: var(--sh-shadow-pop); text-decoration: none;
  transition: top 0.15s var(--sh-ease-out); }
.skip-link:focus { top: 0.75rem; outline: 2px solid var(--sh-petrol); outline-offset: 2px; }
.otp-input { font-family: var(--bs-font-monospace); font-size: 1.5rem; letter-spacing: 0.5em; text-align: center; }

/* ---------- misc ---------- */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--sh-muted); }
.empty-state .bi { display: inline-grid; place-items: center; width: 3rem; height: 3rem; margin-bottom: 0.875rem; border-radius: 50%;
  background: var(--sh-raised); border: 1px solid var(--sh-line); color: var(--sh-muted); font-size: 1.35rem; }
.qr-box { display: inline-block; padding: 0.5rem; background: #fff; border-radius: 10px; border: 1px solid var(--sh-line); }
.recovery-codes { columns: 2; font-family: var(--bs-font-monospace); font-size: 0.9375rem; }
/* Inline code (tokens, audit actions, API snippets) in a quiet pill; code in a <pre> stays plain. */
:not(pre) > code { padding: 0.0625em 0.375em; border: 1px solid var(--sh-line); border-radius: 5px; background: var(--sh-raised); font-size: 0.85em; }
.code-block { background: var(--sh-raised); border: 1px solid var(--sh-line); border-radius: 10px; padding: 0.75rem 1rem;
  font-family: var(--bs-font-monospace); font-size: 0.8125rem; word-break: break-all; }
.audit-details { font-family: var(--bs-font-monospace); font-size: 0.75rem; max-width: 360px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }

/* ---------- htmx: indicators, page entry, progress bar (UI.md §8) ---------- */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline-block; }
.htmx-settling { opacity: 0; transform: translateY(4px); }
.htmx-swapping { opacity: 0; transition: opacity 120ms ease-out; }
/* Page entry (full loads and boosted navigations): the page's blocks cascade in, header first, each block 60 ms after
   the previous one; the first twelve table rows follow one by one. Partial swaps that bring new rows replay it. */
#main-content { transition: opacity 180ms var(--sh-ease-out), transform 180ms var(--sh-ease-out); }
#main-content > section > *, #main-content.auth-shell .auth-card { animation: sh-rise 0.5s var(--sh-ease-out) backwards; }
#main-content > section > :nth-child(2) { animation-delay: 60ms; }
#main-content > section > :nth-child(3) { animation-delay: 120ms; }
#main-content > section > :nth-child(4) { animation-delay: 180ms; }
#main-content > section > :nth-child(5) { animation-delay: 240ms; }
#main-content > section > :nth-child(n+6) { animation-delay: 300ms; }
.table > tbody > tr { --sh-i: 12; animation: sh-row-in 0.42s var(--sh-ease-out) backwards; animation-delay: calc(160ms + var(--sh-i) * 30ms); }
.table > tbody > tr:nth-child(1) { --sh-i: 0; }
.table > tbody > tr:nth-child(2) { --sh-i: 1; }
.table > tbody > tr:nth-child(3) { --sh-i: 2; }
.table > tbody > tr:nth-child(4) { --sh-i: 3; }
.table > tbody > tr:nth-child(5) { --sh-i: 4; }
.table > tbody > tr:nth-child(6) { --sh-i: 5; }
.table > tbody > tr:nth-child(7) { --sh-i: 6; }
.table > tbody > tr:nth-child(8) { --sh-i: 7; }
.table > tbody > tr:nth-child(9) { --sh-i: 8; }
.table > tbody > tr:nth-child(10) { --sh-i: 9; }
.table > tbody > tr:nth-child(11) { --sh-i: 10; }
.table > tbody > tr:nth-child(12) { --sh-i: 11; }
/* Polled regions (hx-trigger="every …": live feed, bulk progress) swap themselves every few seconds; they must not
   replay the entry animation on each poll. */
#main-content [hx-trigger^="every"], [hx-trigger^="every"] .table > tbody > tr { animation: none; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 140ms; }
#htmx-progress { position: fixed; top: 0; inset-inline-start: 0; height: 2px; width: 0; background: var(--sh-petrol); z-index: 2000;
  opacity: 0; box-shadow: 0 0 8px var(--sh-petrol); transition: width 300ms ease, opacity 200ms ease; }
#htmx-progress.active { opacity: 1; width: 70%; transition: width 4s cubic-bezier(0.1, 0.7, 0.2, 1), opacity 100ms; }
#htmx-progress.done { opacity: 0; width: 100%; }

/* Running job icon (UI.md §2). */
.bi.spin { display: inline-block; animation: spin 1.2s linear infinite; }

/* Bulk upload stepper and drop zone (UI.md §7.3). */
.stepper { display: flex; gap: 0.5rem; list-style: none; padding: 0; margin: 0 0 1.5rem; flex-wrap: wrap; }
.stepper li { display: flex; align-items: center; gap: 0.5rem; color: var(--sh-muted); font-size: 0.875rem; }
.stepper li + li::before { content: ""; width: 1.5rem; height: 1px; background: var(--sh-line); }
.stepper .step-num { width: 1.5rem; height: 1.5rem; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; border: 1px solid var(--sh-line); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.stepper li.active { color: var(--sh-ink); font-weight: 600; }
.stepper li.active .step-num { background: var(--sh-petrol); border-color: var(--sh-petrol); color: var(--sh-on-petrol); }
.stepper li.done .step-num { background: var(--bs-success-bg-subtle); border-color: var(--bs-success-border-subtle);
  color: var(--bs-success-text-emphasis); }
.drop-zone { border: 2px dashed var(--sh-line); border-radius: var(--sh-radius-surface); padding: 2rem 1rem; text-align: center;
  transition: border-color 0.15s, background-color 0.15s; }
.drop-zone.dragover { border-color: var(--sh-petrol); background: var(--sh-petrol-subtle); }

/* Analytics (Phase 4) */
.chart { width: 100%; }
.chart-timeline { height: 280px; }
.chart-small { height: 240px; }
/* Empty chart: a short explanation over the flat grid (analytics/fragments :: timeline). */
.chart-empty { position: absolute; inset: 0 0 28px 36px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.625rem; padding: 1rem; text-align: center; color: var(--sh-muted); font-size: 0.875rem; pointer-events: none;
  animation: sh-rise 0.5s var(--sh-ease-out) 0.35s backwards; }
.chart-empty .bi { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  background: var(--sh-petrol-subtle); color: var(--sh-petrol-text); font-size: 1.2rem; }
.chart-empty p { max-width: 32ch; background: color-mix(in srgb, var(--sh-surface) 80%, transparent); border-radius: 8px; padding: 0.125rem 0.375rem; }
/* The bulk action bar slides up when the first row is selected. */
.bulk-bar { box-shadow: var(--sh-shadow-pop) !important; z-index: 5; }
.bulk-bar:not(.d-none) { animation: sh-rise 0.28s var(--sh-ease-out); }
.live-bars { height: 72px; }
.live-bar { flex: 1 1 0; min-width: 2px; background: var(--sh-petrol); border-radius: 2px 2px 0 0; opacity: 0.85; }

/* ---------- data screens (UI Phase 3) ---------- */
.kpi-delta.is-neutral { background: var(--sh-raised); color: var(--sh-muted); }

/* Breakdown bar list (analytics/fragments :: breakdown): label · clicks · share, the share bar grows in once. */
.bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.bar-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto 3.75rem; column-gap: 0.75rem; row-gap: 0.3125rem;
  align-items: baseline; font-size: 0.875rem; }
.bar-list-label { font-weight: 500; }
.bar-list-value { font-weight: 600; font-variant-numeric: tabular-nums; text-align: end; }
.bar-list-share { color: var(--sh-muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; text-align: end; }
.bar-list-bar { grid-column: 1 / -1; position: relative; height: 6px; border-radius: 999px; background: var(--sh-raised); overflow: hidden; }
.bar-list-bar::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--sh-share, 0%); border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--sh-petrol) 55%, var(--sh-surface)), var(--sh-petrol));
  transform-origin: left center; animation: sh-grow 0.9s var(--sh-ease-out) backwards; animation-delay: calc(220ms + var(--sh-i, 0) * 45ms); }

/* Live view: a pulsing dot says "this updates by itself"; per-minute bars in petrol, the current minute strongest. */
.live-dot { position: relative; display: inline-block; width: 0.625rem; height: 0.625rem; margin-inline: 0.5625rem; border-radius: 50%;
  background: var(--bs-success); }
.live-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--bs-success); animation: sh-ping 1.8s ease-out infinite; }
.live-bars { gap: 3px !important; }
.live-bar { background: color-mix(in srgb, var(--sh-petrol) 45%, var(--sh-surface)); border-radius: 3px 3px 1px 1px; opacity: 1;
  transition: background-color 0.15s ease; }
.live-bar:last-child { background: var(--sh-petrol); }
.live-bar:hover { background: var(--sh-petrol-hover); }

/* Steppers (bulk, domain): done steps join with a petrol line; the current step carries a soft ring. */
.stepper li + li::before { transition: background-color 0.3s ease; }
.stepper li.done + li::before, .stepper li.done + li.active::before { background: var(--sh-petrol); }
.stepper .step-num { width: 1.75rem; height: 1.75rem; font-weight: 600; transition: background-color 0.3s ease, border-color 0.3s ease; }
.stepper li.active .step-num { box-shadow: 0 0 0 4px var(--sh-petrol-subtle); }
.stepper li.done .step-num { background: var(--sh-petrol); border-color: var(--sh-petrol); color: var(--sh-on-petrol); }

/* Drop zone: an icon tile; answers dragging and confirms a chosen file. */
.drop-zone { cursor: pointer; padding: 2.25rem 1rem; transition: border-color 0.15s, background-color 0.15s, scale 0.2s var(--sh-ease-out); }
.drop-zone:hover { border-color: var(--sh-line-strong); background: var(--sh-raised); }
.drop-zone.dragover { scale: 1.01; }
.drop-zone-icon { display: inline-grid; place-items: center; width: 3.25rem; height: 3.25rem; margin-bottom: 0.75rem; border-radius: 14px;
  background: var(--sh-petrol-subtle); color: var(--sh-petrol-text); font-size: 1.5rem; transition: translate 0.25s var(--sh-ease-out); }
.drop-zone:hover .drop-zone-icon, .drop-zone.dragover .drop-zone-icon { translate: 0 -3px; }
.drop-zone.has-file { border-style: solid; border-color: var(--sh-petrol-border); background: var(--sh-petrol-subtle); }
.drop-zone.has-file .drop-zone-icon { background: var(--sh-petrol); color: var(--sh-on-petrol); animation: sh-stamp 0.42s var(--sh-ease-out); }
.drop-zone.has-file [data-file-name] { color: var(--sh-petrol-text) !important; font-weight: 600; }
.drop-zone:focus-within { outline: 2px solid var(--sh-petrol); outline-offset: 2px; }

/* Bulk results and review summary. */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 0.75rem; }
.stat-tile { display: flex; flex-direction: column; gap: 0.125rem; padding: 0.75rem 1rem; border: 1px solid var(--sh-line); border-radius: 12px;
  background: var(--sh-raised); }
.stat-label { font-size: 0.8125rem; color: var(--sh-muted); }
.stat-value { font-size: 1.5rem; font-weight: 600; font-stretch: 85%; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-tile.is-success { background: var(--bs-success-bg-subtle); border-color: var(--bs-success-border-subtle); }
.stat-tile.is-success .stat-value { color: var(--bs-success-text-emphasis); }
.stat-tile.is-danger { background: var(--bs-danger-bg-subtle); border-color: var(--bs-danger-border-subtle); }
.stat-tile.is-danger .stat-value { color: var(--bs-danger-text-emphasis); }
.review-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.review-chip { display: inline-flex; align-items: center; gap: 0.4375rem; padding: 0.375rem 0.75rem; border-radius: 999px; font-weight: 550;
  font-size: 0.875rem; border: 1px solid var(--sh-line); background: var(--sh-surface); color: var(--sh-ink);
  animation: sh-chip-in 0.3s var(--sh-ease-out) backwards; }
.review-chip:nth-child(2) { animation-delay: 60ms; } .review-chip:nth-child(3) { animation-delay: 120ms; } .review-chip:nth-child(4) { animation-delay: 180ms; }
.review-chip.is-success { background: var(--bs-success-bg-subtle); border-color: var(--bs-success-border-subtle); color: var(--bs-success-text-emphasis); }
.review-chip.is-warning { background: var(--bs-warning-bg-subtle); border-color: var(--bs-warning-border-subtle); color: var(--bs-warning-text-emphasis); }
.review-chip.is-danger { background: var(--bs-danger-bg-subtle); border-color: var(--bs-danger-border-subtle); color: var(--bs-danger-text-emphasis); }
/* Row states keep their colour when a table becomes cards (cells no longer fill the row). */
@media (max-width: 767.98px) {
  .table-cards > tbody > tr.table-danger { background: var(--bs-danger-bg-subtle); }
  .table-cards > tbody > tr.table-warning { background: var(--bs-warning-bg-subtle); }
}

/* Domain page. */
.domain-host { font-size: 1.375rem; font-weight: 650; font-stretch: 90%; letter-spacing: -0.01em; }
.dns-value { display: inline-flex; align-items: center; gap: 0.25rem; max-width: 100%; }
.dns-value > span { min-width: 0; overflow-wrap: anywhere; }
.cert-panel { display: flex; gap: 0.875rem; align-items: flex-start; padding: 1rem; border: 1px solid var(--bs-success-border-subtle);
  border-radius: 12px; background: color-mix(in srgb, var(--bs-success-bg-subtle) 55%, var(--sh-surface)); }
.cert-panel-icon { display: inline-grid; place-items: center; flex-shrink: 0; width: 2.25rem; height: 2.25rem; border-radius: 10px;
  background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); font-size: 1.1rem; }

/* Code sample with a copy button (API docs). */
.code-sample { position: relative; border: 1px solid var(--sh-line); border-radius: 12px; background: var(--sh-raised); }
.code-sample pre { padding: 0.875rem 3rem 0.875rem 1rem; font-size: 0.8125rem; white-space: pre-wrap; word-break: break-word; }
.code-sample-copy { position: absolute; top: 0.5rem; inset-inline-end: 0.5rem; background: var(--sh-surface); border: 1px solid var(--sh-line); }

/* ---------- keyframes ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sh-rise { from { opacity: 0; translate: 0 12px; } }
@keyframes sh-row-in { from { opacity: 0; translate: 0 8px; } }
@keyframes sh-chip-in { from { opacity: 0; scale: 0.7; } }
@keyframes sh-flash { 0%, 25% { background: var(--sh-petrol-subtle); box-shadow: 0 0 0 4px var(--sh-petrol-subtle); }
  100% { background: transparent; box-shadow: 0 0 0 4px transparent; } }
@keyframes sh-glide { from { translate: 0 var(--sh-glide-from, 0px); } }
@keyframes sh-active-in { from { background-color: transparent; box-shadow: none; } }
@keyframes sh-countdown { to { transform: scaleX(0); } }
@keyframes sh-grow { from { transform: scaleX(0); } }
@keyframes sh-fade { from { opacity: 0; } }
@keyframes demo-step-back { to { opacity: 0.55; letter-spacing: -0.02em; } }
@keyframes demo-drop-in { from { opacity: 0; translate: 0 -10px; scale: 0.94; } 60% { opacity: 1; scale: 1.02; } }
@keyframes demo-draw { from { stroke-dashoffset: 100; } }
@keyframes sh-ping { 0% { scale: 1; opacity: 0.6; } 80%, 100% { scale: 2.6; opacity: 0; } }
/* translate/scale (not transform) so Popper's positioning transform on menus is left alone. */
@keyframes sh-pop { from { opacity: 0; translate: 0 -4px; scale: 0.98; } }
@keyframes sh-toast-in { from { opacity: 0; translate: 16px 0; } }
@keyframes sh-stamp { 0% { scale: 0.4; rotate: -14deg; opacity: 0; } 60% { scale: 1.18; rotate: 4deg; opacity: 1; } 100% { scale: 1; rotate: 0deg; } }

/* Keep last: reduced motion switches off every animation and transition above. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}
