/* ==========================================================================
   Totema.de-Ink&Paper — core components (v1.0.0)
   The unified design system powering every totema.de SaaS application.
   Warm copper accent + deep midnight ink on tactile paper surfaces.
   Inter primary typography. Framework-free, semantic-token-driven.
   Consume tokens only. Author: Slaveyko Kirilov Nikolov.
   ========================================================================== */

/* ── Box model ───────────────────────────────────────────────────────────
   There is deliberately NO global reset: the system never rewrites the host
   page's box model. Components are border-box instead, scoped to the `ip-`
   namespace so nothing outside it is touched. Without this, `width: 100%` plus
   a component's own padding spills past its container — it made `.ip-modal` run
   34px past a 375px viewport and `.ip-input` 6–8px past its field.
   ────────────────────────────────────────────────────────────────────────── */
[class^='ip-'],
[class*=' ip-'] {
  box-sizing: border-box;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.ip-btn {
  --btn-bg: var(--solid-primary-bg);
  --btn-fg: var(--solid-primary-text);
  --btn-border: transparent;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-primary, var(--font-sans));
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--duration-1) var(--ease-paper),
              border-color var(--duration-1) var(--ease-paper),
              color var(--duration-1) var(--ease-paper);
}
/* Hover sets the VARIABLE, never `background` directly: a direct property would
   beat the variant rules below, which is what used to make outline and ghost
   buttons paint their text and background the same colour on hover.
   `:not(:disabled)` keeps the disabled rule from being overridden by hover. */
.ip-btn:hover:not(:disabled) { --btn-bg: var(--solid-primary-bg-hover, #75502D); }
.ip-btn:active { filter: brightness(0.95); box-shadow: inset 0 1px 2px rgba(18,29,44,0.2); }
.ip-btn:disabled { --btn-bg: var(--surface-inset); --btn-fg: var(--text-disabled); cursor: not-allowed; }

/* accent text, not the CTA fill: in dark mode --solid-primary-bg (copper-500) only
   reaches 4.36:1 on the inset surface, so the label needs the theme-aware accent */
.ip-btn--outline { --btn-bg: transparent; --btn-fg: var(--text-link); --btn-border: var(--text-link); }
/* tint with a theme-aware surface: --brand-50 is a light-only primitive and
   would put a cream patch on the dark theme */
.ip-btn--outline:hover:not(:disabled) { --btn-bg: var(--surface-inset); --btn-fg: var(--solid-primary-bg-hover); }
.ip-btn--ghost   { --btn-bg: transparent; --btn-fg: var(--text-primary); }
.ip-btn--ghost:hover:not(:disabled) { --btn-bg: var(--surface-inset); --btn-fg: var(--text-primary); }
.ip-btn--sm { font-size: 0.85rem; padding: var(--space-1) var(--space-3); }
.ip-btn--lg { font-size: 1.05rem; padding: var(--space-3) var(--space-6); }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.ip-card {
  color: var(--text-primary);
  background: var(--surface-card);
  border: 1px solid var(--stroke-default);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-1);
  padding: var(--space-4);
}
.ip-card__title { font-family: var(--font-primary, var(--font-sans)); font-size: 1.15rem; font-weight: 600; color: var(--text-heading); margin: 0 0 var(--space-2); }
.ip-card__body  { color: var(--text-secondary); }

/* ── Form fields (underline style) ─────────────────────────────────────── */
.ip-field { display: flex; flex-direction: column; gap: var(--space-1); margin-bottom: var(--space-4); }
.ip-label { font-family: var(--font-primary, var(--font-sans)); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.ip-input, .ip-select, .ip-textarea {
  font-family: var(--font-primary, var(--font-sans));
  font-size: 1rem;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--stroke-strong);
  border-radius: 0;
  padding: var(--space-2) var(--space-1);
  width: 100%;
  transition: border-color var(--duration-1) var(--ease-paper);
}
.ip-input:focus, .ip-select:focus, .ip-textarea:focus {
  outline: none;
  border-bottom-color: var(--focus-ring);
}
.ip-input::placeholder, .ip-textarea::placeholder { color: var(--text-placeholder); }
.ip-input:disabled, .ip-select:disabled, .ip-textarea:disabled { color: var(--text-disabled); cursor: not-allowed; }
.ip-textarea { resize: vertical; min-height: 4.5rem; }
.ip-hint { font-size: 0.8rem; color: var(--text-muted); }

/* ── Navigation (topbar) ───────────────────────────────────────────────── */
.ip-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--stroke-default);
  background: var(--surface-page);
}
.ip-nav__brand { font-family: var(--font-primary, var(--font-sans)); font-weight: 600; font-size: 1.1rem; color: var(--text-heading); text-decoration: none; }
.ip-nav__links { display: flex; gap: var(--space-4); margin-left: auto; }
.ip-nav__link { font-family: var(--font-primary, var(--font-sans)); font-size: 0.95rem; color: var(--text-secondary); text-decoration: none; padding: var(--space-1) 0; border-bottom: 2px solid transparent; }
.ip-nav__link:hover { color: var(--text-heading); }
.ip-nav__link[aria-current="page"], .ip-nav__link.is-active { color: var(--text-heading); border-bottom-color: var(--focus-ring); font-weight: 500; }

