:root {
  --ring: 37 99 235;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;

  /* Landing-aligned light canvas (same family as marketing band — airy, not heavy) */
  --marketing-band: #e8eef5;
  --marketing-nav: rgba(7, 11, 18, 0.86);
  --bg-app: var(--marketing-band);
  --bg-surface: #ffffff;
  --bg-surface-soft: #f8fafc;
  --bg-accent-soft: #eff6ff;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-soft: #64748b;
  --border-main: #e2e8f0;
  --border-soft: #f1f5f9;
  --brand-main: #2563eb;
  --brand-hover: #1d4ed8;
  --brand-on-dark: #93c5fd;
  /* Alias for legacy --brand-primary references; keep in sync with --brand-main */
  --brand-primary: var(--brand-main);
  --danger: #e11d48;
  --danger-hover: #be123c;
  --success: #059669;
  --warning: #d97706;
  --shadow-main: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(15, 23, 42, 0.06);
  --shadow-modal: 0 24px 48px rgba(15, 23, 42, 0.18);
}

html[data-theme="dark"] {
  --marketing-band: #090d14;
  --marketing-nav: rgba(3, 7, 18, 0.92);
  --bg-app: #090d14;
  --bg-surface: #121926;
  --bg-surface-soft: #1a2435;
  --bg-accent-soft: #132238;
  --text-main: #e5edf8;
  --text-muted: #9db0ca;
  --text-soft: #6f829f;
  --border-main: #2a374e;
  --border-soft: #1f2c44;
  --brand-main: #60a5fa;
  --brand-hover: #93c5fd;
  --brand-on-dark: #bfdbfe;
  --brand-primary: var(--brand-main);
  --danger: #fb7185;
  --danger-hover: #fda4af;
  --success: #34d399;
  --warning: #fbbf24;
  --shadow-main: 0 12px 28px rgba(0, 0, 0, 0.32);
  --shadow-modal: 0 24px 56px rgba(0, 0, 0, 0.48);
}

/* Compatibility layer for Tailwind utility-heavy templates */
html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-white\/90,
html[data-theme="dark"] .bg-white\/95 {
  background-color: var(--bg-surface) !important;
}

html[data-theme="dark"] .bg-gray-50,
html[data-theme="dark"] .bg-slate-50 {
  background-color: var(--bg-app) !important;
}

/* Light-mode – allow tinted backgrounds to show through on Tailwind bg-white */
html:not([data-theme="dark"]) .bg-white {
  background-color: var(--bg-surface);
}

html[data-theme="dark"] .bg-gray-100,
html[data-theme="dark"] .bg-slate-100,
html[data-theme="dark"] .bg-indigo-50 {
  background-color: var(--bg-surface-soft) !important;
}

html[data-theme="dark"] .text-gray-900,
html[data-theme="dark"] .text-slate-900,
html[data-theme="dark"] .text-gray-800,
html[data-theme="dark"] .text-slate-800,
html[data-theme="dark"] .text-gray-700,
html[data-theme="dark"] .text-slate-700 {
  color: var(--text-main) !important;
}

html[data-theme="dark"] .text-gray-600,
html[data-theme="dark"] .text-slate-600,
html[data-theme="dark"] .text-gray-500,
html[data-theme="dark"] .text-slate-500,
html[data-theme="dark"] .text-gray-400,
html[data-theme="dark"] .text-slate-400 {
  color: var(--text-muted) !important;
}

html[data-theme="dark"] .border-gray-50,
html[data-theme="dark"] .border-slate-50,
html[data-theme="dark"] .border-gray-100,
html[data-theme="dark"] .border-slate-100,
html[data-theme="dark"] .border-gray-200,
html[data-theme="dark"] .border-slate-200,
html[data-theme="dark"] .border-gray-300,
html[data-theme="dark"] .border-slate-300 {
  border-color: var(--border-main) !important;
}

html[data-theme="dark"] .divide-gray-100 > :not([hidden]) ~ :not([hidden]),
html[data-theme="dark"] .divide-slate-100 > :not([hidden]) ~ :not([hidden]) {
  border-color: var(--border-main) !important;
}

html[data-theme="dark"] .hover\:bg-gray-50:hover,
html[data-theme="dark"] .hover\:bg-slate-50:hover,
html[data-theme="dark"] .hover\:bg-gray-100:hover,
html[data-theme="dark"] .hover\:bg-slate-100:hover {
  background-color: var(--bg-surface-soft) !important;
}

html[data-theme="dark"] .bg-indigo-600 {
  background-color: var(--brand-main) !important;
}

html[data-theme="dark"] .bg-indigo-50 {
  background-color: var(--bg-accent-soft) !important;
}

html[data-theme="dark"] .text-indigo-700,
html[data-theme="dark"] .text-indigo-600,
html[data-theme="dark"] .text-indigo-500 {
  color: var(--brand-on-dark) !important;
}

body {
  background: var(--bg-app);
  color: var(--text-main);
  font-family: Manrope, Inter, ui-sans-serif, system-ui, sans-serif;
}

.app-shell-bg {
  background:
    radial-gradient(1200px 480px at 12% -8%, color-mix(in srgb, var(--brand-main) 6%, transparent), transparent 55%),
    radial-gradient(900px 400px at 100% 0%, color-mix(in srgb, var(--brand-main) 4%, transparent), transparent 50%),
    var(--bg-app);
}

html[data-theme="dark"] .app-shell-bg {
  background:
    radial-gradient(1000px 420px at 15% -10%, color-mix(in srgb, var(--brand-main) 12%, transparent), transparent 55%),
    var(--bg-app);
}

.app-bg-glow {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--brand-main) 8%, transparent) 0%,
    color-mix(in srgb, var(--brand-main) 3%, transparent) 42%,
    transparent 100%
  );
}

html[data-theme="dark"] .app-bg-glow {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--brand-main) 14%, transparent) 0%,
    transparent 72%
  );
}

/* Authenticated top bar */
.app-topbar {
  border-bottom: 1px solid var(--border-main) !important;
  background: color-mix(in srgb, var(--bg-surface) 94%, transparent) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

html[data-theme="dark"] .app-topbar {
  background: color-mix(in srgb, var(--bg-surface) 90%, #020617) !important;
  border-bottom-color: var(--border-main);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

/* Workspace company mark (header + sidebar) */
.workspace-brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.workspace-brand-mark--logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.workspace-brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.workspace-brand-mark--initials {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}

.workspace-brand-copy {
  min-width: 0;
}

.workspace-brand-name {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text-main);
}

.workspace-brand-by {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
  color: var(--text-soft);
}

/* Top bar brand: mobile only; desktop uses sidebar (show again when sidebar collapsed). */
@media (min-width: 768px) {
  html.sidebar-collapsed .app-topbar-brand {
    display: flex;
  }

  html.sidebar-collapsed .app-topbar-title-divider {
    display: block;
  }
}

.app-topbar-brand .workspace-brand-copy {
  display: none;
}

@media (min-width: 640px) {
  .app-topbar-brand .workspace-brand-copy {
    display: block;
    max-width: 11rem;
  }
}

@media (min-width: 1024px) {
  .app-topbar-brand .workspace-brand-copy {
    max-width: 14rem;
  }
}

.app-topbar-title-divider {
  width: 1px;
  height: 1.5rem;
  margin: 0 0.125rem;
  background: var(--border-main);
  flex-shrink: 0;
}

.app-page-title {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: var(--text-main);
}

.ih-collection-title-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease;
}

.ih-collection-title-edit:hover {
  color: var(--brand-main);
  background: color-mix(in srgb, var(--brand-main) 10%, transparent);
}

.app-page-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem 0.35rem 0.5rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-muted);
  transition: color 140ms ease, background-color 140ms ease;
}

.app-page-back:hover {
  color: var(--text-main);
  background: var(--bg-surface-soft);
}

.app-page-back svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.app-topbar-page-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  min-width: 0;
}

.app-topbar-page-actions:empty {
  display: none;
}

.app-topbar-page-actions:empty + .app-topbar-divider {
  display: none;
}

.app-topbar-divider {
  width: 1px;
  height: 1.75rem;
  margin-left: 0.25rem;
  background: var(--border-main);
  flex-shrink: 0;
}

.app-user-menu {
  position: relative;
  flex-shrink: 0;
}

.app-user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.35rem 0.2rem 0.2rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.app-user-menu-trigger:hover {
  background: var(--bg-surface-soft);
  border-color: var(--border-main);
}

.app-user-menu-trigger[aria-expanded="true"] {
  background: var(--bg-surface-soft);
  border-color: color-mix(in srgb, var(--brand-main) 28%, var(--border-main));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-main) 12%, transparent);
}

.app-user-menu-avatar,
.app-user-menu-header-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 4px 14px color-mix(in srgb, var(--brand-main) 28%, transparent);
}

.app-user-menu-avatar {
  width: 2.25rem;
  height: 2.25rem;
  font-size: 0.6875rem;
}

.app-user-menu-avatar--photo,
.app-user-menu-header-avatar.app-user-menu-avatar--photo {
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-main);
  background: var(--bg-surface);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  color: inherit;
  text-transform: none;
}

.app-user-menu-header-avatar.app-user-menu-avatar--photo {
  width: 2.5rem;
  height: 2.5rem;
}

.app-user-menu-chevron {
  width: 0.875rem;
  height: 0.875rem;
  color: var(--text-soft);
  flex-shrink: 0;
  transition: transform 140ms ease;
}

.app-user-menu-trigger[aria-expanded="true"] .app-user-menu-chevron {
  transform: rotate(180deg);
}

.app-user-menu-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 50;
  width: min(17.5rem, calc(100vw - 1.5rem));
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-main);
  background: var(--bg-surface);
  box-shadow:
    0 4px 6px rgba(15, 23, 42, 0.04),
    0 16px 40px rgba(15, 23, 42, 0.14);
  overflow: hidden;
}

.app-user-menu-panel.hidden {
  display: none;
}

.app-user-menu-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--brand-main) 4%, var(--bg-surface));
}

.app-user-menu-header-avatar {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.app-user-menu-name {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-main);
}

.app-user-menu-email {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--text-soft);
}

.app-user-menu-role {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--brand-main);
  background: color-mix(in srgb, var(--brand-main) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand-main) 18%, transparent);
}

.app-user-menu-body,
.app-user-menu-footer {
  padding: 0.35rem;
}

.app-user-menu-footer {
  border-top: 1px solid var(--border-soft);
}

.app-user-menu-signout-form {
  margin: 0;
}

.app-user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  border: none;
  border-radius: calc(var(--radius-md) - 2px);
  background: transparent;
  padding: 0.55rem 0.65rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  color: var(--text-main);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.app-user-menu-item svg {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  color: var(--text-soft);
}

.app-user-menu-item:hover {
  background: var(--bg-surface-soft);
  color: var(--text-main);
}

.app-user-menu-item:hover svg {
  color: var(--brand-main);
}

.app-user-menu-item.is-active {
  background: color-mix(in srgb, var(--brand-main) 10%, var(--bg-surface));
  color: var(--brand-main);
}

.app-user-menu-item.is-active svg {
  color: var(--brand-main);
}

.app-user-menu-item--danger {
  color: #b91c1c;
}

.app-user-menu-item--danger svg {
  color: #b91c1c;
}

.app-user-menu-item--danger:hover {
  background: color-mix(in srgb, #ef4444 10%, transparent);
  color: #991b1b;
}

html[data-theme="dark"] .app-user-menu-item--danger {
  color: #fca5a5;
}

html[data-theme="dark"] .app-user-menu-item--danger:hover {
  background: color-mix(in srgb, #ef4444 18%, transparent);
  color: #fecaca;
}

/* ── Notifications bell & panel ─────────────────────────────────────────── */

.app-notifications {
  position: relative;
}

.app-notifications-trigger {
  position: relative;
}

.app-notifications-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 0.25rem;
  border-radius: 9999px;
  background: var(--brand-main);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1.125rem;
  text-align: center;
}

.app-notifications-badge.hidden {
  display: none;
}

.app-notifications-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 60;
  width: min(22rem, calc(100vw - 1.5rem));
  max-height: min(28rem, 70vh);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg, 0.75rem);
  border: 1px solid var(--border-main);
  background: var(--bg-surface);
  box-shadow:
    0 4px 6px rgba(15, 23, 42, 0.06),
    0 16px 40px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

.app-notifications-panel.hidden {
  display: none;
}

.app-notifications-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-soft);
}

.app-notifications-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

.app-notifications-mark-all {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--brand-main);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.app-notifications-mark-all:hover {
  text-decoration: underline;
}

.app-notifications-mark-all.hidden {
  display: none;
}

.app-notifications-active-jobs {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.app-notifications-active-jobs.hidden {
  display: none;
}

.app-notifications-job {
  font-size: 0.75rem;
}

.app-notifications-job-title {
  margin: 0 0 0.25rem;
  font-weight: 600;
  color: var(--text-main);
}

.app-notifications-job-bar {
  height: 4px;
  border-radius: 9999px;
  background: var(--border-soft);
  overflow: hidden;
}

.app-notifications-job-bar-fill {
  height: 100%;
  background: var(--brand-main);
  border-radius: 9999px;
  transition: width 0.2s ease;
}

.app-notifications-job-meta {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
}

.app-notifications-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 0;
}

.app-notifications-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.625rem 1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 1px solid var(--border-soft);
}

.app-notifications-item:last-child {
  border-bottom: none;
}

.app-notifications-item:hover {
  background: color-mix(in srgb, var(--brand-main) 6%, transparent);
}

.app-notifications-item.is-unread {
  background: color-mix(in srgb, var(--brand-main) 4%, transparent);
}

.app-notifications-item-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
}

.app-notifications-item-body {
  margin: 0.125rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.app-notifications-item-time {
  margin: 0.25rem 0 0;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.app-notifications-item--success .app-notifications-item-title {
  color: #15803d;
}

.app-notifications-item--error .app-notifications-item-title {
  color: #b91c1c;
}

.app-notifications-item--warning .app-notifications-item-title {
  color: #b45309;
}

.app-notifications-empty {
  margin: 0;
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.app-notifications-footer {
  padding: 0.625rem 1rem;
  border-top: 1px solid var(--border-soft);
}

.app-notifications-view-all {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--brand-main);
  text-decoration: none;
}

.app-notifications-view-all:hover {
  text-decoration: underline;
}

/* Full-page inbox */

.notifications-inbox {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg, 0.75rem);
  background: var(--bg-surface);
  overflow: hidden;
}

.notifications-inbox-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-soft);
}

.notifications-inbox-item:last-child {
  border-bottom: none;
}

.notifications-inbox-item.is-unread {
  background: color-mix(in srgb, var(--brand-main) 4%, transparent);
}

.notifications-inbox-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

.notifications-inbox-body {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.notifications-inbox-progress {
  margin-top: 0.5rem;
  height: 4px;
  border-radius: 9999px;
  background: var(--border-soft);
  overflow: hidden;
}

.notifications-inbox-progress-bar {
  height: 100%;
  background: var(--brand-main);
  border-radius: 9999px;
}

.notifications-inbox-meta,
.notifications-inbox-time {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.notifications-inbox-action {
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--brand-main);
  text-decoration: none;
}

.notifications-inbox-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

/* Support chat styles live in static/css/support-chat.css */

html[data-theme="dark"] .app-user-menu-panel {
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.2),
    0 16px 40px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .app-page-title {
  color: var(--text-main);
}

html[data-theme="dark"] .app-topbar .btn-icon {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(226, 232, 240, 0.95);
}

html[data-theme="dark"] .app-topbar .btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

html[data-theme="dark"] .app-topbar .theme-toggle-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
}

html[data-theme="dark"] .app-topbar .theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #f1f5f9;
}

/* Product mark — matches landing hero CTAs */
.ih-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  background: linear-gradient(145deg, var(--brand-main) 0%, color-mix(in srgb, var(--brand-main) 55%, #0c4a6e) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 8px 22px color-mix(in srgb, var(--brand-main) 28%, transparent);
}

.ih-brand-mark:hover {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 10px 28px color-mix(in srgb, var(--brand-main) 38%, transparent);
}

.ih-gradient-accent {
  background: linear-gradient(
    90deg,
    var(--brand-main) 0%,
    color-mix(in srgb, var(--brand-main) 72%, #0369a1) 50%,
    var(--brand-hover) 100%
  );
}

/* Public embeds — light shell + header in light mode; dark chrome only in dark mode */
.ih-public-shell {
  min-height: 100dvh;
  background:
    radial-gradient(520px 240px at 92% -5%, color-mix(in srgb, var(--brand-main) 9%, transparent), transparent 58%),
    radial-gradient(420px 200px at 2% 72%, color-mix(in srgb, var(--brand-main) 6%, transparent), transparent 55%),
    var(--marketing-band);
  color: var(--text-main);
}

html[data-theme="dark"] .ih-public-shell {
  background:
    radial-gradient(520px 240px at 92% -5%, color-mix(in srgb, var(--brand-main) 14%, transparent), transparent 58%),
    var(--bg-app);
}

.ih-public-header {
  background: color-mix(in srgb, #ffffff 92%, var(--bg-accent-soft));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-main);
}

html[data-theme="dark"] .ih-public-header {
  background: var(--marketing-nav);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .ih-public-header .text-zinc-500,
html[data-theme="dark"] .ih-public-header .text-zinc-400 {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .ih-public-header .text-zinc-900,
html[data-theme="dark"] .ih-public-header .text-zinc-800 {
  color: rgba(255, 255, 255, 0.96) !important;
}

html[data-theme="dark"] .ih-public-header .border-zinc-200,
html[data-theme="dark"] .ih-public-header .border-zinc-400 {
  border-color: rgba(255, 255, 255, 0.16) !important;
}

html[data-theme="dark"] .ih-public-header .bg-zinc-50 {
  background: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] .ih-public-header .bg-white {
  background: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] .ih-public-header .text-zinc-700,
html[data-theme="dark"] .ih-public-header .text-zinc-600 {
  color: rgba(226, 232, 240, 0.95) !important;
}

html[data-theme="dark"] .ih-public-header .hover\:border-zinc-500:hover {
  border-color: rgba(255, 255, 255, 0.28) !important;
}

html[data-theme="dark"] .ih-public-header .hover\:bg-zinc-50:hover {
  background: rgba(255, 255, 255, 0.14) !important;
}

html[data-theme="dark"] .ih-public-header .download-cta {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #fff !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 6px 18px rgba(29, 78, 216, 0.35);
}

html[data-theme="dark"] .ih-public-header .download-cta:hover {
  background: linear-gradient(180deg, #3b82f6 0%, #1e40af 100%) !important;
}

html[data-theme="dark"] .ih-public-header .workspace-brand-name {
  color: rgba(255, 255, 255, 0.96) !important;
}

html[data-theme="dark"] .ih-public-header .workspace-brand-by {
  color: #94a3b8 !important;
}

/* Public media header — one bar; brand copy only from md up (md:grid not in tailwind build) */
.ih-public-media-header-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
}

.ih-public-media-header-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}

.ih-public-media-header-brand-copy {
  display: none;
  min-width: 0;
}

.ih-public-media-header-title {
  min-width: 0;
  flex: 1 1 0%;
}

.ih-public-media-header-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.25rem;
}

.ih-public-media-header-actions .ih-public-media-action-label {
  display: none;
}

@media (min-width: 768px) {
  .ih-public-media-header-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 1.25rem;
    padding: 0.75rem 1.25rem;
  }

  .ih-public-media-header-brand {
    justify-self: start;
  }

  .ih-public-media-header-brand-copy {
    display: block;
  }

  .ih-public-media-header-title {
    flex: none;
    max-width: min(100%, 28rem);
    justify-self: center;
    text-align: center;
    padding-inline: 0.5rem;
  }

  .ih-public-media-header-actions {
    justify-self: end;
    gap: 0.375rem;
    padding-left: 0.5rem;
  }

  .ih-public-media-header-actions .ih-public-media-action-label {
    display: inline;
  }
}

/* Visitor gate — align with public share header + surface panel theme */
.ih-visitor-gate-page {
  position: relative;
  isolation: isolate;
}

.ih-visitor-gate-page > .ih-landing-section-patterns {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.7;
}

.ih-visitor-gate-shell {
  position: relative;
  z-index: 1;
}

.ih-visitor-gate-header {
  background: color-mix(in srgb, #ffffff 82%, transparent);
}

html[data-theme="dark"] .ih-visitor-gate-header {
  background: color-mix(in srgb, var(--marketing-nav) 88%, transparent);
}

.ih-visitor-gate-header-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  width: 100%;
  min-width: 0;
  padding: 0.75rem 1rem;
}

.ih-visitor-gate-header-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  z-index: 1;
}

.ih-visitor-gate-header-brand-copy {
  min-width: 0;
}

@media (max-width: 639px) {
  .ih-visitor-gate-header-brand-copy {
    display: none;
  }
}

.ih-visitor-gate-header-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(52vw, 22rem);
  min-width: 0;
  text-align: center;
  pointer-events: none;
}