/* ── Tabs (folder tabs) ────────────────────────────────────────────────── */
.ip-tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--stroke-default); }
.ip-tab {
  font-family: var(--font-primary, var(--font-sans)); font-size: 0.9rem;
  color: var(--text-secondary); text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border: 1px solid transparent; border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  margin-bottom: -1px;
}
.ip-tab:hover { color: var(--text-primary); }
.ip-tab.is-active { color: var(--text-heading); font-weight: 500; background: var(--surface-card); border-color: var(--stroke-default); }

/* ── Breadcrumbs ───────────────────────────────────────────────────────── */
.ip-breadcrumb { display: flex; flex-wrap: wrap; gap: var(--space-2); font-size: 0.85rem; color: var(--text-muted); }
.ip-breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.ip-breadcrumb a:hover { color: var(--text-link); text-decoration: underline; }
.ip-breadcrumb__sep { color: var(--text-muted); }

/* ── Alerts (status variants) ─────────────────────────────────────────── */
.ip-alert {
  --alert-fg: var(--text-secondary);
  --alert-border: var(--stroke-default);
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--alert-border);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--alert-fg);
  font-size: 0.95rem;
}
.ip-alert__title { font-weight: 600; color: var(--text-primary); }
.ip-alert--success { --alert-fg: var(--status-success); --alert-border: var(--status-success); }
.ip-alert--warning { --alert-fg: var(--status-warning); --alert-border: var(--status-warning); }
.ip-alert--error   { --alert-fg: var(--status-error);   --alert-border: var(--status-error); }

/* ── Badges ────────────────────────────────────────────────────────────── */
.ip-badge {
  display: inline-flex; align-items: center;
  font-family: var(--font-primary, var(--font-sans)); font-size: 0.8rem; font-weight: 500;
  padding: 2px var(--space-2);
  border: 1px solid var(--stroke-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: var(--surface-card);
}
.ip-badge--success { color: var(--status-success); border-color: var(--status-success); }
.ip-badge--warning { color: var(--status-warning); border-color: var(--status-warning); }
.ip-badge--error   { color: var(--status-error);   border-color: var(--status-error); }

/* ── Table ─────────────────────────────────────────────────────────────── */
.ip-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.ip-table th, .ip-table td { text-align: left; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--stroke-default); }
.ip-table td { font-variant-numeric: tabular-nums; }
.ip-table th { font-family: var(--font-primary, var(--font-sans)); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-heading); }
.ip-table tbody tr:hover { background: var(--surface-inset); }
.ip-table--compact th, .ip-table--compact td { padding: var(--space-1) var(--space-2); }
.ip-table-wrap { overflow-x: auto; }
.ip-table caption {
  padding-bottom: var(--space-2);
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.ip-table--sticky thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-card);
  box-shadow: inset 0 -1px 0 var(--stroke-default);
}
.ip-table__select {
  width: 1px;
  white-space: nowrap;
  padding-right: 0;
}
.ip-table th .ip-check input, .ip-table td .ip-check input { margin-top: 0; }
/* higher specificity than `.ip-table th, .ip-table td { text-align: left }` —
   a bare `.ip-table__right` loses to it (verified in the browser) */
.ip-table th.ip-table__right, .ip-table td.ip-table__right { text-align: right; }

/* ── Toggle ────────────────────────────────────────────────────────────── */
.ip-toggle { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; }
.ip-toggle input { position: absolute; opacity: 0; }
.ip-toggle__track {
  width: 40px; height: 22px; border-radius: 11px;
  background: var(--surface-inset);
  border: 1px solid var(--stroke-default);
  transition: background var(--duration-1) var(--ease-paper), border-color var(--duration-1) var(--ease-paper);
}
.ip-toggle__track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-secondary);
  transition: transform var(--duration-1) var(--ease-paper);
}
.ip-toggle input:checked + .ip-toggle__track { background: var(--solid-primary-bg); border-color: var(--solid-primary-bg); }
.ip-toggle input:checked + .ip-toggle__track::after { transform: translateX(18px); background: var(--solid-primary-text); }
.ip-toggle input:focus-visible + .ip-toggle__track { outline: var(--focus-width) solid var(--focus-ring); outline-offset: var(--focus-offset); }

/* ── Empty state ───────────────────────────────────────────────────────── */
.ip-empty { text-align: center; padding: var(--space-12) var(--space-6); color: var(--text-muted); }
.ip-empty__title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; color: var(--text-heading); margin-bottom: var(--space-2); letter-spacing: -0.01em; }

/* ==========================================================================
   Totema.de-Ink&Paper — extended components
   ========================================================================== */

/* ── Modal (sliding sheet) ─────────────────────────────────────────────── */
.ip-modal-overlay {
  position: fixed; inset: 0;
  background: var(--surface-overlay);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-6);
  z-index: 100;
}
.ip-modal {
  color: var(--text-primary);   /* a <dialog> otherwise keeps the UA's black text */
  background: var(--surface-card);
  border: 1px solid var(--stroke-default);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-3);
  max-width: 560px; width: 100%;
  max-height: 80vh; overflow: auto;
  padding: var(--space-6);
  animation: ip-slide-up var(--duration-2) var(--ease-paper);
}
.ip-modal__header { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); }
.ip-modal__title { font-family: var(--font-primary, var(--font-sans)); font-size: 1.25rem; font-weight: 600; color: var(--text-heading); margin: 0; }
.ip-modal__close { background: none; border: none; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--text-muted); padding: var(--space-1); }
.ip-modal__close:hover { color: var(--text-primary); }
.ip-modal__footer { display: flex; justify-content: flex-end; gap: var(--space-3); margin-top: var(--space-6); }
@keyframes ip-slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Pagination ────────────────────────────────────────────────────────── */
.ip-pagination { display: flex; gap: var(--space-1); align-items: center; }
.ip-page {
  min-width: 32px; height: 32px; padding: 0 var(--space-2);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-primary, var(--font-sans)); font-size: 0.9rem;
  color: var(--text-secondary); text-decoration: none;
  border: 1px solid var(--stroke-default); border-radius: var(--radius-sm);
  background: var(--surface-card);
}
/* scoped so the current page keeps its solid copper treatment on hover —
   `.is-current` and `:hover` have equal specificity and previously relied on
   source order alone. --text-link-hover is theme-aware; the old --brand-700
   primitive rendered at 2.85:1 on the dark theme. */
.ip-page:hover:not(.is-current) { border-color: var(--text-link-hover); color: var(--text-link-hover); }
.ip-page.is-current { background: var(--solid-primary-bg); color: var(--solid-primary-text); border-color: var(--solid-primary-bg); }
.ip-page:disabled { color: var(--text-disabled); cursor: not-allowed; }

/* ── Tooltip ───────────────────────────────────────────────────────────── */
.ip-tooltip {
  position: relative; display: inline-block;
}
.ip-tooltip__bubble {
  position: absolute; bottom: calc(100% + var(--space-2)); left: 50%;
  transform: translateX(-50%);
  background: var(--ink-700); color: var(--surface-paper);
  font-size: 0.8rem; white-space: nowrap;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2);
  opacity: 0; pointer-events: none;
  transition: opacity var(--duration-1) var(--ease-paper);
}
.ip-tooltip:hover .ip-tooltip__bubble, .ip-tooltip:focus-within .ip-tooltip__bubble { opacity: 1; }

/* ── Progress ──────────────────────────────────────────────────────────── */
.ip-progress {
  --progress: 0%;
  height: 6px; border-radius: 3px;
  background: var(--surface-inset);
  border: 1px solid var(--stroke-default);
  overflow: hidden;
}
.ip-progress__bar {
  height: 100%; width: var(--progress);
  background: var(--solid-primary-bg);
  border-radius: 3px;
  transition: width var(--duration-2) var(--ease-paper);
}
.ip-progress--success .ip-progress__bar { background: var(--status-success); }
.ip-progress--warning .ip-progress__bar { background: var(--status-warning); }
.ip-progress--error   .ip-progress__bar { background: var(--status-error); }