.ih-visitor-gate-header-title h1 {
  pointer-events: auto;
}

.ih-visitor-gate-eyebrow {
  margin: 0 0 0.15rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
}

.ih-visitor-gate-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
  z-index: 1;
  margin-left: auto;
}

@media (min-width: 768px) {
  .ih-visitor-gate-header-bar {
    padding: 0.85rem 1.25rem;
  }

  .ih-visitor-gate-header-title {
    width: min(40vw, 28rem);
  }
}

html[data-theme="dark"] .ih-visitor-gate-header .text-zinc-900 {
  color: var(--text-main);
}

.ih-visitor-gate-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 2rem;
}

.ih-visitor-gate-card {
  width: 100%;
  max-width: 28rem;
  padding: 1.5rem 1.35rem 1.35rem;
  background: color-mix(in srgb, var(--bg-surface) 94%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.ih-visitor-gate-card-header {
  margin-bottom: 1.25rem;
}

.ih-visitor-gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--brand-main) 22%, var(--border-main));
  background: color-mix(in srgb, var(--brand-main) 8%, var(--bg-surface));
  color: var(--brand-main);
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.ih-visitor-gate-card-title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.25;
}

.ih-visitor-gate-card-lead {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.ih-visitor-gate-form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.ih-visitor-gate-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ih-visitor-gate-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
}

.ih-visitor-gate-req {
  color: #b91c1c;
}

html[data-theme="dark"] .ih-visitor-gate-req {
  color: #fca5a5;
}

.ih-visitor-gate-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--text-main);
  cursor: pointer;
}

.ih-visitor-gate-check input {
  margin-top: 0.2rem;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  accent-color: var(--brand-main);
}

.ih-visitor-gate-error {
  margin: 0;
  font-size: 0.75rem;
  color: #b91c1c;
}

html[data-theme="dark"] .ih-visitor-gate-error {
  color: #fca5a5;
}

.ih-visitor-gate-submit {
  width: 100%;
  margin-top: 0.35rem;
}

.ih-visitor-gate-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.ih-visitor-gate-footer {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--bg-surface) 78%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

html[data-theme="dark"] .ih-visitor-gate-footer {
  background: color-mix(in srgb, var(--bg-surface) 70%, transparent);
}

html[data-theme="dark"] .ih-visitor-gate-footer .text-zinc-600 {
  color: var(--text-muted);
}

html[data-theme="dark"] .ih-visitor-gate-footer .text-zinc-700 {
  color: var(--text-main);
}

html[data-theme="dark"] .ih-visitor-gate-footer .text-zinc-500 {
  color: var(--text-muted);
}

[data-visitor-gate-root] [data-vg-preset].is-active {
  background: color-mix(in srgb, var(--brand-main) 10%, var(--bg-surface));
  border-color: color-mix(in srgb, var(--brand-main) 45%, var(--border-main));
  color: var(--brand-main);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-main) 18%, transparent);
}

/* Public media share page — media-first layout; inherits ih-public-shell theme */
.ih-public-media-page--image {
  height: 100dvh;
  overflow: hidden;
}

.ih-public-media-page--image > .flex {
  height: 100%;
  min-height: 0;
}

.ih-public-media-page--image .ih-public-media-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.ih-public-media-page--image .ih-public-media-viewer-wrap {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.ih-public-media-page--image .ih-public-media-viewer {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.ih-public-media-main {
  background: color-mix(in srgb, var(--bg-accent-soft) 55%, #d4d4d8);
}

html[data-theme="dark"] .ih-public-media-main {
  background: color-mix(in srgb, var(--bg-app) 88%, #52525b);
}

.ih-public-media-notes {
  width: 100%;
  border-bottom: 1px solid var(--border-main);
  background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.ih-public-media-notes > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.375rem 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.ih-public-media-notes > summary::-webkit-details-marker {
  display: none;
}

.ih-public-media-notes-body {
  max-height: 6rem;
  overflow: auto;
  padding: 0 0.75rem 0.5rem;
  line-height: 1.45;
  color: var(--text-main);
}

.ih-public-media-viewer-wrap {
  position: relative;
  width: 100%;
  padding: 0.375rem;
}

.ih-public-media-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.ih-public-media-loading.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ih-public-media-loading-spinner {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  border: 3px solid color-mix(in srgb, var(--brand-main) 18%, transparent);
  border-top-color: var(--brand-main);
  animation: ih-spin 0.75s linear infinite;
}

.ih-public-media-loading-text {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

html[data-theme="dark"] .ih-public-media-loading {
  background: color-mix(in srgb, var(--bg-app) 90%, transparent);
}

@media (min-width: 640px) {
  .ih-public-media-viewer-wrap {
    padding: 0.5rem;
  }
}

.ih-public-media-viewer {
  width: 100%;
  background: transparent;
}

.ih-public-image-viewport {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}

.ih-public-image-scroll {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
}

.ih-public-image-scroll.is-zoomed {
  align-items: flex-start;
  justify-content: flex-start;
  overflow: auto;
}

.ih-public-media-image {
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

.ih-public-image-zoom {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  padding: 0.25rem;
  border: 1px solid var(--border-main);
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--bg-surface) 94%, transparent);
  box-shadow: var(--shadow-main);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.ih-public-image-zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.ih-public-image-zoom-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--bg-accent-soft) 65%, transparent);
}

.ih-public-image-zoom-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ih-public-image-zoom-btn--text {
  width: auto;
  padding: 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
}

.ih-public-image-zoom-label {
  min-width: 2.75rem;
  padding: 0 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .ih-public-image-zoom {
  background: color-mix(in srgb, var(--marketing-nav) 92%, transparent);
  border-color: rgba(255, 255, 255, 0.1);
}

.ih-public-media-footer {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: color-mix(in srgb, #ffffff 92%, var(--bg-accent-soft));
  border-top: 1px solid var(--border-main);
}

@media (min-width: 640px) {
  .ih-public-media-footer {
    align-items: center;
    padding: 0.5rem 1rem;
  }
}

html[data-theme="dark"] .ih-public-media-footer {
  background: var(--marketing-nav);
  border-top-color: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .ih-public-media-footer .text-zinc-500,
html[data-theme="dark"] .ih-public-media-footer .text-zinc-600 {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .ih-public-media-footer .text-zinc-700 {
  color: rgba(226, 232, 240, 0.95) !important;
}

.surface-card {
  background: color-mix(in srgb, var(--bg-surface) 86%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid color-mix(in srgb, var(--border-main) 50%, transparent);
  box-shadow: var(--shadow-main);
  border-radius: var(--radius-lg);
}

.surface-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  box-shadow: var(--shadow-main);
  border-radius: var(--radius-lg);
}

.surface-card,
.surface-panel,
.stat-card {
  position: relative;
  overflow: hidden;
}

.surface-card::before,
.surface-panel::before,
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.15), transparent 34%);
}

a.surface-panel,
a.surface-card,
.surface-panel.is-interactive,
.surface-card.is-interactive {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

a.surface-panel:hover,
a.surface-card:hover,
.surface-panel.is-interactive:hover,
.surface-card.is-interactive:hover {
  border-color: color-mix(in srgb, var(--brand-main) 28%, var(--border-main));
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 14px 36px rgba(15, 23, 42, 0.08);
}

.ih-soft-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-accent-soft);
  color: var(--brand-main);
}

.ih-pill {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  border-radius: 9999px;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  background: var(--bg-accent-soft);
  color: var(--brand-main);
}

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-ghost,
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border-radius: var(--radius-md);
  padding: 0.625rem 1rem;
  font-size: var(--text-sm);
  font-weight: 600;
  transition: transform 150ms ease, background-color 150ms ease, border-color 150ms ease, color 150ms ease, opacity 150ms ease;
  outline: none;
}

.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
}

.btn-primary {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%);
  color: #fff;
  border: 1px solid color-mix(in srgb, var(--brand-hover) 40%, #0f172a 18%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 10px 26px color-mix(in srgb, var(--brand-main) 30%, transparent);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 50%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 12px 30px color-mix(in srgb, var(--brand-main) 36%, transparent);
}

html[data-theme="dark"] .btn-primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand-main) 92%, #1e3a8a) 0%, color-mix(in srgb, var(--brand-main) 55%, #1e40af) 100%);
  border-color: color-mix(in srgb, var(--brand-hover) 45%, #0f172a);
}

html[data-theme="dark"] .btn-primary:hover {
  background: linear-gradient(180deg, var(--brand-hover) 0%, color-mix(in srgb, var(--brand-main) 70%, #1d4ed8) 100%);
}

.btn-secondary,
.btn-icon {
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  color: var(--text-main);
}

.btn-secondary:hover,
.btn-icon:hover {
  background: var(--bg-surface-soft);
  border-color: color-mix(in srgb, var(--brand-main) 25%, var(--border-main));
}

.btn-danger {
  background: linear-gradient(180deg, #f43f5e 0%, #e11d48 55%, #be123c 100%);
  color: #fff;
  border: 1px solid color-mix(in srgb, var(--danger-hover) 40%, #0f172a 18%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 10px 26px color-mix(in srgb, var(--danger) 28%, transparent);
}

.btn-danger:hover {
  background: linear-gradient(180deg, #fb7185 0%, #e11d48 50%, #9f1239 100%);
  transform: translateY(-1px);
}

html[data-theme="dark"] .btn-danger {
  background: linear-gradient(180deg, color-mix(in srgb, var(--danger) 90%, #9f1239) 0%, color-mix(in srgb, var(--danger) 55%, #881337) 100%);
  border-color: color-mix(in srgb, var(--danger) 45%, #0f172a);
}

.btn-ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--bg-surface-soft);
  color: var(--text-main);
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-danger:focus-visible,
.btn-ghost:focus-visible,
.btn-icon:focus-visible,
.field-input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 4px rgb(var(--ring));
}

:where(a, button, summary, [role="button"], [tabindex]:not([tabindex="-1"])):focus-visible {
  outline: 2px solid rgb(var(--ring));
  outline-offset: 2px;
}

:where(input, select, textarea):focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--brand-main) 45%, var(--border-main));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-main) 15%, transparent);
}

/* Semantic toasts (light + dark) */
.toast-item {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-main);
  box-shadow: var(--shadow-main);
  border-radius: var(--radius-lg);
}

.toast-item--info {
  background: color-mix(in srgb, var(--brand-main) 8%, var(--bg-surface));
  border-color: color-mix(in srgb, var(--brand-main) 22%, var(--border-main));
  color: var(--text-main);
}

.toast-item--success {
  background: color-mix(in srgb, var(--success) 10%, var(--bg-surface));
  border-color: color-mix(in srgb, var(--success) 28%, var(--border-main));
  color: var(--text-main);
}

.toast-item--warning {
  background: color-mix(in srgb, var(--warning) 12%, var(--bg-surface));
  border-color: color-mix(in srgb, var(--warning) 30%, var(--border-main));
  color: var(--text-main);
}

.toast-item--error {
  background: color-mix(in srgb, var(--danger) 10%, var(--bg-surface));
  border-color: color-mix(in srgb, var(--danger) 28%, var(--border-main));
  color: var(--text-main);
}

/* Shared application modal chrome */
.ih-app-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
}

.ih-app-modal-header,
.ih-app-modal-footer {
  border-color: var(--border-main);
  background: var(--bg-surface-soft);
}

.ih-source-switcher {
  border: 1px solid var(--border-main);
  background: var(--bg-surface);
}

.ih-source-tab {
  color: var(--text-muted);
  background: transparent;
  transition: color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.ih-source-tab:hover {
  color: var(--brand-main);
}

.ih-source-tab.is-active {
  color: #fff;
  background: var(--brand-main);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--brand-main) 24%, transparent);
}

.ih-upload-drop-zone {
  border-color: var(--border-main);
  background: var(--bg-surface-soft);
}

.ih-upload-drop-zone:hover,
.ih-upload-drop-zone.is-dragging {
  border-color: color-mix(in srgb, var(--brand-main) 45%, var(--border-main));
  background: var(--bg-accent-soft);
}

.ih-upload-drop-zone:hover svg,
.ih-upload-drop-zone:hover .ih-upload-drop-label {
  color: var(--brand-main);
}

.ih-upload-option {
  color: var(--text-main);
  border-color: var(--border-soft);
}

.ih-upload-option:hover,
.ih-nav-item:hover {
  background: var(--bg-surface-soft);
}

.ih-upload-option--create {
  color: var(--brand-main);
}

.ih-tax-opt--active {
  background: var(--bg-surface-soft);
}

.ih-nav-item.is-active,
.ih-view-chip--brand {
  background: var(--bg-accent-soft);
  color: var(--brand-main);
}

.ih-nav-item.is-active .ih-nav-item-label {
  color: var(--brand-main);
}

.ih-upload-preview {
  border-color: var(--border-main);
}

.ih-upload-preview thead {
  background: var(--bg-surface-soft);
}

.ih-upload-preview th,
.ih-upload-preview td {
  border-color: var(--border-soft);
}

.ih-upload-preview tbody tr:hover {
  background: var(--bg-accent-soft);
}

.ih-upload-summary--brand {
  border: 1px solid color-mix(in srgb, var(--brand-main) 22%, var(--border-main));
  background: var(--bg-accent-soft);
}

/* Compact auth flows: password recovery, verification, and status screens */
.ih-auth-compact-body {
  display: flex;
  flex: 1;
  min-height: 0;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 3rem;
}

.ih-auth-compact-card {
  width: 100%;
  max-width: 28rem;
  padding: 1.75rem;
  border: 1px solid var(--border-main);
  border-radius: 1.25rem;
  background: var(--bg-surface);
  box-shadow: var(--shadow-main);
}

.ih-auth-compact-title {
  margin: 0;
  color: var(--text-main);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.ih-auth-compact-copy {
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.65;
}

.ih-auth-compact-label {
  display: block;
  margin-bottom: 0.375rem;
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
}

.ih-auth-compact-divider {
  border-color: var(--border-soft);
}

.ih-auth-status-icon {
  display: flex;
  width: 3rem;
  height: 3rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
}

.ih-auth-status-icon--brand {
  color: var(--brand-main);
  background: var(--bg-accent-soft);
}

.ih-auth-status-icon--success {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, var(--bg-surface));
}

.ih-auth-status-icon--warning {
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 12%, var(--bg-surface));
}

.ih-auth-status-icon--neutral {
  color: var(--text-muted);
  background: var(--bg-surface-soft);
}

/* Shared empty states for list and explorer surfaces */
.ih-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 28rem;
  min-height: 13rem;
  margin: 0 auto;
  padding: 2rem 1.25rem;
  text-align: center;
}

.ih-empty-state-icon {
  display: flex;
  width: 3rem;
  height: 3rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.875rem;
  border: 1px solid color-mix(in srgb, var(--brand-main) 16%, var(--border-main));
  border-radius: var(--radius-lg);
  color: var(--brand-main);
  background: var(--bg-accent-soft);
}

.ih-empty-state-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.ih-empty-state-title {
  margin: 0;
  color: var(--text-main);
  font-size: var(--text-md);
  font-weight: 650;
}

.ih-empty-state-copy {
  margin: 0.375rem 0 0;
  color: var(--text-soft);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.ih-empty-state-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Navigation feedback for server-filtered lists */
.ih-list-is-loading {
  position: relative;
  cursor: progress;
}

.ih-list-is-loading::after {
  content: "";
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  width: 32%;
  height: 2px;
  border-radius: 999px;
  background: var(--brand-main);
  box-shadow: 0 0 10px color-mix(in srgb, var(--brand-main) 35%, transparent);
  animation: ih-list-progress 900ms ease-in-out infinite;
}

.ih-list-is-loading .ih-forms-table-wrap,
.ih-list-is-loading .ih-media-explorer-body {
  opacity: 0.55;
  transition: opacity 120ms ease;
}

.ih-list-is-loading :is(button, input, select, a) {
  pointer-events: none;
}

@keyframes ih-list-progress {
  from { transform: translateX(-100%); }
  to { transform: translateX(415%); }
}

@media (min-width: 640px) {
  .ih-auth-compact-card {
    padding: 2rem;
  }
}

.field-input {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-main);
  background: var(--bg-surface);
  padding: 0.625rem 0.875rem;
  font-size: var(--text-sm);
  color: var(--text-main);
}