/* ── Skeleton ──────────────────────────────────────────────────────────── */
.ip-skeleton {
  display: block;
  background: linear-gradient(90deg, var(--surface-inset) 25%, var(--surface-card) 50%, var(--surface-inset) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: ip-skeleton-shimmer 1.4s var(--ease-paper) infinite;
}
@keyframes ip-skeleton-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
.ip-skeleton--text { height: 0.8em; margin-bottom: var(--space-2); }
.ip-skeleton--title { height: 1.2em; width: 60%; margin-bottom: var(--space-3); }
.ip-skeleton--card { height: 96px; }

/* ── Gauge (score bar) ────────────────────────────────────────────────── */
.ip-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}
.ip-gauge__score {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: lining-nums tabular-nums;
}
.ip-gauge__score::after {
  content: '%';
  font-size: 1.25rem;
  color: var(--text-secondary);
}
.ip-gauge__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.ip-gauge__bar {
  width: 100%;
  max-width: 280px;
  height: 8px;
  background: var(--surface-inset);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: var(--space-2);
}
.ip-gauge__fill {
  height: 100%;
  border-radius: var(--radius-sm);
  transition: width var(--duration-2) var(--ease-paper);
}
.ip-gauge__fill--pass { background: var(--status-success); }
.ip-gauge__fill--warn { background: var(--status-warning); }
.ip-gauge__fill--fail { background: var(--status-error); }

/* ==========================================================================
   Totema.de-Ink&Paper — Accessibility Utilities & Expanded Components
   ========================================================================== */

/* ── Screen Reader Only (WCAG 2.x) ─────────────────────────────────────── */
.ip-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ── Skip Link ─────────────────────────────────────────────────────────── */
.ip-skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 999;
}
.ip-skip-link:focus-visible {
  position: fixed;
  left: var(--space-4);
  top: var(--space-4);
  width: auto;
  height: auto;
  background: var(--solid-primary-bg);
  color: var(--solid-primary-text);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  text-decoration: none;
  font-weight: 500;
  box-shadow: var(--shadow-2);
}

/* ── Accordion / Disclosure ────────────────────────────────────────────── */
.ip-accordion {
  border: 1px solid var(--stroke-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  margin-bottom: var(--space-2);
  overflow: hidden;
  transition: border-color var(--duration-1) var(--ease-paper);
}
.ip-accordion[open] {
  border-color: var(--stroke-strong);
}
.ip-accordion__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-heading);
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.ip-accordion__summary::-webkit-details-marker {
  display: none;
}
.ip-accordion__summary::after {
  content: "›";
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-muted);
  transition: transform var(--duration-1) var(--ease-paper);
}
.ip-accordion[open] > .ip-accordion__summary::after {
  transform: rotate(90deg);
  color: var(--solid-primary-bg);
}
.ip-accordion__summary:focus-visible {
  outline: var(--focus-width) solid var(--focus-ring);
  outline-offset: -2px;
}
.ip-accordion__content {
  padding: var(--space-3) var(--space-4) var(--space-4);
  color: var(--text-secondary);
  font-size: 0.9rem;
  border-top: 1px solid var(--stroke-default);
}

/* ── Spinner / Loader ──────────────────────────────────────────────────── */
.ip-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-default);
  border-top-color: var(--solid-primary-bg);
  border-radius: 50%;
  animation: ip-spin 0.75s linear infinite;
  vertical-align: middle;
}
.ip-spinner--sm { width: 14px; height: 14px; border-width: 2px; }
.ip-spinner--lg { width: 32px; height: 32px; border-width: 3px; }
@keyframes ip-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .ip-spinner {
    animation: ip-pulse 1.5s ease-in-out infinite;
    border-top-color: var(--border-default);
    background-color: var(--solid-primary-bg);
  }
  @keyframes ip-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
  }
}

/* ── Toast / Notification ──────────────────────────────────────────────── */
.ip-toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--solid-primary-bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2);
  max-width: 420px;
  font-family: var(--font-primary);
  color: var(--text-primary);
}
.ip-toast__body { flex: 1; }
.ip-toast__title { font-weight: 600; font-size: 0.95rem; color: var(--text-heading); margin-bottom: 2px; }
.ip-toast__desc { font-size: 0.85rem; color: var(--text-secondary); margin: 0; }
.ip-toast__close {
  background: none;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 2px;
}
.ip-toast__close:hover { color: var(--text-primary); }
.ip-toast--success { border-left-color: var(--status-success); }
.ip-toast--warning { border-left-color: var(--status-warning); }
.ip-toast--error   { border-left-color: var(--status-error); }

/* ── Avatar ────────────────────────────────────────────────────────────── */
.ip-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand-900);
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 0.9rem;
  user-select: none;
  border: 1px solid var(--border-default);
  overflow: hidden;
}
.ip-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ip-avatar--sm { width: 28px; height: 28px; font-size: 0.75rem; }
.ip-avatar--lg { width: 56px; height: 56px; font-size: 1.2rem; }
.ip-avatar--square { border-radius: var(--radius-sm); }

/* ── Chip / Tag ────────────────────────────────────────────────────────── */
.ip-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  background: var(--surface-inset);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.2;
}
.ip-chip--brand { background: var(--brand-50); color: var(--brand-900); border-color: var(--brand-200); }
.ip-chip--dismissible { padding-right: 4px; }
.ip-chip__remove {
  background: none;
  border: none;
  padding: 0 2px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: var(--text-muted);
  border-radius: 2px;
}
.ip-chip__remove:hover { color: var(--status-error); }
.ip-chip__remove:focus-visible { outline: 1px solid var(--focus-ring); }

/* ── Stat / Metric Card ────────────────────────────────────────────────── */
.ip-stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-1);
}
.ip-stat__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.ip-stat__value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums tabular-nums;
}
.ip-stat__delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.ip-stat__delta--up   { color: var(--status-success); }
.ip-stat__delta--down { color: var(--status-error); }

/* ── Drawer / Slide-Over Sheet ─────────────────────────────────────────── */
.ip-drawer-overlay {
  position: fixed;
  inset: 0;
  background: var(--surface-overlay);
  z-index: 200;
  display: flex;
  justify-content: flex-end;
  animation: ip-fade-in var(--duration-1) var(--ease-paper);
}
.ip-drawer {
  background: var(--surface-card);
  width: 100%;
  max-width: 400px;
  height: 100%;
  box-shadow: var(--shadow-3);
  display: flex;
  flex-direction: column;
  animation: ip-slide-left var(--duration-2) var(--ease-paper);
}
.ip-drawer--left {
  margin-right: auto;
  animation: ip-slide-right var(--duration-2) var(--ease-paper);
}
.ip-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-default);
}
.ip-drawer__title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
}
.ip-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
  color: var(--text-secondary);
}
.ip-drawer__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-default);
}
@keyframes ip-slide-left {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
@keyframes ip-slide-right {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}
@keyframes ip-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Editorial patterns ───────────────────────────────────────────────────
   The display voice in use: quotations, definition lists and figures. Every
   rule below is token-only, so both themes are inherited automatically.
   ──────────────────────────────────────────────────────────────────────── */

/* Uppercase micro-label — the system's substitute for small caps. */
.ip-eyebrow {
  font-family: var(--font-primary, var(--font-sans));
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* Figures for codes, ids and amounts — mono keeps digits unambiguous. */
.ip-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.94em;
  letter-spacing: -0.01em;
}

/* Pull quote — display serif, marked by a copper rule. */
.ip-quote {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text-heading);
  border-left: 3px solid var(--stroke-strong);
  margin: 0;
  padding: var(--space-1) 0 var(--space-1) var(--space-6);
  max-width: var(--layout-max-width-text);
}
.ip-quote__source {
  display: block;
  margin-top: var(--space-3);
  font-family: var(--font-primary, var(--font-sans));
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* Definition list — micro-label term, hairline-separated rows. */
.ip-dl {
  display: grid;
  grid-template-columns: minmax(7rem, 10rem) 1fr;
  margin: 0;
  max-width: var(--layout-max-width-text);
}
.ip-dl dt {
  padding: var(--space-3) var(--space-4) var(--space-3) 0;
  border-bottom: 1px solid var(--border-default);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.ip-dl dd {
  margin: 0;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-default);
  color: var(--text-primary);
}
.ip-dl > :nth-last-child(-n + 2) { border-bottom: 0; }

@media (max-width: 40rem) {
  .ip-dl { grid-template-columns: 1fr; }
  .ip-dl dt { padding-bottom: 0; border-bottom: 0; }
}

/* ── Checkbox & radio ─────────────────────────────────────────────────────
   The native control stays in the DOM (so keyboard, form and AT behaviour are
   free); only its appearance is replaced. Boundary uses --stroke-strong, which
   clears 1.4.11 in both themes (5.44:1 light / 4.84:1 dark on card).
   ──────────────────────────────────────────────────────────────────────── */
.ip-check, .ip-radio {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: 0.95rem;
  color: var(--text-primary);
  cursor: pointer;
}
.ip-check input, .ip-radio input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.15rem 0 0;
  border: 1.5px solid var(--stroke-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  cursor: pointer;
  transition: background-color var(--duration-1) var(--ease-paper),
              border-color var(--duration-1) var(--ease-paper);
}
.ip-radio input { border-radius: 50%; }
.ip-check input:checked, .ip-radio input:checked {
  background: var(--solid-primary-bg);
  border-color: var(--solid-primary-bg);
}
/* the tick is drawn, not an asset */
.ip-check input::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0.28rem;
  height: 0.55rem;
  border: solid var(--solid-primary-text);
  border-width: 0 2px 2px 0;
  transform: translateY(-8%) rotate(45deg);
  opacity: 0;
}
.ip-check input:checked::after { opacity: 1; }
/* The dash is white, so the box must be filled for it to be visible — the
   unchecked surface would hide it. (Verified by screenshot, not by computed
   opacity.) */