.field-input::placeholder {
  color: var(--text-soft);
}

html[data-theme="dark"] select.field-input,
html[data-theme="dark"] input[type="date"].field-input,
html[data-theme="dark"] input[type="datetime-local"].field-input {
  color-scheme: dark;
}

html[data-theme="dark"] table thead th {
  color: var(--text-muted) !important;
}

html[data-theme="dark"] table tbody td {
  color: var(--text-main) !important;
}

html[data-theme="dark"] .theme-toggle-btn {
  background: color-mix(in srgb, var(--brand-main) 12%, transparent);
  border-color: color-mix(in srgb, var(--brand-main) 32%, var(--border-main));
  color: var(--brand-on-dark);
}

html[data-theme="dark"] .theme-toggle-btn:hover {
  background: color-mix(in srgb, var(--brand-main) 20%, transparent);
}

.ih-animate-rise {
  animation: ih-rise 220ms ease;
}

.ih-animate-fade {
  animation: ih-fade 220ms ease;
}

.ih-skeleton {
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--bg-surface-soft) 25%, color-mix(in srgb, var(--bg-surface-soft) 70%, #fff 30%) 37%, var(--bg-surface-soft) 63%);
  background-size: 400% 100%;
  animation: ih-shimmer 1.4s ease infinite;
}

.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.75;
}

.is-loading::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-top-color: rgba(255, 255, 255, 0.2);
  animation: ih-spin 700ms linear infinite;
}

.is-loading.btn-secondary::after,
.is-loading.btn-icon::after {
  border-color: color-mix(in srgb, var(--brand-main) 55%, transparent);
  border-top-color: color-mix(in srgb, var(--brand-main) 15%, transparent);
}

@keyframes ih-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ih-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes ih-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes ih-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* ── Stat Cards ──────────────────────────────────────────────────────────── */
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: box-shadow 200ms ease, transform 200ms ease;
}

.stat-card:hover {
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

.stat-card-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}

.stat-card-value {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-card-sub {
  font-size: 0.8125rem;
  color: var(--text-soft);
  margin-top: 0.25rem;
}

/* Team metrics support the member list instead of competing with it. */
.team-metrics .stat-card {
  min-height: 0;
  padding: 0.875rem;
  gap: 0.75rem;
  box-shadow: none;
  background: color-mix(in srgb, var(--bg-surface) 76%, transparent);
}

.team-metrics .stat-card:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border-main);
}

.team-metrics .stat-card-icon {
  width: 2.25rem;
  height: 2.25rem;
}

.team-metrics .stat-card-value {
  font-size: 1.375rem;
  font-weight: 700;
}

.team-metrics .stat-card-sub {
  margin-top: 0.125rem;
  font-size: 0.6875rem;
}

html[data-theme="dark"] .stat-card-icon.bg-indigo-50 {
  background: var(--bg-accent-soft) !important;
  color: var(--brand-on-dark) !important;
}

html[data-theme="dark"] .stat-card-icon.bg-violet-50 {
  background: rgba(139, 92, 246, 0.18) !important;
  color: #a78bfa !important;
}

html[data-theme="dark"] .stat-card-icon.bg-emerald-50 {
  background: rgba(16, 185, 129, 0.18) !important;
  color: #34d399 !important;
}

html[data-theme="dark"] .stat-card-icon.bg-amber-50 {
  background: rgba(245, 158, 11, 0.18) !important;
  color: #fbbf24 !important;
}

/* ── Data Table ──────────────────────────────────────────────────────────── */
.ih-table {
  border-collapse: collapse;
  width: 100%;
}

.ih-table thead tr {
  border-bottom: 1px solid var(--border-main);
}

.ih-table thead th {
  padding: 0.625rem 1.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  white-space: nowrap;
  background: var(--bg-surface-soft);
}

.ih-table tbody tr {
  border-bottom: 1px solid var(--border-soft);
  transition: background-color 120ms ease;
}

.ih-table tbody tr:nth-child(odd) {
  background: var(--bg-surface);
}

.ih-table tbody tr:nth-child(even) {
  background: var(--bg-surface-soft);
}

.ih-table tbody tr:last-child {
  border-bottom: none;
}

.ih-table tbody tr:hover {
  background: var(--bg-accent-soft) !important;
}

.ih-table tbody td {
  padding: 0.875rem 1.25rem;
  font-size: 0.875rem;
  color: var(--text-main);
  vertical-align: middle;
}

html[data-theme="dark"] .ih-table thead th {
  background: var(--bg-surface-soft) !important;
}

html[data-theme="dark"] .ih-table tbody tr:nth-child(odd) {
  background: var(--bg-surface) !important;
}

html[data-theme="dark"] .ih-table tbody tr:nth-child(even) {
  background: var(--bg-surface-soft) !important;
}

/* ── Badges ──────────────────────────────────────────────────────────────── */
.ih-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.1875rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.ih-badge-blue {
  background: var(--bg-accent-soft);
  color: var(--brand-hover);
}

.ih-badge-green {
  background: #f0fdf4;
  color: #15803d;
}

.ih-badge-violet {
  background: #f5f3ff;
  color: #6d28d9;
}

.ih-badge-admin {
  background: color-mix(in srgb, var(--brand-main) 12%, var(--bg-surface));
  color: var(--brand-hover);
}

.ih-badge-manager {
  background: #fef3c7;
  color: #92400e;
}

.ih-badge-viewer {
  background: #f1f5f9;
  color: #475569;
}

.ih-badge-user {
  background: #d1fae5;
  color: #065f46;
}

html[data-theme="dark"] .ih-badge-blue {
  background: color-mix(in srgb, var(--brand-main) 18%, transparent);
  color: var(--brand-on-dark);
}

html[data-theme="dark"] .ih-badge-green {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

html[data-theme="dark"] .ih-badge-violet {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
}

html[data-theme="dark"] .ih-badge-admin {
  background: color-mix(in srgb, var(--brand-main) 20%, transparent);
  color: var(--brand-on-dark);
}

html[data-theme="dark"] .ih-badge-manager {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}

html[data-theme="dark"] .ih-badge-viewer {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}

html[data-theme="dark"] .ih-badge-user {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.ih-badge-slate {
  background: color-mix(in srgb, var(--bg-surface-soft) 90%, var(--border-main));
  color: var(--text-muted);
  border: 1px solid var(--border-soft);
}

html[data-theme="dark"] .ih-badge-slate {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.22);
}

/* ── Dashboard (home) — enterprise panels & chart ─────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.stat-card-icon.ih-stat-icon {
  border-radius: var(--radius-md);
}

.stat-card-icon.ih-stat-icon--brand {
  background: color-mix(in srgb, var(--brand-main) 12%, var(--bg-surface-soft));
  color: var(--brand-main);
}

.stat-card-icon.ih-stat-icon--slate {
  background: color-mix(in srgb, var(--text-muted) 10%, var(--bg-surface-soft));
  color: var(--text-muted);
}

.stat-card-icon.ih-stat-icon--teal {
  background: color-mix(in srgb, #0d9488 14%, var(--bg-surface-soft));
  color: #0f766e;
}

.stat-card-icon.ih-stat-icon--amber {
  background: color-mix(in srgb, #d97706 14%, var(--bg-surface-soft));
  color: #b45309;
}

html[data-theme="dark"] .stat-card-icon.ih-stat-icon--teal {
  background: rgba(45, 212, 191, 0.12);
  color: #5eead4;
}

html[data-theme="dark"] .stat-card-icon.ih-stat-icon--amber {
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
}

.ih-dashboard-kicker {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 0.35rem;
}

.ih-dashboard-sub {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 42rem;
}

.ih-dashboard-cmdk {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem 0.35rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-main);
  background: var(--bg-surface);
  min-width: min(100%, 16rem);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.ih-dashboard-cmdk-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--text-soft);
}

.ih-dashboard-cmdk-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 0.8125rem;
  color: var(--text-main);
  outline: none;
}

.ih-dashboard-cmdk-input::placeholder {
  color: var(--text-soft);
}

.ih-kbd-group {
  display: flex;
  gap: 0.2rem;
  flex-shrink: 0;
}

.ih-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  padding: 0.1rem 0.35rem;
  border-radius: 0.3rem;
  border: 1px solid var(--border-main);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-soft);
  background: var(--bg-surface-soft);
}

.ih-dashboard-bell {
  color: var(--text-muted);
}

.ih-segmented {
  display: inline-flex;
  padding: 0.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-main);
  background: var(--bg-surface-soft);
  gap: 0.15rem;
}

.ih-segmented-trigger {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: calc(var(--radius-md) - 2px);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.ih-segmented-trigger:hover {
  color: var(--text-main);
}

.ih-segmented-trigger[aria-selected="true"] {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

html[data-theme="dark"] .ih-segmented-trigger[aria-selected="true"] {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.ih-dash-panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-main);
  background: var(--bg-surface);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.ih-dash-panel--side {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ih-dash-panel-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--bg-surface-soft) 55%, var(--bg-surface));
}

.ih-dash-panel-header--row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.ih-dash-panel-title {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.ih-dash-panel-meta {
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-top: 0.2rem;
}

.ih-dash-select {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
  background: var(--bg-surface);
}

.ih-dash-panel-body {
  padding: 1rem 1.25rem 1.25rem;
}

.ih-dash-panel-body--tight {
  padding-top: 0.75rem;
}

.ih-dash-panel-body--activity {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.ih-dash-activity {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.625rem;
  min-height: 0;
}

.ih-dash-activity-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 17.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text-soft) 35%, transparent) transparent;
}

.ih-dash-activity-scroll::-webkit-scrollbar {
  width: 6px;
}

.ih-dash-activity-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-soft) 35%, transparent);
}

.ih-dash-activity-pagination {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border-soft);
}

.ih-dash-activity-pagination .ih-list-pagination-info {
  font-size: 0.6875rem;
}

.ih-dash-activity-pagination .ih-list-pagination-controls {
  gap: 0.35rem;
}

.ih-dash-activity-pagination .ih-list-pagination-btn {
  padding: 0.25rem 0.45rem;
  font-size: 0.6875rem;
}

.ih-dash-activity-pagination .ih-list-pagination-size-label,
.ih-dash-activity-pagination .ih-list-pagination-size-select {
  font-size: 0.6875rem;
}

.ih-dash-activity-pagination .ih-list-pagination-indicator {
  font-size: 0.6875rem;
  min-width: 4.5rem;
}

.ih-chart-wrap {
  position: relative;
  width: 100%;
  min-height: 220px;
  max-height: 280px;
}

.ih-chart-wrap canvas {
  max-height: 280px;
}

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

.ih-activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-soft);
}

.ih-activity-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.ih-activity-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ih-activity-icon--brand {
  background: color-mix(in srgb, var(--brand-main) 12%, var(--bg-surface-soft));
  color: var(--brand-main);
}

.ih-activity-icon--teal {
  background: color-mix(in srgb, #0d9488 12%, var(--bg-surface-soft));
  color: #0f766e;
}

html[data-theme="dark"] .ih-activity-icon--teal {
  background: rgba(45, 212, 191, 0.12);
  color: #5eead4;
}

.ih-activity-body {
  flex: 1;
  min-width: 0;
}

.ih-activity-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
}

.ih-activity-desc {
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-top: 0.15rem;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.ih-activity-time {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-soft);
  white-space: nowrap;
  padding-top: 0.15rem;
}

.ih-dash-panel-hint {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-soft);
}

.ih-activity-delete {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-top: 0.1rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}

.ih-activity-delete:hover:not(:disabled) {
  color: #dc2626;
  background: #fef2f2;
  border-color: #fecaca;
}

.ih-activity-delete:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

html[data-theme="dark"] .ih-activity-delete:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.35);
}

.ih-dash-link-stack {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  background: var(--bg-surface-soft);
  overflow: hidden;
}

.ih-dash-link-stack-body {
  padding: 0.75rem 0.85rem;
  text-decoration: none;
  color: inherit;
  transition: background-color 140ms ease;
}

.ih-dash-link-stack-body:hover {
  background: color-mix(in srgb, var(--bg-surface) 70%, transparent);
}

.ih-dash-link-stack-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem 0.65rem 0.65rem;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-surface);
}

.ih-dash-card-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
}

.ih-dash-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-main);
  background: var(--bg-surface-soft);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 160ms ease, border-color 160ms ease;
}

.ih-dash-card:hover {
  border-color: color-mix(in srgb, var(--brand-main) 28%, var(--border-main));
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.ih-dash-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--brand-main) 10%, var(--bg-surface-soft));
  color: var(--brand-main);
  flex-shrink: 0;
}

.ih-dash-card-text {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.ih-dash-card-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-soft);
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}

.ih-link-collection {
  color: var(--brand-main);
}

.ih-link-collection:hover {
  color: var(--brand-hover);
}

.ih-upload-sheet-pill {
  background: color-mix(in srgb, var(--brand-main) 8%, var(--bg-surface-soft));
  color: var(--brand-main);
  border: 1px solid color-mix(in srgb, var(--brand-main) 18%, var(--border-main));
}

html[data-theme="dark"] .ih-upload-sheet-pill {
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.28);
}

/* ── Sidebar nav links & buttons ─────────────────────────────────────────── */
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background-color 140ms ease, color 140ms ease;
  text-decoration: none;
  width: 100%;
  box-sizing: border-box;
}

.nav-link:hover {
  background: var(--bg-surface-soft);
  color: var(--text-main);
}

.nav-link.active {
  background: color-mix(in srgb, var(--brand-main) 10%, transparent);
  color: var(--brand-main);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--brand-main);
}

/* Reset browser button defaults so button.nav-link renders like a.nav-link */
button.nav-link {
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  line-height: inherit;
  -webkit-appearance: none;
  appearance: none;
}

button.nav-link:hover {
  background: var(--bg-surface-soft);
  color: var(--text-main);
}

/* Sign-out specific red hover */
.nav-link-danger:hover {
  background: #fff1f2;
  color: #e11d48 !important;
}

html[data-theme="dark"] .nav-link-danger:hover {
  background: rgba(225, 29, 72, 0.12) !important;
  color: #fda4af !important;
}

html[data-theme="dark"] .nav-link.active {
  background: rgba(96, 165, 250, 0.2) !important;
  color: #bfdbfe !important;
}

html[data-theme="dark"] .nav-link:hover,
html[data-theme="dark"] button.nav-link:hover {
  background: var(--bg-surface-soft) !important;
  color: var(--text-main) !important;
}

/* ── Insights banner gradient ────────────────────────────────────────────── */
html[data-theme="dark"] .insights-banner {
  background: color-mix(in srgb, var(--brand-main) 10%, var(--bg-surface)) !important;
  border-color: color-mix(in srgb, var(--brand-main) 28%, var(--border-main)) !important;
}

html[data-theme="dark"] .insights-banner .text-indigo-900 {
  color: var(--text-main) !important;
}

html[data-theme="dark"] .insights-banner .text-indigo-700 {
  color: var(--brand-on-dark) !important;
}

html[data-theme="dark"] .insights-banner .text-indigo-500 {
  color: var(--brand-main) !important;
}

html[data-theme="dark"] .insights-banner .text-indigo-600 {
  color: var(--brand-on-dark) !important;
}

/* ── Mobile / Responsive utilities ──────────────────────────────────────── */

:root {
  --sidebar-width: 18rem;
  --sidebar-width-collapsed: 4.25rem;
}

.app-shell-main {
  padding-left: 0;
  transition: padding-left 300ms ease;
}

@media (min-width: 768px) {
  .app-shell-main {
    padding-left: var(--sidebar-width);
  }

  html.sidebar-collapsed .app-shell-main {
    padding-left: var(--sidebar-width-collapsed);
  }
}

/* Sidebar — flat enterprise rail */
#sidebar.sidebar-panel {
  width: var(--sidebar-width);
  will-change: transform, width;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-main);
  box-shadow: 4px 0 32px rgba(15, 23, 42, 0.045);
}

@media (min-width: 768px) {
  html.sidebar-collapsed #sidebar.sidebar-panel {
    width: var(--sidebar-width-collapsed);
    max-width: var(--sidebar-width-collapsed);
  }
}

html[data-theme="dark"] #sidebar .sidebar-rail-btn.is-active {
  background: color-mix(in srgb, var(--brand-main) 18%, transparent);
  color: var(--brand-on-dark);
}

html[data-theme="dark"] #sidebar.sidebar-panel {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-main);
  box-shadow: 4px 0 28px rgba(0, 0, 0, 0.35);
}

#sidebar .sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
  padding: 0.875rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border-soft);
}

#sidebar .sidebar-collapse-btn {
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-main);
  background: var(--bg-surface-soft);
  color: var(--text-muted);
}

#sidebar .sidebar-collapse-btn:hover {
  color: var(--text-main);
  border-color: color-mix(in srgb, var(--brand-main) 25%, var(--border-main));
  background: var(--bg-surface);
}

#sidebar .sidebar-rail {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 0.5rem 1rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

#sidebar .sidebar-rail-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  transition:
    background-color 140ms ease,
    color 140ms ease,
    border-color 140ms ease;
}

#sidebar .sidebar-rail-badge,
#sidebar .sidebar-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 9999px;
  background: var(--brand-main, #2563eb);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
}

#sidebar .sidebar-rail-badge {
  position: absolute;
  top: 0.15rem;
  right: 0.1rem;
}

#sidebar .sidebar-nav-item {
  position: relative;
}

#sidebar .sidebar-nav-badge {
  margin-left: auto;
}

#sidebar .sidebar-rail-btn:hover {
  background: var(--bg-surface-soft);
  color: var(--text-main);
  border-color: var(--border-soft);
}

#sidebar .sidebar-rail-btn.is-active {
  background: color-mix(in srgb, var(--brand-main) 14%, transparent);
  color: var(--brand-main);
  border-color: color-mix(in srgb, var(--brand-main) 24%, transparent);
}

#sidebar .sidebar-panel-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  justify-content: flex-start;
}

#sidebar .sidebar-pinned-panel {
  margin-top: 1.75rem;
}