.ip-check input:indeterminate {
  background: var(--solid-primary-bg);
  border-color: var(--solid-primary-bg);
}
.ip-check input:indeterminate::after {
  opacity: 1;
  width: 0.55rem;
  height: 0;
  border-width: 0 0 2px 0;
  transform: none;
}
.ip-radio input::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--solid-primary-text);
  opacity: 0;
}
.ip-radio input:checked::after { opacity: 1; }
.ip-check input:disabled, .ip-radio input:disabled {
  border-color: var(--border-default);
  background: var(--surface-inset);
  cursor: not-allowed;
}
.ip-check input:disabled::after, .ip-radio input:disabled::after {
  border-color: var(--text-disabled);
  background-color: var(--text-disabled);
}
.ip-check:has(input:disabled), .ip-radio:has(input:disabled) {
  color: var(--text-disabled);
  cursor: not-allowed;
}
.ip-check__hint {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.ip-radios {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  border: 0;
}
.ip-radios legend { margin-bottom: var(--space-2); padding: 0; }

/* ── Rule / labelled divider ──────────────────────────────────────────────
   `<hr class="ip-rule">` for a plain rule, `<p class="ip-rule">or</p>` for a
   labelled one — an empty element collapses to a single line.
   ──────────────────────────────────────────────────────────────────────── */
.ip-rule {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-6) 0;
  border: 0;
  color: var(--text-muted);
  font-family: var(--font-primary, var(--font-sans));
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ip-rule::before, .ip-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-default);
}
.ip-rule:empty::after { display: none; }

/* ── Code, inline code, keycaps ────────────────────────────────────────── */
.ip-code {
  display: block;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-well);
}
.ip-code__title {
  display: block;
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--border-default);
  background: var(--surface-card);
  font-family: var(--font-primary, var(--font-sans));
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.ip-code__body {
  display: block;
  margin: 0;
  padding: var(--space-4);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-primary);
  tab-size: 2;
}
.ip-code--inline {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 0.06em 0.34em;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-well);
  color: var(--text-primary);
}
.ip-kbd {
  display: inline-block;
  min-width: 1.5rem;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--border-default);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  text-align: center;
  color: var(--text-secondary);
}

/* ── Avatar group ──────────────────────────────────────────────────────── */
.ip-avatars {
  --ip-avatars-ring: var(--surface-card);
  display: inline-flex;
  align-items: center;
}
.ip-avatars .ip-avatar {
  margin-left: -0.55rem;
  box-shadow: 0 0 0 2px var(--ip-avatars-ring);
}
.ip-avatars .ip-avatar:first-child { margin-left: 0; }
.ip-avatars__more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 var(--space-1);
  margin-left: -0.55rem;
  border-radius: 50%;
  background: var(--surface-inset);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--ip-avatars-ring);
}

/* ── Steps ────────────────────────────────────────────────────────────────
   Numbered in the display serif with leading zeros — the manual metaphor.
   ──────────────────────────────────────────────────────────────────────── */
.ip-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: ip-step;
}
.ip-steps > li {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-default);
  counter-increment: ip-step;
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.ip-steps > li:last-child { border-bottom: 0; }
.ip-steps > li::before {
  content: counter(ip-step, decimal-leading-zero);
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.35;
  color: var(--text-muted);
  font-variant-numeric: lining-nums tabular-nums;
}
.ip-steps > li[aria-current='step'] { color: var(--text-primary); }
.ip-steps > li[aria-current='step']::before { color: var(--solid-primary-bg); }
.ip-steps__title { display: block; font-weight: 600; color: var(--text-heading); }

/* ── Timeline / ledger ──────────────────────────────────────────────────── */
.ip-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ip-timeline > li {
  position: relative;
  /* was `var(--space-5)`, which the scale does not define (1,2,3,4,6,8,12,16,24):
     an undeclared var() makes the whole declaration invalid at computed-value time,
     so this padding silently collapsed to 0 and the dot sat on the first character. */
  padding: 0 0 var(--space-3) var(--space-4);
  border-left: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.ip-timeline > li:last-child {
  padding-bottom: 0;
  border-left-color: transparent;
}
.ip-timeline > li::before {
  content: '';
  position: absolute;
  left: -0.28rem;
  top: 0.3rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--solid-primary-bg);
  box-shadow: 0 0 0 3px var(--surface-card);
}
.ip-timeline__time {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.ip-timeline__title { display: block; font-weight: 600; color: var(--text-heading); }

/* ── Banner (page-level notice with an action slot) ────────────────────── */
.ip-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--stroke-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-primary);
  font-size: 0.92rem;
}
.ip-banner__title {
  margin: 0 0 var(--space-1);
  font-weight: 600;
  color: var(--text-heading);
}
.ip-banner__action { flex: none; margin-left: auto; }
.ip-banner__body { flex: 1; min-width: 0; }
.ip-banner__close {
  flex: none;
  padding: 0 var(--space-1);
  border: 0;
  background: none;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}
.ip-banner__close:hover { color: var(--text-primary); }
.ip-banner--success { border-left-color: var(--status-success); }
.ip-banner--warning { border-left-color: var(--status-warning); }
.ip-banner--error   { border-left-color: var(--status-error); }

/* ── Copy field (keys, ids, amounts) ───────────────────────────────────── */
.ip-copy {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-1) var(--space-1) var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-well);
}
.ip-copy__label {
  display: block;
  margin-bottom: var(--space-1);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.ip-copy__value {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  overflow-x: auto;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* ── Sortable table header ────────────────────────────────────────────────
   Put `aria-sort` on the <th>; the indicator follows it.
   ──────────────────────────────────────────────────────────────────────── */
.ip-th-sort {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  cursor: pointer;
}
.ip-th-sort::after {
  content: '\2195';
  font-size: 0.9em;
  /* a readable affordance, not a 40%-opacity ghost: at 0.4 this measured 1.75:1
     and got *worse* on hover, because the arrow followed the link colour */
  color: var(--text-muted);
}
.ip-th-sort:hover { color: var(--text-link); }
.ip-th-sort:hover::after { color: var(--text-link); }
.ip-table th[aria-sort='ascending'] .ip-th-sort::after,
.ip-table th[aria-sort='descending'] .ip-th-sort::after {
  color: var(--solid-primary-bg);
}
.ip-table th[aria-sort='ascending'] .ip-th-sort::after { content: '\2191'; }
.ip-table th[aria-sort='descending'] .ip-th-sort::after { content: '\2193'; }

/* ── Menu / dropdown ───────────────────────────────────────────────────── */
.ip-menu {
  position: relative;
  display: inline-block;
}
.ip-menu__panel {
  color: var(--text-primary);
  position: absolute;
  z-index: 100;
  top: calc(100% + var(--space-1));
  left: 0;
  min-width: 11rem;
  padding: var(--space-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  box-shadow: var(--shadow-2);
}
.ip-menu__panel[hidden] { display: none; }
.ip-menu__panel--right { left: auto; right: 0; }
.ip-menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  color: var(--text-primary);
  cursor: pointer;
}
.ip-menu__item:hover, .ip-menu__item:focus-visible { background: var(--surface-inset); }
.ip-menu__item[aria-disabled='true'] {
  color: var(--text-disabled);
  cursor: not-allowed;
}
.ip-menu__sep {
  height: 1px;
  margin: var(--space-1) 0;
  border: 0;
  background: var(--border-default);
}
.ip-menu__item--danger { color: var(--status-error); }

/* ── Command palette (⌘K) ──────────────────────────────────────────────── */
.ip-cmd-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(3rem, 12vh, 9rem) var(--space-4) var(--space-4);
  background: var(--surface-overlay);
  animation: ip-fade-in var(--duration-1) var(--ease-paper);
}
.ip-cmd-overlay[hidden] { display: none; }
.ip-cmd {
  color: var(--text-primary);
  width: 100%;
  max-width: 34rem;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  box-shadow: var(--shadow-3);
}
.ip-cmd__field {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-default);
}
/* the input drops its own outline, but the field shows a focus underline —
   a visible indicator is never removed (WCAG 2.4.7) */