@media (min-width: 768px) {
  html.sidebar-collapsed #sidebar .sidebar-panel-body {
    display: none;
  }

  html.sidebar-collapsed #sidebar .sidebar-rail {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
  }

  html.sidebar-collapsed #sidebar .sidebar-brand-copy {
    display: none;
  }

  html.sidebar-collapsed #sidebar .sidebar-brand-row {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    padding: 0.625rem 0.35rem 0.5rem;
  }

  html.sidebar-collapsed #sidebar .sidebar-brand-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: auto;
    flex: 0 0 auto;
    min-width: 0;
  }

  html.sidebar-collapsed #sidebar .sidebar-brand-link .workspace-brand-mark,
  html.sidebar-collapsed #sidebar .sidebar-brand-link .ih-brand-mark {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-md);
  }

  html.sidebar-collapsed #sidebar .sidebar-brand-actions {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 100%;
  }

  html.sidebar-collapsed #sidebar .sidebar-brand-actions .sidebar-collapse-btn {
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    border-color: var(--border-soft);
    background: transparent;
  }

  html.sidebar-collapsed #sidebar .sidebar-brand-actions .sidebar-collapse-btn:hover {
    background: var(--bg-surface-soft);
    border-color: var(--border-main);
    color: var(--text-main);
  }

  html.sidebar-collapsed #sidebar .sidebar-rail {
    padding-top: 0.35rem;
    border-top: 1px solid var(--border-soft);
  }
}

#sidebar .sidebar-section-host {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#sidebar .sidebar-section-host--grow {
  flex: 1 1 0%;
}

#sidebar .sidebar-section-host--grow.is-collapsed {
  flex: 0 1 auto;
}

#sidebar .sidebar-section-host--grow > .sidebar-section-body:not(.hidden) {
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#sidebar .sidebar-section-body:not(.hidden) {
  min-width: 0;
}

#sidebar .sidebar-section-label {
  display: block;
  padding: 0 0.25rem;
  margin-bottom: 0.4rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
}

#sidebar .sidebar-section-label--nested {
  margin-bottom: 0.35rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

#sidebar .sidebar-nav-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-main);
  background: var(--bg-surface-soft);
  padding: 3px;
}

#sidebar .sidebar-search {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-main);
  background: var(--bg-surface);
  padding: 0.45rem 0.65rem 0.45rem 2.25rem;
  font-size: 0.75rem;
  color: var(--text-main);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
  outline: none;
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}

#sidebar .sidebar-search::placeholder {
  color: var(--text-soft);
}

#sidebar .sidebar-search:focus-visible {
  border-color: color-mix(in srgb, var(--brand-main) 35%, var(--border-main));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-main) 18%, transparent);
}

#sidebar .sidebar-collections-heading {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0.2rem 0.15rem;
  text-align: left;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

#sidebar .sidebar-collections-heading:hover {
  color: var(--text-muted);
}

#sidebar .sidebar-collections-heading span:last-child {
  display: flex;
  height: 1.65rem;
  width: 1.65rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-main);
  background: var(--bg-surface);
  color: var(--text-soft);
}

/* Sidebar: primary rows — icon in soft tile, clearer active state */
#sidebar .sidebar-nav-card .nav-link {
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 0.7rem;
}

#sidebar .sidebar-nav-card .nav-link svg {
  padding: 0.35rem;
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--bg-surface-soft) 88%, var(--border-soft));
  color: var(--text-soft);
  transition: background-color 140ms ease, color 140ms ease;
}

#sidebar .sidebar-nav-card .nav-link:hover svg {
  background: color-mix(in srgb, var(--bg-accent-soft) 55%, var(--bg-surface-soft));
  color: var(--text-main);
}

#sidebar .sidebar-nav-card .nav-link.active {
  background: color-mix(in srgb, var(--brand-main) 14%, transparent);
  color: var(--brand-main);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-main) 22%, transparent);
}

#sidebar .sidebar-nav-card .nav-link.active svg {
  background: color-mix(in srgb, var(--brand-main) 18%, transparent);
  color: var(--brand-main);
}

#sidebar .sidebar-nav-count {
  flex-shrink: 0;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--bg-surface) 88%, var(--border-soft));
  border: 1px solid var(--border-soft);
}

#sidebar .sidebar-pinned-empty {
  margin-top: 0.5rem;
  padding: 0.55rem 0.35rem;
  font-size: 0.6875rem;
  line-height: 1.45;
  text-align: center;
  color: var(--text-soft);
}

#sidebar .sidebar-pinned-empty.hidden {
  display: none;
}

#sidebar .sidebar-pinned-link {
  font-size: 0.75rem;
}

/* ── Sidebar flat primary nav + pinned panel ───────────────────────────────── */
#sidebar .sidebar-primary-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

#sidebar .sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

#sidebar .sidebar-nav-item:hover {
  background: var(--bg-surface-soft);
  color: var(--text-main);
}

#sidebar .sidebar-nav-item.is-active {
  background: color-mix(in srgb, var(--brand-main) 10%, transparent);
  color: var(--brand-main);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--brand-main);
}

#sidebar .sidebar-nav-item-icon {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}

html.sidebar-collapsed #sidebar .sidebar-primary-nav,
html.sidebar-collapsed #sidebar .sidebar-pinned-panel {
  display: none;
}

#sidebar .sidebar-pinned-search-wrap {
  position: relative;
}

#sidebar .sidebar-pinned-search-icon {
  pointer-events: none;
  position: absolute;
  left: 0.65rem;
  top: 50%;
  width: 0.875rem;
  height: 0.875rem;
  transform: translateY(-50%);
  color: var(--text-soft);
}

#sidebar .sidebar-pinned-search-input {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-main);
  background: var(--bg-surface);
  padding: 0.45rem 0.65rem 0.45rem 2rem;
  font-size: 0.6875rem;
  outline: none;
}

#sidebar .sidebar-pinned-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-main);
  background: var(--bg-surface);
  overflow: hidden;
}

#sidebar .sidebar-pinned-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-surface-soft);
}

#sidebar .sidebar-pinned-card-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

#sidebar .sidebar-pinned-count-badge {
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  font-size: 0.5625rem;
  font-weight: 700;
  color: var(--brand-main);
  background: color-mix(in srgb, var(--brand-main) 12%, transparent);
}

#sidebar .sidebar-pinned-sort-select {
  border: none;
  background: transparent;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  outline: none;
}

#sidebar .sidebar-pinned-preview {
  max-height: 11rem;
  overflow-y: auto;
}

#sidebar .sidebar-pinned-preview.hidden,
#sidebar .sidebar-pinned-empty-msg.hidden {
  display: none;
}

#sidebar .sidebar-pinned-empty-msg {
  padding: 0.75rem 0.65rem;
  font-size: 0.6875rem;
  text-align: center;
  color: var(--text-soft);
}

#sidebar .sidebar-pinned-view-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: 100%;
  padding: 0.55rem;
  border-top: 1px solid var(--border-soft);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--brand-main);
  text-decoration: none;
}

.ih-pinned-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border-soft);
}

.ih-pinned-row-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.ih-pinned-row:last-child {
  border-bottom: none;
}

.ih-pinned-row:hover {
  background: var(--bg-surface-soft);
}

.ih-pinned-row.is-active {
  background: color-mix(in srgb, var(--brand-main) 8%, transparent);
}

.ih-pinned-row-pin {
  color: var(--brand-main);
  flex-shrink: 0;
}

.ih-pinned-row-text {
  flex: 1;
  min-width: 0;
}

.ih-pinned-row-title {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
}

.ih-pinned-row-meta {
  display: block;
  font-size: 0.625rem;
  color: var(--text-soft);
}

.ih-pinned-row-count {
  flex-shrink: 0;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--brand-main);
  background: color-mix(in srgb, var(--brand-main) 10%, transparent);
}

.ih-pinned-row-menu {
  position: relative;
  flex-shrink: 0;
}

.ih-pinned-row-menu-panel {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 30;
  min-width: 9rem;
  padding: 0.3rem;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

.ih-pinned-row-menu-item {
  display: block;
  width: 100%;
  padding: 0.45rem 0.55rem;
  font-size: 0.75rem;
  text-align: left;
  color: var(--text-main);
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
}

.ih-pinned-modal-list {
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.ih-pinned-page-grid {
  margin-bottom: 1.5rem;
}

.ih-pinned-page-grid.hidden {
  display: none;
}

.ih-pinned-page-meta {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  color: var(--text-soft);
}

.ih-pinned-page-meta.hidden,
.ih-pinned-page-controls.hidden {
  display: none;
}

.ih-pinned-page-controls {
  margin-bottom: 0.75rem;
}

.ih-pinned-modal-controls {
  margin-bottom: 1rem;
}

.ih-pinned-modal-controls .ih-collections-search-wrap {
  flex: 1 1 200px;
}

.ih-pinned-page-no-results {
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-soft);
  border: 1px dashed var(--border-main);
  border-radius: var(--radius-lg);
}

.ih-pinned-page-no-results.hidden {
  display: none;
}

.ih-pinned-page-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--brand-main) 12%, transparent);
  color: var(--brand-main);
}

.ih-pinned-page-empty-icon svg {
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
}

.ih-pinned-page-empty-title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-main);
}

.ih-pinned-page-empty-text {
  margin: 0 auto 1.25rem;
  max-width: 28rem;
  font-size: 0.875rem;
  color: var(--text-soft);
}

.ih-pinned-page-lead {
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-soft);
}

.ih-pinned-page-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  border: 1px dashed var(--border-main);
  border-radius: var(--radius-lg);
}

.ih-pinned-page-empty.hidden {
  display: none;
}

#sidebar .ih-collection-pin-btn,
.ih-collection-pin-btn {
  color: var(--text-soft);
}

#sidebar .ih-collection-pin-btn.is-pinned,
.ih-collection-pin-btn.is-pinned,
[data-nav-pin-toggle].is-pinned {
  color: #f59e0b;
}

html[data-theme="dark"] #sidebar .sidebar-nav-card .nav-link.active {
  background: color-mix(in srgb, var(--brand-main) 16%, transparent) !important;
  color: var(--brand-main) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-main) 32%, transparent);
}

html[data-theme="dark"] #sidebar .sidebar-nav-card .nav-link.active svg {
  background: color-mix(in srgb, var(--brand-main) 22%, transparent);
  color: var(--brand-on-dark);
}

/* Collection tree — scroll + hierarchy */
#sidebar .sidebar-col-scroll {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text-soft) 35%, transparent) transparent;
}

#sidebar .sidebar-col-scroll::-webkit-scrollbar {
  width: 6px;
}

#sidebar .sidebar-col-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text-soft) 40%, transparent);
  border-radius: 999px;
}

#sidebar .sidebar-cat-group {
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--border-main) 70%, var(--border-soft));
  background: color-mix(in srgb, var(--bg-surface-soft) 80%, var(--bg-surface));
}

#sidebar .sidebar-cat-toggle > span:first-of-type {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-main);
}

#sidebar .sidebar-subcat-group {
  border-left: 3px solid color-mix(in srgb, var(--brand-main) 35%, var(--border-main));
  padding-left: 0.55rem;
  margin-left: 0.35rem;
  margin-top: 0.15rem;
  border-radius: 0;
  border-top: none;
  border-right: none;
  border-bottom: none;
  background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
}

#sidebar .sidebar-subcat-toggle > span:first-of-type {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--text-muted);
}

#sidebar .sidebar-tree-toggle {
  border-radius: 0.45rem;
  padding: 0.35rem 0.4rem;
  transition: background-color 140ms ease, color 140ms ease;
}

#sidebar .sidebar-tree-toggle:hover {
  background: color-mix(in srgb, var(--bg-surface) 70%, var(--border-soft));
}

#sidebar a.nav-link[data-col] {
  font-size: 0.75rem;
  padding: 0.4rem 0.45rem;
  margin-left: 0;
  border-radius: 0.5rem;
}

#sidebar a.nav-link[data-col].active {
  background: color-mix(in srgb, var(--brand-main) 12%, transparent);
  color: var(--brand-main);
  font-weight: 600;
}

/* Prevent body scroll when mobile sidebar is open */
body.sidebar-open {
  overflow: hidden;
}

/* Make tables horizontally scrollable on small screens with a subtle hint */
.ih-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* On very small screens, give stat-card values slightly smaller font */
@media (max-width: 480px) {
  .stat-card-value {
    font-size: 1.5rem;
  }

  .stat-card {
    padding: 1rem;
    gap: 0.75rem;
  }

  .stat-card-icon {
    width: 2.25rem;
    height: 2.25rem;
  }

  /* Tighten modal to full-width on mobile */
  .ih-modal {
    max-width: calc(100vw - 2rem) !important;
  }

  /* Make btn-primary full-width in empty states on mobile */
  .mobile-full-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Ensure role picker cards in the invite modal stack on very narrow modals */
@media (max-width: 400px) {
  #role-picker {
    grid-template-columns: 1fr !important;
  }
}

/* Sidebar overlay transition */
#sidebar-overlay {
  transition: opacity 300ms ease;
}

#sidebar-overlay.hidden {
  display: none;
}

/* Sidebar controls — btn-icon display must not override Tailwind hidden/md:hidden */
.btn-icon.hidden,
.hidden.btn-icon {
  display: none !important;
}

@media (max-width: 767.98px) {
  #sidebar .sidebar-collapse-btn {
    display: none !important;
  }
}

@media (min-width: 768px) {
  #sidebar-toggle {
    display: none !important;
  }

  #sidebar .sidebar-collapse-btn {
    display: inline-flex !important;
  }
}

/* Active state for sidebar toggle button */
#sidebar-toggle[aria-expanded="true"] {
  background: color-mix(in srgb, var(--brand-main) 12%, var(--bg-surface-soft));
  color: var(--brand-main);
  border-color: color-mix(in srgb, var(--brand-main) 25%, var(--border-main));
}

html[data-theme="dark"] #sidebar-toggle[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}

/* ── Marketing landing page ─────────────────────────────────────────────── */
:root {
  --landing-hero-bg: #f4f7fb;
  --landing-nav-bg: rgba(255, 255, 255, 0.82);
  --landing-nav-border: rgba(226, 232, 240, 0.9);
  --landing-nav-link: #64748b;
  --landing-nav-link-hover: #0f172a;
  --landing-hero-title: #0f172a;
  --landing-hero-sub: #64748b;
  --landing-badge-bg: #eff6ff;
  --landing-badge-border: #bfdbfe;
  --landing-badge-text: #2563eb;
  --landing-accent: #2563eb;
  --landing-secondary-btn-bg: #ffffff;
  --landing-secondary-btn-border: #e2e8f0;
  --landing-secondary-btn-text: #334155;
  --landing-trust-icon: #94a3b8;
  --landing-trust-text: #64748b;
  --landing-trust-label: #94a3b8;
  --landing-trust-logo: #cbd5e1;
  --landing-geo-line: color-mix(in srgb, var(--landing-accent) 14%, transparent);
  --landing-geo-ring: color-mix(in srgb, var(--landing-accent) 18%, transparent);
  --landing-geo-shape: color-mix(in srgb, var(--landing-accent) 10%, transparent);
}

html[data-theme="dark"] {
  --landing-hero-bg: #020617;
  --landing-nav-bg: rgba(2, 6, 23, 0.82);
  --landing-nav-border: rgba(255, 255, 255, 0.06);
  --landing-nav-link: #94a3b8;
  --landing-nav-link-hover: #f8fafc;
  --landing-hero-title: #f8fafc;
  --landing-hero-sub: #94a3b8;
  --landing-badge-bg: rgba(37, 99, 235, 0.12);
  --landing-badge-border: rgba(59, 130, 246, 0.28);
  --landing-badge-text: #93c5fd;
  --landing-accent: #3b82f6;
  --landing-secondary-btn-bg: transparent;
  --landing-secondary-btn-border: rgba(59, 130, 246, 0.45);
  --landing-secondary-btn-text: #e2e8f0;
  --landing-trust-icon: #60a5fa;
  --landing-trust-text: #94a3b8;
  --landing-trust-label: #64748b;
  --landing-trust-logo: #475569;
  --landing-geo-line: rgba(96, 165, 250, 0.12);
  --landing-geo-ring: rgba(59, 130, 246, 0.2);
  --landing-geo-shape: rgba(59, 130, 246, 0.14);
}

body:has(.ih-landing-page) .app-bg-glow {
  display: none;
}

.ih-marketing-dark {
  background: var(--landing-hero-bg);
  color: var(--landing-hero-title);
}

.ih-marketing-band {
  background: var(--marketing-band);
}

.ih-landing-section.ih-marketing-band {
  background:
    radial-gradient(800px 380px at 92% 8%, color-mix(in srgb, var(--landing-accent) 9%, transparent), transparent 55%),
    radial-gradient(640px 320px at 4% 92%, color-mix(in srgb, #a78bfa 7%, transparent), transparent 52%),
    var(--marketing-band);
}

html[data-theme="dark"] .ih-landing-section.ih-marketing-band {
  background:
    radial-gradient(800px 380px at 92% 8%, rgba(37, 99, 235, 0.14), transparent 55%),
    radial-gradient(640px 320px at 4% 92%, rgba(14, 165, 233, 0.08), transparent 52%),
    var(--marketing-band);
}

.ih-landing-nav {
  border-bottom: 1px solid var(--landing-nav-border);
  background: var(--landing-nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.ih-landing-nav .ih-landing-brand-text {
  color: var(--landing-hero-title);
}

.ih-landing-nav .ih-landing-nav-link {
  color: var(--landing-nav-link);
}

.ih-landing-nav .ih-landing-nav-link:hover {
  color: var(--landing-nav-link-hover);
}

.ih-landing-nav .ih-landing-signin {
  color: var(--landing-nav-link);
}

.ih-landing-nav .ih-landing-signin:hover {
  color: var(--landing-nav-link-hover);
}

.ih-landing-theme {
  display: inline-flex;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid var(--landing-nav-border);
  background: color-mix(in srgb, var(--landing-nav-bg) 70%, var(--bg-surface-soft));
  gap: 0.1rem;
}

.ih-landing-theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: transparent;
  color: var(--landing-nav-link);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.ih-landing-theme-btn:hover {
  color: var(--landing-nav-link-hover);
}

.ih-landing-theme-btn[aria-selected="true"] {
  background: color-mix(in srgb, var(--landing-accent) 16%, var(--bg-surface));
  color: var(--landing-hero-title);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] .ih-landing-theme-btn[aria-selected="true"] {
  background: rgba(59, 130, 246, 0.22);
  color: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.35);
}

.ih-landing-primary-btn {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 10px 28px rgba(37, 99, 235, 0.35);
}

.ih-landing-primary-btn:hover {
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 12px 32px rgba(37, 99, 235, 0.42);
}

.ih-landing-hero {
  background:
    radial-gradient(900px 420px at 8% -10%, color-mix(in srgb, var(--landing-accent) 10%, transparent), transparent 58%),
    radial-gradient(700px 360px at 95% 8%, color-mix(in srgb, #a78bfa 8%, transparent), transparent 55%),
    var(--landing-hero-bg);
}

html[data-theme="dark"] .ih-landing-hero {
  background:
    radial-gradient(900px 420px at 12% -8%, rgba(37, 99, 235, 0.2), transparent 58%),
    radial-gradient(600px 320px at 88% 20%, rgba(14, 165, 233, 0.12), transparent 60%),
    var(--landing-hero-bg);
}

/* Shared geometric background layers (hero + content sections) */
.ih-landing-section-patterns,
.ih-landing-hero-patterns {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.ih-landing-section {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.ih-landing-section--steps {
  background: var(--bg-surface);
}

html[data-theme="dark"] .ih-landing-section--steps {
  background: var(--marketing-band);
}

/* Slightly softer patterns on content sections */
.ih-landing-section-patterns:not([data-geo="hero"]) {
  opacity: 0.82;
}

.ih-landing-section-patterns:not([data-geo="hero"]) .ih-landing-geo--mesh {
  opacity: 0.28;
}

.ih-landing-section-patterns:not([data-geo="hero"]) .ih-landing-geo--diamonds {
  opacity: 0.16;
}

.ih-landing-section-patterns:not([data-geo="hero"]) .ih-landing-geo--rings::before,
.ih-landing-section-patterns:not([data-geo="hero"]) .ih-landing-geo--rings::after {
  opacity: 0.5;
}

.ih-landing-geo {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ih-landing-geo-grid,
.ih-landing-hero-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--landing-geo-line) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.55;
  mask-image: radial-gradient(ellipse 75% 65% at 68% 42%, black 15%, transparent 70%);
}

html[data-theme="dark"] .ih-landing-geo-grid,
html[data-theme="dark"] .ih-landing-hero-grid {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  opacity: 0.7;
}

/* Features — grid focused center, rings top-left + waves bottom-right */
[data-geo="features"] .ih-landing-geo-grid {
  mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, black 12%, transparent 72%);
}

[data-geo="features"] .ih-landing-geo--mesh {
  mask-image: radial-gradient(ellipse 85% 75% at 50% 50%, black 8%, transparent 78%);
}

[data-geo="features"] .ih-landing-geo--rings::before {
  top: -22%;
  right: auto;
  left: -14%;
}

[data-geo="features"] .ih-landing-geo--rings::after {
  bottom: -8%;
  left: auto;
  right: -8%;
}

[data-geo="features"] .ih-landing-geo--waves {
  left: auto;
  right: 0;
  background-position: right bottom;
  transform: scaleX(-1);
  mask-image: linear-gradient(225deg, black 18%, transparent 70%);
}

/* How it works — rings on right, waves bottom-left */
[data-geo="steps"] .ih-landing-geo-grid {
  mask-image: radial-gradient(ellipse 75% 65% at 35% 50%, black 10%, transparent 74%);
}

[data-geo="steps"] .ih-landing-geo--mesh {
  mask-image: radial-gradient(ellipse 90% 80% at 60% 40%, black 6%, transparent 80%);
}

[data-geo="steps"] .ih-landing-geo--rings::before {
  top: -15%;
  right: -14%;
  left: auto;
}

[data-geo="steps"] .ih-landing-geo--rings::after {
  bottom: 5%;
  left: -10%;
  right: auto;
}

[data-geo="steps"] .ih-landing-geo--waves {
  left: 0;
  right: auto;
  mask-image: linear-gradient(135deg, black 15%, transparent 68%);
}

/* Roles — mirrored layout, diamonds more visible */
[data-geo="roles"] .ih-landing-geo-grid {
  mask-image: radial-gradient(ellipse 78% 68% at 55% 55%, black 10%, transparent 75%);
}

[data-geo="roles"] .ih-landing-geo--mesh {
  mask-image: radial-gradient(ellipse 88% 78% at 45% 60%, black 8%, transparent 76%);
}

[data-geo="roles"] .ih-landing-geo--rings::before {
  top: auto;
  bottom: -20%;
  right: -12%;
  left: auto;
}

[data-geo="roles"] .ih-landing-geo--rings::after {
  top: -12%;
  bottom: auto;
  left: -8%;
}

[data-geo="roles"] .ih-landing-geo--waves {
  left: auto;
  right: 0;
  width: min(560px, 90vw);
  transform: scaleX(-1);
  background-position: right bottom;
  mask-image: linear-gradient(240deg, black 12%, transparent 72%);
}

[data-geo="roles"] .ih-landing-geo--diamonds {
  opacity: 0.2;
}

/* CTA — centered rings + full grid */
[data-geo="cta"] .ih-landing-geo-grid {
  opacity: 0.45;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 50%, black 15%, transparent 78%);
}

[data-geo="cta"] .ih-landing-geo--mesh {
  mask-image: radial-gradient(ellipse 100% 90% at 50% 50%, black 10%, transparent 82%);
}

[data-geo="cta"] .ih-landing-geo--rings::before {
  top: 50%;
  left: 50%;
  right: auto;
  transform: translate(-50%, -58%);
  width: min(480px, 85vw);
  height: min(480px, 85vw);
}

[data-geo="cta"] .ih-landing-geo--rings::after {
  display: none;
}

[data-geo="cta"] .ih-landing-geo--waves {
  left: 0;
  right: 0;
  width: 100%;
  height: min(280px, 40vh);
  opacity: 0.75;
  mask-image: linear-gradient(180deg, transparent 0%, black 35%, transparent 100%);
}

/* Diagonal mesh / cross-hatch */
.ih-landing-geo--mesh {
  background-image:
    repeating-linear-gradient(
      105deg,
      transparent 0,
      transparent 47px,
      var(--landing-geo-line) 47px,
      var(--landing-geo-line) 48px
    ),
    repeating-linear-gradient(
      -15deg,
      transparent 0,
      transparent 47px,
      var(--landing-geo-line) 47px,
      var(--landing-geo-line) 48px
    );
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 30%, black 10%, transparent 75%);
}

html[data-theme="dark"] .ih-landing-geo--mesh {
  opacity: 0.5;
  mask-image: radial-gradient(ellipse 100% 90% at 40% 20%, black 5%, transparent 80%);
}

/* Concentric rings */
.ih-landing-geo--rings::before,
.ih-landing-geo--rings::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--landing-geo-ring);
  pointer-events: none;
}

.ih-landing-geo--rings::before {
  width: min(520px, 90vw);
  height: min(520px, 90vw);
  top: -18%;
  right: -12%;
  box-shadow:
    0 0 0 48px color-mix(in srgb, var(--landing-geo-ring) 55%, transparent),
    0 0 0 96px color-mix(in srgb, var(--landing-geo-ring) 35%, transparent),
    0 0 0 144px color-mix(in srgb, var(--landing-geo-ring) 18%, transparent);
  opacity: 0.65;
}

.ih-landing-geo--rings::after {
  width: min(280px, 50vw);
  height: min(280px, 50vw);
  bottom: 8%;
  left: -6%;
  box-shadow:
    0 0 0 36px color-mix(in srgb, var(--landing-geo-ring) 45%, transparent),
    0 0 0 72px color-mix(in srgb, var(--landing-geo-ring) 22%, transparent);
  opacity: 0.45;
}

html[data-theme="dark"] .ih-landing-geo--rings::before {
  box-shadow:
    0 0 0 48px rgba(59, 130, 246, 0.08),
    0 0 0 96px rgba(59, 130, 246, 0.05),
    0 0 0 144px rgba(59, 130, 246, 0.03);
  opacity: 0.85;
}

html[data-theme="dark"] .ih-landing-geo--rings::after {
  box-shadow:
    0 0 0 36px rgba(14, 165, 233, 0.07),
    0 0 0 72px rgba(14, 165, 233, 0.04);
  opacity: 0.7;
}

/* Rotated diamond / square lattice */
.ih-landing-geo--diamonds {
  background-image:
    linear-gradient(45deg, var(--landing-geo-shape) 25%, transparent 25%),
    linear-gradient(-45deg, var(--landing-geo-shape) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--landing-geo-shape) 75%),
    linear-gradient(-45deg, transparent 75%, var(--landing-geo-shape) 75%);
  background-size: 56px 56px;
  background-position:
    0 0,
    0 28px,
    28px -28px,
    -28px 0;
  opacity: 0.22;
  mask-image: linear-gradient(180deg, transparent 0%, black 25%, black 70%, transparent 100%);
}

html[data-theme="dark"] .ih-landing-geo--diamonds {
  opacity: 0.35;
}

/* Flowing wave lines (bottom-left accent) */
.ih-landing-geo--waves {
  bottom: 0;
  left: 0;
  right: auto;
  top: auto;
  width: min(640px, 85vw);
  height: min(320px, 45vh);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 320' fill='none'%3E%3Cpath d='M0 220C80 180 160 260 240 200C320 140 400 240 480 180C560 120 600 200 640 160' stroke='%232563eb' stroke-opacity='0.14' stroke-width='1.5'/%3E%3Cpath d='M0 260C100 220 200 300 300 240C400 180 500 280 640 220' stroke='%232563eb' stroke-opacity='0.1' stroke-width='1.5'/%3E%3Cpath d='M0 180C120 140 220 220 340 160C460 100 540 200 640 140' stroke='%237c3aed' stroke-opacity='0.08' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: left bottom;
  opacity: 0.9;
  mask-image: linear-gradient(135deg, black 20%, transparent 72%);
}

html[data-theme="dark"] .ih-landing-geo--waves {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 320' fill='none'%3E%3Cpath d='M0 220C80 180 160 260 240 200C320 140 400 240 480 180C560 120 600 200 640 160' stroke='%233b82f6' stroke-opacity='0.35' stroke-width='1.5'/%3E%3Cpath d='M0 260C100 220 200 300 300 240C400 180 500 280 640 220' stroke='%233b82f6' stroke-opacity='0.22' stroke-width='1.5'/%3E%3Cpath d='M0 180C120 140 220 220 340 160C460 100 540 200 640 140' stroke='%2360a5fa' stroke-opacity='0.18' stroke-width='1.5'/%3E%3Cpath d='M0 300C90 260 180 320 280 280C380 240 480 310 640 270' stroke='%2322d3ee' stroke-opacity='0.12' stroke-width='1'/%3E%3C/svg%3E");
  opacity: 1;
  filter: blur(0.2px);
}

.ih-landing-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--landing-badge-border);
  background: var(--landing-badge-bg);
  color: var(--landing-badge-text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.ih-landing-badge-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--landing-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--landing-accent) 22%, transparent);
}

.ih-landing-headline {
  color: var(--landing-hero-title);
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.ih-landing-headline-accent {
  color: var(--landing-accent);
}

.ih-landing-sub {
  color: var(--landing-hero-sub);
  font-size: 1.125rem;
  line-height: 1.65;
  max-width: 32rem;
}

.ih-landing-secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.35rem;
  border-radius: 0.85rem;
  border: 1px solid var(--landing-secondary-btn-border);
  background: var(--landing-secondary-btn-bg);
  color: var(--landing-secondary-btn-text);
  font-size: 0.875rem;
  font-weight: 600;
  transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.ih-landing-secondary-btn:hover {
  border-color: color-mix(in srgb, var(--landing-accent) 35%, var(--landing-secondary-btn-border));
  transform: translateY(-1px);
}

.ih-landing-perks {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 1.75rem;
}

.ih-landing-perk {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--landing-trust-text);
  font-size: 0.8125rem;
  font-weight: 500;
}

.ih-landing-perk svg {
  color: var(--landing-trust-icon);
  flex-shrink: 0;
}

.ih-landing-trust {
  border-top: 1px solid var(--landing-nav-border);
  padding: 2rem 0 2.5rem;
}

.ih-landing-trust-label {
  color: var(--landing-trust-label);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ih-landing-trust-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--landing-trust-logo);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.ih-landing-trust-logo-mark {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 0.35rem;
  border: 1.5px solid currentColor;
  opacity: 0.85;
}

/* Hero dashboard mockup */
.ih-hero-mockup {
  position: relative;
  isolation: isolate;
}

.ih-hero-mockup-csv {
  position: absolute;
  top: -0.5rem;
  right: 2.5rem;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  animation: ih-mockup-float 6s ease-in-out infinite;
}

.ih-hero-mockup-csv-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.65rem;
  background: linear-gradient(145deg, #22c55e, #16a34a);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px rgba(22, 163, 74, 0.35);
}

.ih-hero-mockup-csv-line {
  width: 1px;
  height: 1.25rem;
  border-left: 2px dashed color-mix(in srgb, var(--landing-accent) 45%, transparent);
}

.ih-hero-mockup-brand-float {
  position: absolute;
  bottom: -0.75rem;
  right: -0.25rem;
  z-index: 3;
  animation: ih-mockup-float 5.5s ease-in-out infinite 0.8s;
}

.ih-hero-mockup-window {
  position: relative;
  z-index: 2;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border-main) 80%, transparent);
  background: var(--bg-surface);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 28px 64px rgba(15, 23, 42, 0.14);
}

html[data-theme="dark"] .ih-hero-mockup-window {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 32px 72px rgba(0, 0, 0, 0.55);
}

.ih-mock-titlebar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  background: color-mix(in srgb, var(--bg-surface-soft) 88%, var(--bg-surface));
  border-bottom: 1px solid var(--border-soft);
}

html[data-theme="dark"] .ih-mock-titlebar {
  background: #0b1220;
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.ih-mock-dots {
  display: flex;
  gap: 0.35rem;
}

.ih-mock-dots span {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  display: block;
}

.ih-mock-app {
  display: flex;
  min-height: 22rem;
  background: color-mix(in srgb, var(--bg-surface-soft) 55%, var(--bg-surface));
}

html[data-theme="dark"] .ih-mock-app {
  background: #0f172a;
}

.ih-mock-sidebar {
  width: 8.5rem;
  flex-shrink: 0;
  padding: 0.65rem 0.5rem;
  border-right: 1px solid var(--border-soft);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
}

html[data-theme="dark"] .ih-mock-sidebar {
  background: #0b1220;
  border-right-color: rgba(255, 255, 255, 0.06);
}

.ih-mock-workspace {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  padding: 0.35rem 0.45rem;
  margin-bottom: 0.65rem;
  border-radius: 0.45rem;
  border: 1px solid var(--border-main);
  font-size: 0.5625rem;
  font-weight: 700;
  color: var(--text-main);
}

.ih-mock-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.45rem;
  margin-bottom: 0.2rem;
  border-radius: 0.45rem;
  font-size: 0.5625rem;
  font-weight: 600;
  color: var(--text-muted);
}

.ih-mock-nav svg {
  width: 0.75rem;
  height: 0.75rem;
  flex-shrink: 0;
  opacity: 0.75;
}

.ih-mock-nav.is-active {
  background: color-mix(in srgb, var(--landing-accent) 14%, transparent);
  color: var(--landing-accent);
}

.ih-mock-nav.is-active svg {
  opacity: 1;
}

.ih-mock-sidebar-foot {
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-soft);
}

.ih-mock-sidebar-foot .ih-mock-nav {
  font-weight: 500;
  color: var(--text-soft);
}

.ih-mock-whats-new {
  position: relative;
}

.ih-mock-whats-new::after {
  content: "";
  position: absolute;
  top: 0.35rem;
  right: 0.2rem;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--landing-accent);
}

.ih-mock-main {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.7rem 0.75rem;
}

.ih-mock-topbar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.ih-mock-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  border-radius: 0.45rem;
  border: 1px solid var(--border-main);
  background: var(--bg-surface);
  font-size: 0.5rem;
  color: var(--text-soft);
}

.ih-mock-icon-btn {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 0.4rem;
  border: 1px solid var(--border-main);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.ih-mock-avatar {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--landing-accent), #1d4ed8);
  color: #fff;
  font-size: 0.4375rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ih-mock-welcome-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.ih-mock-welcome-sub {
  font-size: 0.5rem;
  color: var(--text-soft);
  margin-top: 0.1rem;
}

.ih-mock-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  margin: 0.55rem 0 0.6rem;
}

.ih-mock-stat {
  padding: 0.4rem 0.45rem;
  border-radius: 0.45rem;
  border: 1px solid var(--border-soft);
  background: var(--bg-surface);
}

html[data-theme="dark"] .ih-mock-stat {
  background: #111c31;
  border-color: rgba(255, 255, 255, 0.06);
}

.ih-mock-stat-label {
  font-size: 0.4375rem;
  color: var(--text-soft);
  font-weight: 600;
}

.ih-mock-stat-value {
  font-size: 0.6875rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 0.1rem;
}

.ih-mock-stat-delta {
  font-size: 0.4375rem;
  color: #16a34a;
  font-weight: 600;
  margin-top: 0.12rem;
}

.ih-mock-body {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 0.45rem;
}

.ih-mock-panel {
  border-radius: 0.5rem;
  border: 1px solid var(--border-soft);
  background: var(--bg-surface);
  overflow: hidden;
}

html[data-theme="dark"] .ih-mock-panel {
  background: #111c31;
  border-color: rgba(255, 255, 255, 0.06);
}

.ih-mock-panel-head {
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.5rem;
  font-weight: 700;
  color: var(--text-main);
}

.ih-mock-table-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.35rem;
  align-items: center;
  padding: 0.32rem 0.55rem;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.4375rem;
}

.ih-mock-table-row:last-child {
  border-bottom: none;
}