.ip-cmd__field:focus-within { box-shadow: inset 0 -2px 0 var(--focus-ring); }
.ip-cmd__input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-primary, var(--font-sans));
  font-size: 1rem;
  color: var(--text-primary);
}
.ip-cmd__input:focus { outline: none; }
.ip-cmd__input::placeholder { color: var(--text-placeholder); }
.ip-cmd__list {
  max-height: 20rem;
  overflow-y: auto;
  margin: 0;
  padding: var(--space-2);
  list-style: none;
}
.ip-cmd__group-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.ip-cmd__group {
  padding: var(--space-2) var(--space-3) var(--space-1);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ip-cmd__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text-primary);
  cursor: pointer;
}
.ip-cmd__item[aria-selected='true'] { background: var(--surface-inset); }
.ip-cmd__hint {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.ip-cmd__empty {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  color: var(--text-muted);
}
.ip-cmd__footer {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  border-top: 1px solid var(--border-default);
  background: var(--surface-well);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.ip-cmd__footer .ip-kbd { margin-right: calc(-1 * var(--space-2)); }

/* ── Segmented control ─────────────────────────────────────────────────── */
.ip-segmented {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-well);
}
.ip-segmented__item {
  padding: var(--space-1) var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font-family: var(--font-primary, var(--font-sans));
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color var(--duration-1) var(--ease-paper),
              color var(--duration-1) var(--ease-paper);
}
.ip-segmented__item:hover { color: var(--text-primary); }
.ip-segmented__item[aria-checked='true'],
.ip-segmented__item[aria-pressed='true'] {
  background: var(--surface-card);
  color: var(--text-heading);
  box-shadow: var(--shadow-1);
}
.ip-segmented__item:disabled { color: var(--text-disabled); cursor: not-allowed; }

/* ── Number field ──────────────────────────────────────────────────────── */
.ip-number {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  overflow: hidden;
}
.ip-number__btn {
  flex: none;
  width: 2.25rem;
  align-self: stretch;
  border: 0;
  background: none;
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
}
.ip-number__btn:hover { background: var(--surface-inset); color: var(--text-primary); }
.ip-number__btn:disabled { color: var(--text-disabled); cursor: not-allowed; background: none; }
.ip-number__input {
  width: 4.5rem;
  padding: var(--space-2) var(--space-1);
  border: 0;
  border-left: 1px solid var(--border-default);
  border-right: 1px solid var(--border-default);
  background: none;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  text-align: center;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.ip-number__input:focus { outline: none; }
.ip-number__input::-webkit-outer-spin-button,
.ip-number__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ip-number:focus-within {
  border-color: var(--stroke-strong);
  box-shadow: inset 0 -2px 0 var(--focus-ring);
}

/* ── Status / presence ─────────────────────────────────────────────────── */
.ip-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.ip-status::before {
  content: '';
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--text-muted);
}
.ip-status--success::before { background: var(--status-success); }
.ip-status--warning::before { background: var(--status-warning); }
.ip-status--error::before   { background: var(--status-error); }
.ip-status--info::before    { background: var(--ink-500); }
.ip-status--muted::before   { background: var(--border-default); }
.ip-status--pulse::before {
  box-shadow: 0 0 0 0 var(--status-success);
  animation: ip-pulse 2.4s var(--ease-paper) infinite;
}
@keyframes ip-pulse {
  0%   { box-shadow: 0 0 0 0 var(--status-success); }
  60%  { box-shadow: 0 0 0 0.35rem transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ── Page header ───────────────────────────────────────────────────────── */
.ip-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-default);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}
.ip-page-head__crumb {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-2);
  padding: 0;
  list-style: none;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ip-page-head__crumb li + li::before {
  content: '/';
  margin-right: var(--space-2);
  color: var(--text-muted);
}
.ip-page-head__crumb a { color: inherit; text-decoration: none; }
.ip-page-head__crumb a:hover { color: var(--text-link); text-decoration: underline; }
.ip-page-head__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.25rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-heading);
}
.ip-page-head__meta { margin-top: var(--space-1); font-size: 0.9rem; color: var(--text-muted); }
.ip-page-head__actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }

/* ── File drop ─────────────────────────────────────────────────────────── */
.ip-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-8) var(--space-4);
  border: 1.5px dashed var(--stroke-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-well);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color var(--duration-1) var(--ease-paper);
}
.ip-drop:hover, .ip-drop.is-over { background: var(--surface-inset); }
.ip-drop__title { font-weight: 600; color: var(--text-heading); }
.ip-drop__hint { font-size: 0.8rem; color: var(--text-muted); }
.ip-drop__list {
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
  width: 100%;
}
.ip-drop__file {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--border-default);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-primary);
}
.ip-drop__file:last-child { border-bottom: 0; }
.ip-drop__file-size { margin-left: auto; color: var(--text-muted); }