.ih-mock-file {
  color: var(--text-main);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ih-mock-rows {
  color: var(--text-soft);
}

.ih-mock-status {
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 0.375rem;
  font-weight: 700;
}

html[data-theme="dark"] .ih-mock-status {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.ih-mock-aside-stack {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ih-mock-checklist {
  padding: 0.45rem 0.55rem 0.55rem;
}

.ih-mock-check {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.4375rem;
  color: var(--text-muted);
  margin-bottom: 0.28rem;
}

.ih-mock-check-box {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 0.15rem;
  border: 1px solid var(--border-main);
  flex-shrink: 0;
}

.ih-mock-check.is-done .ih-mock-check-box {
  background: var(--landing-accent);
  border-color: var(--landing-accent);
}

.ih-mock-progress {
  height: 0.2rem;
  border-radius: 999px;
  background: var(--border-soft);
  margin: 0.35rem 0 0.25rem;
  overflow: hidden;
}

.ih-mock-progress > span {
  display: block;
  height: 100%;
  width: 66%;
  background: var(--landing-accent);
  border-radius: inherit;
}

.ih-mock-progress-label {
  font-size: 0.375rem;
  color: var(--text-soft);
}

.ih-mock-chart-card {
  padding: 0.45rem 0.55rem 0.55rem;
}

.ih-mock-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.2rem;
  height: 2.5rem;
  margin-top: 0.35rem;
}

.ih-mock-bars span {
  flex: 1;
  border-radius: 0.2rem 0.2rem 0 0;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.ih-mock-bars span:nth-child(1) { height: 70%; }
.ih-mock-bars span:nth-child(2) { height: 55%; }
.ih-mock-bars span:nth-child(3) { height: 80%; }
.ih-mock-bars span:nth-child(4) { height: 45%; }
.ih-mock-bars span:nth-child(5) { height: 92%; }
.ih-mock-bars span:nth-child(6) { height: 62%; }

.ih-mock-chart-caption {
  font-size: 0.375rem;
  color: var(--text-soft);
  margin-top: 0.35rem;
  line-height: 1.4;
}

.ih-landing-cta {
  isolation: isolate;
  background:
    radial-gradient(700px 320px at 88% -20%, rgba(37, 99, 235, 0.22), transparent 58%),
    var(--landing-hero-bg);
}

html[data-theme="dark"] .ih-landing-cta {
  background:
    radial-gradient(700px 320px at 88% -20%, rgba(37, 99, 235, 0.18), transparent 58%),
    #020617;
}

.ih-landing-cta .ih-landing-headline,
.ih-landing-cta h2 {
  color: var(--landing-hero-title);
}

.ih-landing-cta p {
  color: var(--landing-hero-sub);
}

@keyframes ih-mockup-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

html { scroll-behavior: smooth; }

/* ── Collections browse page ─────────────────────────────────────────────── */
.ih-collections-page {
  max-width: none;
}

.ih-collections-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-main);
  background: var(--bg-surface);
}

/* Shared with pinned collections / modal */
.ih-collections-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.ih-collections-search-wrap {
  position: relative;
  flex: 1 1 280px;
  min-width: 0;
}

.ih-collections-search-icon {
  pointer-events: none;
  position: absolute;
  left: 0.875rem;
  top: 50%;
  width: 1rem;
  height: 1rem;
  transform: translateY(-50%);
  color: var(--text-soft);
}

.ih-collections-search-input {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-main);
  background: var(--bg-surface);
  padding: 0.625rem 0.875rem 0.625rem 2.5rem;
  font-size: 0.875rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.ih-collections-search-input:focus-visible {
  border-color: color-mix(in srgb, var(--brand-main) 35%, var(--border-main));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-main) 14%, transparent);
}

.ih-collections-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  margin-left: auto;
}

.ih-collections-toolbar-actions--solo {
  margin-left: 0;
  width: 100%;
  justify-content: flex-end;
}

.ih-collections-shared-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-main);
  background: var(--bg-surface);
  padding: 0.55rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  white-space: nowrap;
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    box-shadow 140ms ease;
}

.ih-collections-shared-btn:hover {
  border-color: color-mix(in srgb, var(--brand-main) 28%, var(--border-main));
  background: var(--bg-surface-soft);
}

.ih-collections-shared-count {
  min-width: 1.25rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  color: var(--brand-main);
  background: color-mix(in srgb, var(--brand-main) 12%, transparent);
}

.ih-view-toggle {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-main);
  background: var(--bg-surface-soft);
}

.ih-view-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: calc(var(--radius-md) - 2px);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.ih-view-toggle-btn:hover {
  color: var(--text-main);
}

.ih-view-toggle-btn.is-active {
  background: var(--bg-surface);
  color: var(--brand-main);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.ih-collections-sort-select {
  min-width: 11.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-main);
  background: var(--bg-surface);
  padding: 0.55rem 2rem 0.55rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-main);
  outline: none;
}

.ih-collections-layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.ih-collections-filter-panel {
  position: sticky;
  top: 5.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ih-collections-filter-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  background: var(--bg-surface-soft);
}

.ih-collections-filter-tab {
  border: none;
  border-radius: calc(var(--radius-lg) - 0.25rem);
  padding: 0.55rem 0.7rem;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 650;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    box-shadow 140ms ease,
    color 140ms ease;
}

.ih-collections-filter-tab:hover {
  color: var(--text-main);
}

.ih-collections-filter-tab.is-active {
  background: var(--bg-surface);
  color: var(--brand-main);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.ih-collections-filter-tab:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand-main) 55%, transparent);
  outline-offset: 1px;
}

.ih-collections-filter-tab-panel.hidden {
  display: none;
}

.ih-collections-filter-heading {
  margin: 0;
  padding: 0 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.ih-collections-filter-heading--spaced {
  margin-top: 0.85rem;
}

.ih-collections-filter-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-main);
  background: var(--bg-surface);
  max-height: calc(100vh - 12rem);
  overflow-y: auto;
}

.ih-collections-accent-filter {
  max-height: none;
}

.ih-accent-filter-item {
  gap: 0.55rem;
}

.ih-accent-filter-swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--collection-accent, #94a3b8);
  border: 1px solid color-mix(in srgb, var(--collection-accent, #94a3b8) 40%, transparent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.ih-accent-filter-swatch--none {
  background:
    linear-gradient(135deg, transparent 46%, #94a3b8 46%, #94a3b8 54%, transparent 54%),
    var(--bg-surface);
  border-color: var(--border-main);
  box-shadow: none;
}

.ih-filter-group {
  margin-bottom: 0.1rem;
}

.ih-filter-group-head {
  display: flex;
  align-items: stretch;
  gap: 0.1rem;
}

.ih-filter-expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.ih-filter-expand:hover {
  background: var(--bg-surface-soft);
  color: var(--text-main);
}

.ih-filter-group-head .ih-filter-item--parent {
  flex: 1;
  min-width: 0;
}

.ih-filter-group.is-expanded .ih-filter-chevron {
  transform: rotate(90deg);
}

.ih-filter-group:not(.is-expanded) .ih-filter-children {
  display: none;
}

.ih-filter-children {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  padding-bottom: 0.1rem;
}

.ih-filter-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  padding: 0.5rem 0.6rem;
  text-align: left;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.ih-filter-item:hover {
  background: var(--bg-surface-soft);
  color: var(--text-main);
}

.ih-filter-item.is-active {
  background: color-mix(in srgb, var(--brand-main) 10%, transparent);
  color: var(--brand-main);
  font-weight: 600;
}

.ih-filter-item--child {
  padding-left: 2rem;
  font-size: 0.8125rem;
}

.ih-filter-item--child .ih-filter-item-label::before {
  content: "";
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  margin-right: 0.4rem;
  border-radius: 1px;
  background: var(--border-main);
  vertical-align: middle;
}

.ih-filter-chevron {
  transition: transform 160ms ease;
}

.ih-filter-item-label {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ih-filter-item.is-active .ih-filter-item-label {
  font-weight: 600;
}

.ih-filter-item-count {
  flex-shrink: 0;
  min-width: 1.25rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-surface-soft);
}

.ih-filter-item.is-active .ih-filter-item-count {
  color: var(--brand-main);
  background: color-mix(in srgb, var(--brand-main) 12%, transparent);
}

.ih-collections-main {
  min-width: 0;
}

.ih-collections-results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ih-collections-results-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.ih-collections-results-sub {
  margin: 0.2rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-soft);
}

.ih-collections-clear-filter {
  flex-shrink: 0;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background-color 140ms ease;
}

.ih-collections-clear-filter:hover {
  border-color: color-mix(in srgb, var(--brand-main) 28%, var(--border-main));
  color: var(--brand-main);
  background: color-mix(in srgb, var(--brand-main) 6%, var(--bg-surface));
}

.ih-collections-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
}

@media (min-width: 768px) {
  .ih-collections-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .ih-collections-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ih-collections-grid.is-list-view {
  grid-template-columns: 1fr;
}

.ih-collection-card {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding: 1rem 1rem 0.9rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-main);
  background: var(--bg-surface);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease,
    opacity 140ms ease;
}

.ih-collection-card.is-filtered-out {
  display: none;
}

.ih-collection-card:hover {
  border-color: color-mix(in srgb, var(--brand-main) 22%, var(--border-main));
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.ih-collection-card[data-accent]:not([data-accent=""]) {
  /*
   * Keep the theme's surface and text colors dominant. The accent is only
   * an 8% tint, so text continues to use the accessible --text-* tokens.
   */
  background-color: color-mix(
    in srgb,
    var(--collection-accent) 8%,
    var(--bg-surface)
  );
  border-color: color-mix(
    in srgb,
    var(--collection-accent) 32%,
    var(--border-main)
  );
}

.ih-collection-card[data-accent]:not([data-accent=""]):hover {
  background-color: color-mix(
    in srgb,
    var(--collection-accent) 11%,
    var(--bg-surface)
  );
  border-color: color-mix(
    in srgb,
    var(--collection-accent) 48%,
    var(--border-main)
  );
  box-shadow:
    0 8px 20px rgba(15, 23, 42, 0.06),
    0 0 0 1px color-mix(in srgb, var(--collection-accent) 10%, transparent);
}

.ih-collection-card-body {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.ih-collection-card-link {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.ih-collection-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  flex-shrink: 0;
  color: var(--brand-main);
  background: color-mix(in srgb, var(--brand-main) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand-main) 16%, transparent);
}

.ih-collection-card-icon[data-accent],
.ih-collection-card[data-accent]:not([data-accent=""]) .ih-collection-card-icon {
  color: var(--collection-accent);
  background: color-mix(in srgb, var(--collection-accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--collection-accent) 22%, transparent);
}

.ih-collection-card[data-accent="rose"],
.ih-collection-card-icon[data-accent="rose"],
.ih-collection-accent-swatch[data-accent="rose"],
.ih-accent-filter-swatch[data-accent="rose"],
.ih-accent-filter-item[data-accent="rose"] { --collection-accent: #e11d48; }
.ih-collection-card[data-accent="orange"],
.ih-collection-card-icon[data-accent="orange"],
.ih-collection-accent-swatch[data-accent="orange"],
.ih-accent-filter-swatch[data-accent="orange"],
.ih-accent-filter-item[data-accent="orange"] { --collection-accent: #ea580c; }
.ih-collection-card[data-accent="amber"],
.ih-collection-card-icon[data-accent="amber"],
.ih-collection-accent-swatch[data-accent="amber"],
.ih-accent-filter-swatch[data-accent="amber"],
.ih-accent-filter-item[data-accent="amber"] { --collection-accent: #d97706; }
.ih-collection-card[data-accent="emerald"],
.ih-collection-card-icon[data-accent="emerald"],
.ih-collection-accent-swatch[data-accent="emerald"],
.ih-accent-filter-swatch[data-accent="emerald"],
.ih-accent-filter-item[data-accent="emerald"] { --collection-accent: #059669; }
.ih-collection-card[data-accent="teal"],
.ih-collection-card-icon[data-accent="teal"],
.ih-collection-accent-swatch[data-accent="teal"],
.ih-accent-filter-swatch[data-accent="teal"],
.ih-accent-filter-item[data-accent="teal"] { --collection-accent: #0d9488; }
.ih-collection-card[data-accent="sky"],
.ih-collection-card-icon[data-accent="sky"],
.ih-collection-accent-swatch[data-accent="sky"],
.ih-accent-filter-swatch[data-accent="sky"],
.ih-accent-filter-item[data-accent="sky"] { --collection-accent: #0284c7; }
.ih-collection-card[data-accent="indigo"],
.ih-collection-card-icon[data-accent="indigo"],
.ih-collection-accent-swatch[data-accent="indigo"],
.ih-accent-filter-swatch[data-accent="indigo"],
.ih-accent-filter-item[data-accent="indigo"] { --collection-accent: #4f46e5; }
.ih-collection-card[data-accent="violet"],
.ih-collection-card-icon[data-accent="violet"],
.ih-collection-accent-swatch[data-accent="violet"],
.ih-accent-filter-swatch[data-accent="violet"],
.ih-accent-filter-item[data-accent="violet"] { --collection-accent: #7c3aed; }
.ih-collection-card[data-accent="fuchsia"],
.ih-collection-card-icon[data-accent="fuchsia"],
.ih-collection-accent-swatch[data-accent="fuchsia"],
.ih-accent-filter-swatch[data-accent="fuchsia"],
.ih-accent-filter-item[data-accent="fuchsia"] { --collection-accent: #c026d3; }
.ih-collection-card[data-accent="slate"],
.ih-collection-card-icon[data-accent="slate"],
.ih-collection-accent-swatch[data-accent="slate"],
.ih-accent-filter-swatch[data-accent="slate"],
.ih-accent-filter-item[data-accent="slate"] { --collection-accent: #475569; }

.ih-collection-accent-picker {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.45rem 0.5rem 0.55rem;
  border-top: 1px solid var(--border-main);
  border-bottom: 1px solid var(--border-main);
  margin: 0.15rem 0;
}

.ih-collection-accent-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.ih-collection-accent-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ih-collection-accent-swatch {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, var(--collection-accent, #94a3b8) 35%, transparent);
  background: var(--collection-accent, #94a3b8);
  padding: 0;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.ih-collection-accent-swatch--none {
  background:
    linear-gradient(135deg, transparent 46%, #94a3b8 46%, #94a3b8 54%, transparent 54%),
    var(--bg-surface);
  border-color: var(--border-main);
  box-shadow: none;
}

.ih-collection-accent-swatch:hover {
  transform: scale(1.08);
}

.ih-collection-accent-swatch.is-selected {
  box-shadow:
    0 0 0 2px var(--bg-surface),
    0 0 0 3.5px var(--collection-accent, var(--brand-main));
}

.ih-collection-accent-swatch--none.is-selected {
  box-shadow:
    0 0 0 2px var(--bg-surface),
    0 0 0 3.5px var(--text-muted);
}

.ih-collection-accent-swatch:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.ih-collection-card-icon svg,
.ih-collection-pin-btn svg,
.ih-collection-menu-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.ih-collection-pin-btn svg,
.ih-collection-menu-btn svg {
  width: 1rem;
  height: 1rem;
}

.ih-collection-card-title {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-main);
  word-break: break-word;
}

.ih-collection-card-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.2rem;
  font-size: 0.6875rem;
  line-height: 1.4;
  color: var(--text-soft);
}

.ih-collection-card-breadcrumb-cat {
  font-weight: 600;
  color: var(--text-muted);
}

.ih-collection-card-breadcrumb-sep {
  color: var(--text-soft);
  opacity: 0.65;
}

.ih-collection-card-breadcrumb-sub {
  color: var(--text-soft);
}

.ih-collection-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
}

.ih-collection-pin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease;
}

.ih-collection-pin-btn:hover {
  background: var(--bg-surface-soft);
  color: var(--text-main);
}

.ih-collection-pin-btn.is-pinned .ih-pin-icon-filled {
  display: block;
}

.ih-collection-pin-btn.is-pinned .ih-pin-icon-outline {
  display: none;
}

.ih-collection-pin-btn:not(.is-pinned) .ih-pin-icon-filled {
  display: none;
}

.ih-collection-pin-btn:not(.is-pinned) .ih-pin-icon-outline {
  display: block;
}

.ih-collections-sort-label {
  display: inline-flex;
}

.ih-collection-menu {
  position: relative;
}

.ih-collection-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.ih-collection-menu-btn:hover {
  background: var(--bg-surface-soft);
  color: var(--text-main);
}

.ih-collection-menu-panel {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  z-index: 20;
  min-width: 13rem;
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-main);
  background: var(--bg-surface);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.ih-collection-menu-item {
  display: block;
  width: 100%;
  border: none;
  border-radius: calc(var(--radius-md) - 2px);
  background: transparent;
  padding: 0.5rem 0.65rem;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  color: var(--text-main);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.ih-collection-menu-item:hover {
  background: var(--bg-surface-soft);
}

.ih-collection-card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  padding-top: 0.15rem;
  border-top: 1px solid var(--border-soft);
}

.ih-collection-card-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.ih-collections-grid.is-list-view .ih-collection-card {
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
}

.ih-collections-grid.is-list-view .ih-collection-card-body {
  align-items: center;
  flex: 1;
}

.ih-collections-grid.is-list-view .ih-collection-card-foot {
  border-top: none;
  padding-top: 0;
  margin-left: auto;
  flex-shrink: 0;
}

.ih-collections-grid.is-list-view .ih-collection-card-breadcrumb {
  margin-top: 0.1rem;
}

.ih-collections-empty,
.ih-collections-empty-state {
  padding: 2.5rem 1.5rem;
  text-align: center;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-main);
  background: color-mix(in srgb, var(--bg-surface-soft) 70%, var(--bg-surface));
  color: var(--text-soft);
}

.ih-collections-empty-title {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-main);
}

.ih-collections-empty-reset {
  border: none;
  background: none;
  padding: 0;
  font-size: inherit;
  font-weight: 600;
  color: var(--brand-main);
  text-decoration: underline;
  cursor: pointer;
}

.ih-collections-empty-reset:hover {
  color: var(--brand-strong, var(--brand-main));
}

.ih-collections-empty-state {
  padding: 3.5rem 1.5rem;
}

.ih-collections-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  border-radius: 999px;
  color: var(--brand-main);
  background: color-mix(in srgb, var(--brand-main) 10%, transparent);
}

/* ── Reusable client-side list pagination ─────────────────────────── */
.is-page-hidden {
  display: none !important;
}

.ih-list-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: 1rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--border-soft);
}

.ih-list-pagination.hidden {
  display: none;
}

.ih-list-pagination-info {
  font-size: 0.75rem;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

.ih-list-pagination-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.625rem;
}

.ih-list-pagination-size {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-soft);
}

.ih-list-pagination-size-select {
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.75rem;
  padding: 0.3rem 0.5rem;
}

.ih-list-pagination-indicator {
  min-width: 5.5rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.ih-list-pagination-btn {
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, opacity 140ms ease;
}

.ih-list-pagination-btn:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--brand-main) 28%, var(--border-main));
  background: color-mix(in srgb, var(--brand-main) 6%, var(--bg-surface));
}

.ih-list-pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ih-shared-links-modal .ih-list-pagination {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}

#ih-link-activity-modal .ih-link-activity-pagination {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  flex: 1;
  min-width: 0;
}

#ih-link-activity-modal .ih-link-activity-tabs {
  margin-bottom: -1px;
}

#ih-link-activity-modal .ih-link-activity-tab {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0.7rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  border-bottom: 2px solid transparent;
}

#ih-link-activity-modal .ih-link-activity-tab:hover {
  color: var(--text-main, #0f172a);
}

#ih-link-activity-modal .ih-link-activity-tab.is-active {
  color: var(--brand-main, #0f766e);
  border-bottom-color: var(--brand-main, #0f766e);
}

#ih-link-activity-modal .ih-link-visitors-table th,
#ih-link-activity-modal .ih-link-visitors-table td {
  vertical-align: top;
}

#ih-link-activity-modal .ih-link-visitors-table th {
  background: #f8fafc;
}

html[data-theme="dark"] #ih-link-activity-modal .ih-link-activity-tab.is-active {
  color: #5eead4;
  border-bottom-color: #5eead4;
}

/* Forms list / responses */
.ih-forms-section {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-main);
  background: var(--bg-surface);
  box-shadow: var(--shadow-main);
  overflow: hidden;
}

.ih-forms-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  padding: 1.125rem 1.25rem;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-surface);
}

.ih-forms-page-head-main {
  flex: 1 1 12rem;
  min-width: 0;
}

.ih-forms-page-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.ih-forms-page-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-main);
}

.ih-forms-page-sub {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.ih-forms-page-sub-muted {
  color: var(--text-soft);
}

.ih-forms-page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
}

.ih-forms-page-actions .btn-primary,
.ih-forms-page-actions .btn-secondary {
  height: 2.375rem;
  padding: 0 0.875rem !important;
  white-space: nowrap;
}

.ih-forms-section--embedded {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

/* Filter toolbar — single horizontal row */
.ih-forms-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-surface-soft);
}

.ih-forms-search-wrap {
  position: relative;
  flex: 1 1 14rem;
  min-width: 10rem;
  max-width: 22rem;
  margin: 0;
}

.ih-forms-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: var(--text-soft);
  pointer-events: none;
}

.ih-forms-search-input {
  display: block;
  width: 100%;
  height: 2.375rem;
  padding: 0 0.75rem 0 2.35rem;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text-main);
  background: var(--bg-surface);
  box-sizing: border-box;
}

.ih-forms-search-input:focus-visible {
  outline: none;
  border-color: var(--brand-main);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-main) 15%, transparent);
}

.ih-forms-filter-submit {
  flex-shrink: 0;
  height: 2.375rem;
  padding: 0 1rem !important;
  font-size: 0.875rem !important;
}

.ih-forms-filter-new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}

.ih-forms-filter-divider {
  width: 1px;
  height: 1.75rem;
  background: var(--border-main);
  flex-shrink: 0;
  margin: 0 0.15rem;
}

.ih-forms-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  flex-shrink: 0;
}

.ih-forms-filter-chip-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.ih-forms-filter-select {
  height: 2.375rem;
  min-width: 9.5rem;
  padding: 0 1.75rem 0 0.65rem;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text-main);
  background: var(--bg-surface);
  cursor: pointer;
}

.ih-forms-filter-clear {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand-main);
  text-decoration: none;
  padding: 0.5rem 0.25rem;
  white-space: nowrap;
}

.ih-forms-filter-clear:hover {
  text-decoration: underline;
}

.ih-forms-table-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 1.25rem;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-surface);
}

.ih-forms-table-meta-text {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.ih-forms-table-meta-muted {
  color: var(--text-soft);
}

.ih-forms-table-meta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.ih-responses-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.ih-responses-refresh-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.ih-responses-refresh-btn.is-busy .ih-responses-refresh-icon {
  animation: ih-responses-spin 0.75s linear infinite;
}

@keyframes ih-responses-spin {
  to {
    transform: rotate(360deg);
  }
}

.ih-forms-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Media file explorer */
.ih-media-explorer {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ih-media-explorer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-surface-soft);
}

.ih-media-explorer-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.ih-media-explorer-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border-soft);
  border-radius: 0.5rem;
  background: var(--bg-surface);
  color: var(--text-main);
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease;
}

.ih-media-explorer-nav-btn svg {
  width: 1rem;
  height: 1rem;
}

.ih-media-explorer-nav-btn:hover:not(.is-disabled) {
  background: color-mix(in srgb, var(--brand-main) 8%, var(--bg-surface));
  border-color: color-mix(in srgb, var(--brand-main) 25%, var(--border-soft));
}

.ih-media-explorer-nav-btn.is-disabled {
  opacity: 0.35;
  cursor: default;
}

.ih-media-explorer-address {
  display: flex;
  flex: 0 1 auto;
  min-width: 8rem;
  max-width: 14rem;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--border-soft);
  border-radius: 0.5rem;
  background: var(--bg-surface);
  font-size: 0.8125rem;
  overflow: hidden;
}

.ih-media-explorer-address-seg {
  color: var(--brand-main);
  text-decoration: none;
  white-space: nowrap;
}

.ih-media-explorer-address-seg:hover {
  text-decoration: underline;
}

.ih-media-explorer-address-sep {
  color: var(--text-muted);
}

.ih-media-explorer-address-current {
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ih-media-explorer-command-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.ih-media-explorer-cmd {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.625rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease;
}

.ih-media-explorer-cmd svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.ih-media-explorer-cmd:hover {
  background: color-mix(in srgb, var(--brand-main) 10%, transparent);
}

.ih-media-explorer-cmd--danger:hover {
  background: color-mix(in srgb, #ef4444 12%, transparent);
  color: #dc2626;
}

.ih-media-explorer-more {
  position: relative;
}

.ih-media-explorer-more > summary {
  list-style: none;
}

.ih-media-explorer-more > summary::-webkit-details-marker {
  display: none;
}

.ih-media-explorer-more-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.35rem);
  right: 0;
  display: grid;
  min-width: 10rem;
  padding: 0.35rem;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  box-shadow: var(--shadow-main);
}

.ih-media-explorer-more-item {
  width: 100%;
  padding: 0.5rem 0.625rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-main);
  font-size: var(--text-xs);
  font-weight: 550;
  text-align: left;
  cursor: pointer;
}

.ih-media-explorer-more-item:hover {
  background: var(--bg-surface-soft);
}

.ih-media-explorer-more-item--danger {
  color: var(--danger);
}

.ih-media-explorer-more-item--danger:hover {
  background: color-mix(in srgb, var(--danger) 9%, var(--bg-surface));
}

.ih-media-explorer-search {
  display: flex;
  flex: 1 1 12rem;
  min-width: 0;
  align-items: center;
  gap: 0.5rem;
}

.ih-media-explorer-search-wrap {
  position: relative;
  flex: 1 1 8rem;
  min-width: 0;
}

.ih-media-explorer-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  width: 1rem;
  height: 1rem;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.ih-media-explorer-search-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  border: 1px solid var(--border-soft);
  border-radius: 0.5rem;
  background: var(--bg-surface);
  font-size: 0.8125rem;
  color: var(--text-main);
}

.ih-media-explorer-search-input:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand-main) 35%, transparent);
  outline-offset: 0;
}

.ih-media-explorer-sort {
  flex-shrink: 0;
}

.ih-media-explorer-sort select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-soft);
  border-radius: 0.5rem;
  background: var(--bg-surface);
  font-size: 0.8125rem;
  color: var(--text-main);
  max-width: 11rem;
}

.ih-media-explorer-clear {
  font-size: 0.8125rem;
  color: var(--brand-main);
  text-decoration: none;
}

.ih-media-explorer-body {
  overflow-x: auto;
  min-height: 14rem;
}

.ih-media-explorer-table {
  width: 100%;
  border-collapse: collapse;
}

.ih-media-explorer-table thead th {
  padding: 0.5rem 0.875rem;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-surface-soft);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
}

.ih-media-explorer-table tbody td {
  padding: 0.5rem 0.875rem;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.8125rem;
  color: var(--text-main);
  vertical-align: middle;
}

.ih-media-explorer-table tbody tr.ih-media-explorer-row:not(.ih-media-explorer-row--hint):not(.ih-media-explorer-row--empty):nth-child(even):not(:hover):not(.is-selected) {
  background: color-mix(in srgb, var(--bg-surface-soft) 55%, var(--bg-surface));
}

.ih-media-explorer-table tbody tr.ih-media-explorer-row--parent:not(:hover) {
  background: color-mix(in srgb, var(--text-muted) 6%, var(--bg-surface-soft));
}

.ih-media-explorer-row {
  cursor: default;
  transition: background 100ms ease;
}

.ih-media-explorer-row--folder,
.ih-media-explorer-row--parent {
  cursor: pointer;
}

.ih-media-explorer-table tbody tr.ih-media-explorer-row--folder:hover,
.ih-media-explorer-table tbody tr.ih-media-explorer-row--parent:hover,
.ih-media-explorer-table tbody tr.ih-media-explorer-row--file:hover {
  background: color-mix(in srgb, var(--brand-main) 8%, var(--bg-surface));
}

.ih-media-explorer-table tbody tr.ih-media-explorer-row--folder.is-selected,
.ih-media-explorer-table tbody tr.ih-media-explorer-row--file.is-selected {
  background: color-mix(in srgb, var(--brand-main) 14%, var(--bg-surface));
}

.ih-media-explorer-entry {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.ih-media-explorer-entry-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ih-media-explorer-entry-ext {
  font-weight: 400;
  color: var(--text-soft);
}

.ih-media-explorer-entry-hint {
  font-size: 0.75rem;
  color: var(--text-soft);
}

.ih-media-explorer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.ih-media-explorer-icon svg {
  width: 1.125rem;
  height: 1.125rem;
}

.ih-media-explorer-icon--folder {
  color: #eab308;
}

.ih-media-explorer-icon--parent {
  color: var(--text-muted);
}

.ih-media-explorer-icon--file {
  color: var(--brand-main);
}

.ih-media-explorer-col-type,
.ih-media-explorer-col-status {
  color: var(--text-soft);
}

.ih-media-explorer-col-narrow {
  width: 6rem;
  text-align: right;
}

.ih-media-explorer-col-date {
  width: 9.5rem;
  white-space: nowrap;
  color: var(--text-soft);
}

.ih-media-explorer-col-actions {
  width: 7.5rem;
  text-align: right;
}

.ih-media-explorer-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.125rem;
}

.ih-media-explorer-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  padding: 0;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.ih-media-explorer-action svg {
  width: 1rem;
  height: 1rem;
}

.ih-media-explorer-action:hover {
  background: color-mix(in srgb, var(--brand-main) 12%, var(--bg-surface));
  border-color: color-mix(in srgb, var(--brand-main) 22%, var(--border-soft));
  color: var(--brand-main);
}

.ih-media-explorer-action--danger:hover {
  background: color-mix(in srgb, #b91c1c 10%, var(--bg-surface));
  border-color: color-mix(in srgb, #b91c1c 22%, var(--border-soft));
  color: #b91c1c;
}

button.ih-media-explorer-action {
  font: inherit;
}

.ih-media-explorer-empty,
.ih-media-explorer-hint {
  padding: 2rem 1rem !important;
  text-align: center;
  color: var(--text-soft);
}

.ih-media-explorer-row--hint td {
  border-bottom: 0;
}

.ih-media-col-select {
  width: 2.5rem;
  text-align: center;
}

.ih-media-select-all,
.ih-media-row-select {
  width: 1rem;
  height: 1rem;
  accent-color: var(--brand-main);
}

.ih-media-explorer .ih-table-footer {
  border-top: 1px solid var(--border-soft);
  padding: 0.625rem 0.875rem;
  background: var(--bg-surface-soft);
}

html[data-theme="dark"] .ih-media-explorer-icon--folder {
  color: #facc15;
}

/* Data tables — readable headers, no shouty ALL CAPS */
.ih-forms-data-table thead th {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.ih-forms-col-index {
  width: 3rem;
  text-align: center !important;
}

.ih-forms-data-table .ih-forms-col-index {
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

.ih-forms-col-narrow {
  width: 6rem;
}

.ih-forms-col-actions {
  width: 7rem;
  text-align: right !important;
}

.ih-forms-col-date {
  white-space: nowrap;
}

.ih-forms-col-user {
  max-width: 14rem;
}

.ih-forms-col-answer {
  max-width: 11rem;
  min-width: 7rem;
}

.ih-forms-cell-clip {
  display: block;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ih-forms-link {
  font-weight: 600;
  color: var(--brand-main);
  text-decoration: none;
}

.ih-forms-link:hover {
  text-decoration: underline;
}

.ih-forms-link--muted {
  font-weight: 500;
  font-size: 0.8125rem;
}

.ih-forms-row-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

button.ih-forms-link {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.ih-forms-link--danger {
  color: #b91c1c;
}

.ih-forms-link--danger:hover {
  color: #991b1b;
  text-decoration: underline;
}

.ih-forms-status {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: var(--bg-surface-soft);
  color: var(--text-muted);
  border: 1px solid var(--border-main);
}

.ih-forms-status--complete {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.ih-forms-status--partial {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

html[data-theme="dark"] .ih-forms-status--complete {
  background: rgba(5, 150, 105, 0.15);
  color: #6ee7b7;
  border-color: rgba(5, 150, 105, 0.35);
}

html[data-theme="dark"] .ih-forms-status--partial {
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.3);
}

.ih-forms-table-empty {
  padding: 2.5rem 1.25rem !important;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.875rem;
}

/* Table footer — horizontal pagination bar */
.ih-table-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-surface-soft);
}

.ih-table-footer-count {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.ih-table-footer-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem 0.75rem;
  margin-left: auto;
}

.ih-table-footer-field {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
}

.ih-table-footer-field-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.ih-table-footer-select {
  height: 2rem;
  min-width: 4.25rem;
  padding: 0 1.5rem 0 0.5rem;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-family: inherit;
  background: var(--bg-surface);
  color: var(--text-main);
  cursor: pointer;
}

.ih-table-footer-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.ih-table-footer-btn,
.ih-table-footer-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.4rem;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text-main);
  background: var(--bg-surface);
  text-decoration: none;
  box-sizing: border-box;
}

.ih-table-footer-btn:hover:not(.is-disabled),
.ih-table-footer-page:hover {
  border-color: var(--brand-main);
  color: var(--brand-main);
}

.ih-table-footer-btn.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.ih-table-footer-page-list {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0 0.15rem;
}

.ih-table-footer-page.is-active {
  border-color: var(--brand-main);
  background: var(--bg-accent-soft);
  color: var(--brand-main);
}

.ih-table-footer-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  color: var(--text-soft);
  font-size: 0.8125rem;
}

.ih-table-footer-goto {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

.ih-table-footer-goto-input {
  width: 3rem;
  height: 2rem;
  padding: 0 0.35rem;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-family: inherit;
  text-align: center;
  background: var(--bg-surface);
  color: var(--text-main);
  box-sizing: border-box;
}

.ih-table-footer-goto-of {
  font-size: 0.8125rem;
  color: var(--text-soft);
  white-space: nowrap;
}

.ih-table-footer-goto-btn {
  height: 2rem;
  padding: 0 0.65rem !important;
  font-size: 0.75rem !important;
  line-height: 1 !important;
}

.ih-table-footer-page-indicator {
  font-size: 0.8125rem;
  color: var(--text-soft);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .ih-forms-page-head {
    flex-direction: column;
    align-items: stretch;
  }

  .ih-forms-page-actions {
    justify-content: flex-start;
  }

  .ih-forms-filter-divider {
    display: none;
  }

  .ih-forms-search-wrap {
    flex: 1 1 100%;
    max-width: none;
  }

  .ih-table-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .ih-table-footer-controls {
    margin-left: 0;
    justify-content: flex-start;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1023px) {
  .ih-collections-layout {
    grid-template-columns: 1fr;
  }

  .ih-collections-filter-panel {
    position: static;
  }

  .ih-collections-filter-nav {
    max-height: 14rem;
  }

  .ih-collections-grid {
    grid-template-columns: 1fr;
  }
}

html[data-theme="dark"] .ih-collection-card {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .ih-collection-card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .ih-view-toggle-btn.is-active {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* ── App modals ──────────────────────────────────────────────────────────── */
.ih-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
}

.ih-modal-backdrop.hidden {
  display: none;
}

.ih-modal {
  width: 100%;
  max-width: 480px;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-modal);
  animation: ih-rise 200ms ease;
}

.ih-modal-lg {
  max-width: 920px;
}

.ih-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.125rem 1.5rem;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-surface-soft);
  border-radius: 1rem 1rem 0 0;
}

.ih-modal-body {
  padding: 1.5rem;
}

.ih-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.625rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-soft);
}

.ih-legal-modal .ih-modal-body {
  max-height: min(70vh, 640px);
  overflow-y: auto;
}

.ih-legal-document {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--text-main);
  white-space: pre-wrap;
}

button.ih-auth-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Company profile tabs ─────────────────────────────────────────────────── */
.cp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-surface-soft);
}

.cp-tab {
  padding: 0.875rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}

.cp-tab:hover {
  color: var(--text-main);
}

.cp-tab.is-active {
  color: var(--brand-main);
  border-bottom-color: var(--brand-main);
  background: var(--bg-surface);
}

.cp-tab-panel {
  padding: 1.5rem 1.25rem;
}

@media (max-width: 767px) {
  .app-topbar {
    gap: 0.5rem !important;
    padding-inline: 0.75rem !important;
  }

  .app-topbar-page-actions {
    max-width: min(42vw, 15rem);
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    padding: 0.2rem;
    margin: -0.2rem;
  }

  .app-topbar-page-actions::-webkit-scrollbar {
    display: none;
  }

  .app-topbar-page-actions > * {
    flex: 0 0 auto;
  }

  .cp-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

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

  .cp-tab {
    flex: 0 0 auto;
    padding-inline: 1rem;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .ih-forms-filter-bar {
    align-items: stretch;
  }

  .ih-forms-search-wrap {
    flex-basis: 100%;
    max-width: none;
  }

  .ih-media-explorer-toolbar {
    align-items: stretch;
  }

  .ih-media-explorer-search {
    order: 3;
    flex-basis: 100%;
  }

  .ih-media-explorer-command-bar {
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .ih-media-explorer-command-bar::-webkit-scrollbar {
    display: none;
  }

  .ih-media-explorer-cmd {
    flex: 0 0 auto;
  }
}

.cp-form-actions {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-surface-soft);
}

#share-notify-modal.ih-modal-backdrop {
  z-index: 70;
}

.share-notify-modal {
  display: flex;
  flex-direction: column;
  max-height: min(90vh, 720px);
}

.share-notify-modal-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.share-notify-modal .fd-form-group {
  border: none;
  margin: 0 0 1rem;
  padding: 0;
}

.share-notify-modal .fd-form-group:last-of-type {
  margin-bottom: 0.75rem;
}

.share-notify-modal .fd-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 0.375rem;
}

.share-notify-modal .fd-input,
.share-notify-modal .fd-textarea {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-main);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.875rem;
  padding: 0.625rem 0.75rem;
}

.share-notify-modal .fd-textarea {
  resize: vertical;
  min-height: 6rem;
}

.share-notify-modal .fd-textarea--mono {
  font-family: ui-monospace, monospace;
  font-size: 0.8125rem;
}

.share-notify-modal .fd-form-hint {
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-top: 0.25rem;
}

.share-notify-modal .fd-check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  margin-top: 0.25rem;
}

.share-notify-modal .fd-form-feedback {
  font-size: 0.875rem;
  margin-top: 0.75rem;
}

.share-notify-modal .fd-form-feedback.is-success {
  color: #047857;
}

.share-notify-modal .fd-form-feedback.is-error {
  color: #b91c1c;
}

html[data-theme="dark"] .share-notify-modal .fd-form-feedback.is-success {
  color: #6ee7b7;
}

html[data-theme="dark"] .share-notify-modal .fd-form-feedback.is-error {
  color: #fca5a5;
}

.ih-shared-links-modal-body {
  max-height: min(70vh, 720px);
  overflow: auto;
}

.ih-shared-links-table-wrap {
  max-height: min(52vh, 560px);
}

.ih-shared-links-actions-heading,
.ih-shared-links-actions-cell {
  width: 3.5rem;
  text-align: right;
}

.ih-shared-link-menu {
  display: inline-flex;
}

.ih-shared-link-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.ih-shared-link-menu-toggle:hover,
.ih-shared-link-menu-toggle[aria-expanded="true"] {
  border-color: var(--border-main);
  background: var(--bg-surface-soft);
  color: var(--text-main);
}

.ih-shared-link-menu-toggle:focus-visible {
  outline: 2px solid var(--brand-main);
  outline-offset: 2px;
}

.ih-shared-link-menu-toggle svg {
  width: 1rem;
  height: 1rem;
}

.ih-shared-link-menu-panel {
  position: fixed;
  z-index: 80;
  width: 11.5rem;
  padding: 0.35rem;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
}

.ih-shared-link-menu-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 0;
  border-radius: calc(var(--radius-md) - 2px);
  background: transparent;
  color: var(--text-main);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.ih-shared-link-menu-item:hover,
.ih-shared-link-menu-item:focus-visible {
  background: var(--bg-surface-soft);
  outline: none;
}

.ih-shared-link-menu-item--danger {
  color: var(--danger, #dc2626);
}

.ih-shared-link-menu-divider {
  height: 1px;
  margin: 0.3rem 0.2rem;
  background: var(--border-soft);
}

.ih-shared-link-name-cell {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  max-width: 18rem;
}

.ih-shared-links-collection-heading {
  min-width: 8rem;
  max-width: 14rem;
}

.ih-shared-links-collection-cell {
  max-width: 14rem;
  vertical-align: top;
}

.ih-shared-links-collection-name {
  display: block;
  max-width: 14rem;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
  color: var(--text-main);
}

.ih-shared-link-name {
  font-weight: 600;
  color: var(--brand-main);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ih-shared-link-rename-btn,
.ih-shared-link-rename-save,
.ih-shared-link-rename-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.ih-shared-link-rename-btn:hover,
.ih-shared-link-rename-save:hover,
.ih-shared-link-rename-cancel:hover {
  border-color: var(--border-main);
  background: var(--bg-surface-soft);
  color: var(--text-main);
}

.ih-shared-link-rename-btn svg,
.ih-shared-link-rename-save svg,
.ih-shared-link-rename-cancel svg {
  width: 0.9rem;
  height: 0.9rem;
}

.ih-shared-link-rename-form {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  flex: 1;
}

.ih-shared-link-rename-input {
  min-width: 0;
  flex: 1;
}

.ih-shared-link-name-cell .ih-shared-link-rename-form.hidden {
  display: none;
}

.ih-shared-link-name-cell.is-renaming .ih-shared-link-name,
.ih-shared-link-name-cell:has(.ih-shared-link-rename-form:not(.hidden)) .ih-shared-link-name,
.ih-shared-link-name-cell:has(.ih-shared-link-rename-form:not(.hidden)) .ih-shared-link-rename-btn {
  display: none;
}

[data-shared-link-row].is-renaming .ih-shared-link-name,
[data-shared-link-row].is-renaming .ih-shared-link-rename-btn {
  display: none;
}

@keyframes ih-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Auth pages (login / signup) ─────────────────────────────────────────── */
body:has(.ih-auth-page) .app-bg-glow {
  display: none;
}

.ih-auth-page {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(900px 420px at 8% -10%, color-mix(in srgb, var(--landing-accent) 10%, transparent), transparent 58%),
    radial-gradient(700px 360px at 95% 8%, color-mix(in srgb, var(--brand-main) 7%, transparent), transparent 55%),
    var(--landing-hero-bg);
  color: var(--landing-hero-title);
}

html[data-theme="dark"] .ih-auth-page {
  background:
    radial-gradient(ellipse 120% 100% at 0% 50%, rgba(37, 99, 235, 0.22), transparent 52%),
    radial-gradient(ellipse 90% 80% at 100% 0%, rgba(14, 165, 233, 0.1), transparent 48%),
    radial-gradient(ellipse 70% 60% at 85% 100%, rgba(59, 130, 246, 0.06), transparent 50%),
    #020617;
}

/* Brand panel — transparent; page background shows through */
.ih-auth-brand {
  background: transparent;
}

.ih-auth-brand-name {
  color: var(--landing-hero-title);
}

.ih-auth-headline {
  color: var(--landing-hero-title);
}

.ih-auth-lead {
  color: var(--landing-hero-sub);
}

.ih-auth-footnote {
  color: var(--landing-trust-text);
}

.ih-auth-footnote-link {
  color: var(--landing-hero-title);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ih-auth-footnote-link:hover {
  color: var(--landing-accent);
}

.ih-auth-perk {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--landing-hero-sub);
}

.ih-auth-perk-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  flex-shrink: 0;
  color: var(--landing-accent);
  background: color-mix(in srgb, var(--landing-accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--landing-accent) 28%, transparent);
}

/* Form side — same canvas as brand panel */
.ih-auth-main {
  background: transparent;
}

html[data-theme="dark"] .ih-auth-main {
  background: transparent;
}

.ih-auth-body {
  position: relative;
  isolation: isolate;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.ih-auth-toolbar {
  width: 100%;
  border-bottom: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--bg-surface) 72%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Login (centered): pattern shows through the top bar */
.ih-auth-toolbar--transparent {
  background: transparent;
  border-bottom: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html[data-theme="dark"] .ih-auth-toolbar {
  background: rgba(2, 6, 23, 0.35);
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .ih-auth-toolbar--transparent {
  background: transparent;
  border-bottom: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.ih-auth-main--centered {
  min-height: 0;
}

.ih-auth-toolbar-logo:focus-visible {
  outline: 2px solid var(--landing-accent);
  outline-offset: 3px;
}

.ih-auth-back {
  color: var(--text-muted);
}

.ih-auth-back:hover {
  color: var(--text-main);
}

.ih-auth-mobile-brand {
  color: var(--text-main);
}

.ih-auth-card {
  background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
  border-color: var(--border-main) !important;
  box-shadow: var(--shadow-main);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

html[data-theme="dark"] .ih-auth-card {
  background: rgba(15, 23, 42, 0.42);
  border-color: rgba(255, 255, 255, 0.09) !important;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.ih-auth-title {
  color: var(--text-main);
}

.ih-auth-subtitle {
  color: var(--text-muted);
}

.ih-auth-label {
  color: var(--text-main);
}

.ih-auth-link {
  color: var(--landing-accent);
}

.ih-auth-link:hover {
  color: var(--brand-hover);
}

.ih-auth-remember {
  color: var(--text-muted);
}

.ih-auth-page .relative:has([data-password-field]),
.relative:has([data-password-field]) {
  position: relative;
}

.relative:has([data-password-field]) > [data-password-field] {
  position: relative;
  z-index: 1;
}

.ih-auth-password-toggle,
.relative > [data-password-toggle] {
  z-index: 2;
  cursor: pointer;
  pointer-events: auto;
  min-width: 2.5rem;
  min-height: 2.5rem;
}

.ih-auth-password-toggle {
  color: var(--text-soft);
}

.ih-auth-password-toggle svg,
.relative [data-password-toggle] svg {
  pointer-events: none;
}

.ih-auth-password-toggle:hover {
  color: var(--text-main);
}

.ih-auth-checkbox {
  border-color: var(--border-main);
  accent-color: var(--landing-accent);
}

.ih-auth-divider {
  border-color: var(--border-soft) !important;
}

.ih-auth-alert {
  background: color-mix(in srgb, #ef4444 8%, var(--bg-surface));
  border: 1px solid color-mix(in srgb, #ef4444 25%, transparent);
  color: #b91c1c;
}

html[data-theme="dark"] .ih-auth-alert {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.28);
  color: #fca5a5;
}

/* Auth — one pattern canvas across brand + form (rings centered on split) */
.ih-auth-body > .ih-landing-section-patterns {
  opacity: 0.88;
}

[data-geo="auth"] .ih-landing-geo-grid {
  mask-image: radial-gradient(ellipse 100% 88% at 42% 48%, black 14%, transparent 76%);
}

[data-geo="auth"] .ih-landing-geo--mesh {
  mask-image: radial-gradient(ellipse 110% 95% at 42% 50%, black 10%, transparent 82%);
}

[data-geo="auth"] .ih-landing-geo--rings::before {
  top: 38%;
  left: 42%;
  right: auto;
  transform: translate(-50%, -50%);
  width: min(600px, 110vh);
  height: min(600px, 110vh);
}

[data-geo="auth"] .ih-landing-geo--rings::after {
  top: auto;
  bottom: -6%;
  left: 6%;
  right: auto;
  width: min(300px, 45vw);
  height: min(300px, 45vw);
}

[data-geo="auth"] .ih-landing-geo--diamonds {
  mask-image: radial-gradient(ellipse 95% 90% at 42% 48%, black 12%, transparent 78%);
}

[data-geo="auth"] .ih-landing-geo--waves {
  left: auto;
  right: 0;
  width: min(560px, 58%);
  height: min(320px, 48vh);
  transform: scaleX(-1);
  background-position: right bottom;
  opacity: 0.7;
  mask-image: linear-gradient(225deg, black 14%, transparent 70%);
}

@media (max-width: 1023px) {
  [data-geo="auth"] .ih-landing-geo-grid {
    mask-image: radial-gradient(ellipse 95% 80% at 50% 40%, black 14%, transparent 76%);
  }

  [data-geo="auth"] .ih-landing-geo--rings::before {
    top: 32%;
    left: 50%;
    width: min(520px, 120vw);
    height: min(520px, 120vw);
  }

  [data-geo="auth"] .ih-landing-geo--rings::after {
    bottom: 4%;
    left: -8%;
  }
}

html[data-theme="dark"] [data-geo="auth"] .ih-landing-geo-grid {
  opacity: 0.65;
}

html[data-theme="dark"] [data-geo="auth"] .ih-landing-geo--rings::before {
  opacity: 0.8;
}

html[data-theme="dark"] [data-geo="auth"] .ih-landing-geo--rings::after {
  opacity: 0.55;
}

html[data-theme="dark"] [data-geo="auth"] .ih-landing-geo--mesh {
  opacity: 0.3;
}

html[data-theme="dark"] [data-geo="auth"] .ih-landing-geo--diamonds {
  opacity: 0.2;
}

/* Centered login — focal point aligned with the card (was tuned for split layout) */
.ih-auth-page--centered [data-geo="auth"] .ih-landing-geo-grid {
  mask-image: radial-gradient(ellipse 100% 92% at 50% 48%, black 8%, transparent 84%);
}

.ih-auth-page--centered [data-geo="auth"] .ih-landing-geo--mesh {
  mask-image: radial-gradient(ellipse 110% 98% at 50% 50%, black 8%, transparent 86%);
}

/*
 * Full ring visible: default auth uses min(600px, 110vh) which is often wider than
 * the viewport, so only left/right arcs appear. vmin keeps the circle inside the screen.
 */
.ih-auth-page--centered [data-geo="auth"] .ih-landing-geo--rings::before {
  top: 44%;
  left: 50%;
  right: auto;
  transform: translate(-50%, -50%);
  width: min(92vmin, min(680px, calc(100vw - 1.5rem)));
  height: min(92vmin, min(680px, calc(100vw - 1.5rem)));
}

/* Nest the smaller ring on the same center so reads as concentric, not a second arc */
.ih-auth-page--centered [data-geo="auth"] .ih-landing-geo--rings::after {
  top: 44%;
  left: 50%;
  bottom: auto;
  right: auto;
  transform: translate(-50%, -50%);
  width: min(52vmin, min(340px, calc(100vw - 3rem)));
  height: min(52vmin, min(340px, calc(100vw - 3rem)));
}

.ih-auth-page--centered [data-geo="auth"] .ih-landing-geo--diamonds {
  mask-image: radial-gradient(ellipse 95% 92% at 50% 48%, black 10%, transparent 82%);
}

@media (max-width: 1023px) {
  .ih-auth-page--centered [data-geo="auth"] .ih-landing-geo--rings::before {
    top: 42%;
    left: 50%;
    width: min(94vmin, calc(100vw - 1.25rem));
    height: min(94vmin, calc(100vw - 1.25rem));
  }

  .ih-auth-page--centered [data-geo="auth"] .ih-landing-geo--rings::after {
    top: 42%;
    width: min(56vmin, calc(100vw - 2.5rem));
    height: min(56vmin, calc(100vw - 2.5rem));
  }
}

html[data-theme="dark"] .field-input {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

html[data-theme="dark"] .field-input::placeholder {
  color: #8fa3bf;
}

html[data-theme="dark"] .field-input:focus-visible {
  border-color: color-mix(in srgb, var(--landing-accent) 45%, rgba(255, 255, 255, 0.12));
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

/* ── Signup page (split desktop / stacked mobile) ─────────────────────────── */
.ih-auth-page--signup {
  background: var(--bg-app);
  color: var(--text-main);
}

.ih-signup-toolbar {
  background: transparent;
  border-bottom: none;
}

.ih-signup-header-login:hover {
  color: var(--brand-main);
}

html[data-theme="dark"] .ih-signup-header-login {
  color: #94a3b8;
}

html[data-theme="dark"] .ih-signup-header-login:hover {
  color: #f3f4f6;
}

.ih-signup-body {
  position: relative;
}

html[data-theme="dark"] .ih-auth-page--signup {
  background: var(--bg-app);
}

.ih-signup-card {
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border-color: var(--border-main) !important;
  box-shadow: var(--shadow-main);
}

html[data-theme="dark"] .ih-signup-card {
  background: var(--bg-surface) !important;
  border-color: var(--border-main) !important;
  box-shadow: var(--shadow-main);
}

/* Left brand panel */
.ih-signup-brand {
  position: relative;
  min-height: 680px;
  overflow: hidden;
  background: var(--bg-surface-soft);
}

html[data-theme="dark"] .ih-signup-brand {
  background: var(--bg-surface-soft);
}

.ih-signup-brand-dots {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(circle, #d1d5db 1px, transparent 1px);
  background-size: 16px 16px;
  opacity: 0.55;
  pointer-events: none;
}

html[data-theme="dark"] .ih-signup-brand-dots {
  background-image: radial-gradient(circle, rgba(148, 163, 184, 0.35) 1px, transparent 1px);
  opacity: 0.35;
}

.ih-signup-swoosh {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 1;
  width: 100%;
  height: 62%;
  pointer-events: none;
}

.ih-signup-brand-inner {
  position: relative;
  z-index: 2;
}

.ih-signup-brand-art {
  position: absolute;
  right: -4%;
  bottom: 2%;
  z-index: 3;
  width: 92%;
  max-width: 440px;
  pointer-events: none;
}

.ih-signup-logo-accent,
.ih-signup-headline-accent {
  color: var(--brand-main);
}

.ih-auth-page--signup .ih-auth-link {
  color: var(--brand-main);
}

.ih-auth-page--signup .ih-auth-link:hover {
  color: var(--brand-hover);
}

.ih-signup-hero-illustration {
  display: block;
  width: 100%;
  height: auto;
}

.ih-signup-buildings-illustration {
  display: block;
  width: 100%;
  height: auto;
}

.ih-signup-brand .ih-signup-buildings-illustration {
  display: none;
}

.ih-signup-mobile-header .ih-signup-hero-illustration {
  display: none;
}

/* Right form panel */
.ih-signup-form-panel {
  background: var(--bg-surface);
}

html[data-theme="dark"] .ih-signup-form-panel {
  background: var(--bg-surface);
}

.ih-signup-mobile-wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 140px;
  background:
    radial-gradient(ellipse 80% 100% at 20% 100%, color-mix(in srgb, var(--brand-main) 35%, transparent) 0%, transparent 70%),
    radial-gradient(ellipse 60% 90% at 75% 100%, rgba(147, 197, 253, 0.4) 0%, transparent 72%);
  pointer-events: none;
}

.ih-signup-field {
  position: relative;
}

.ih-signup-field-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  transform: translateY(-50%);
  pointer-events: none;
}

.ih-signup-input {
  height: 3rem;
  padding-left: 2.75rem !important;
  padding-right: 0.875rem;
  border-radius: 0.5rem;
  border: 1px solid #e0e0e0;
  background: #ffffff;
  font-size: 0.9375rem;
}

.ih-signup-input::placeholder {
  color: #9ca3af;
}

.ih-signup-input:focus-visible {
  border-color: var(--brand-main);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-main) 14%, transparent);
  outline: none;
}

.ih-signup-password-toggle {
  z-index: 3;
  color: #9ca3af;
}

.ih-signup-checkbox {
  border: 1px solid #d1d5db;
  border-radius: 0.2rem;
  accent-color: var(--brand-main);
}

.ih-signup-terms {
  color: #4b5563;
}

.ih-signup-submit {
  border: none;
  border-radius: var(--radius-md);
  background: var(--brand-main);
  box-shadow: none;
  cursor: pointer;
}

.ih-signup-submit:hover {
  background: var(--brand-hover);
}

html[data-theme="dark"] .ih-signup-logo-mark,
html[data-theme="dark"] .ih-signup-headline,
html[data-theme="dark"] .ih-auth-page--signup .ih-auth-title {
  color: #f3f4f6;
}

html[data-theme="dark"] .ih-signup-logo-sub,
html[data-theme="dark"] .ih-auth-page--signup .ih-auth-subtitle,
html[data-theme="dark"] .ih-signup-terms span {
  color: #9ca3af;
}

html[data-theme="dark"] .ih-signup-input {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f3f4f6;
}

/* Branded QR preview (circular dots, rounded finders, center link logo) */
.ih-qr-canvas {
  display: block;
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
}
