@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;800;900&family=IBM+Plex+Mono:wght@400;500&display=swap');
/* ==========================================================================
   CARO Prototype — Design Tokens
   Source: Figma "CARO (New)" (fileKey 5xKER5hbObbgv29Jm6cLYI), get_variable_defs
   on Dashboard (254:25218) and TPN Overview (92:65469) frames, 13 Aug 2026.
   Lead Design

   2026-08-28 UI audit (role_design_experience_lead) -- corrected against DesignOS
   as source of truth: spacing scale, radius scale, font family (Archivo) and the
   confirmed brand/CARO/error color values below now match token_spacing.md,
   token_radius.md, token_typography.md and token_color.md. See inline comments
   at each changed declaration.

   RESOLVED 2026-08-31 -- token_color.md v1.3 added a Neutral UI Scale and
   Status Tint Ramps to close the two gaps below; both are now wired in here.
   1) Text/border/surface neutrals (--text-primary/secondary/tertiary/quaternary,
      --border-primary/secondary/tertiary, --bg-primary-hover/secondary/-alt/active)
      now derive from token_color.md's Neutral UI Scale (ink / ink-dim / a
      contrast-checked tertiary mix / mid, plus the Off-White ramp) instead of
      an unrelated Figma-kit grey scale. NOTE: the first draft mapped tertiary
      text straight to neutral.mid (~2.4:1 contrast on white) -- caught as an
      accessibility problem before shipping and corrected in token_color.md
      itself; see that file's "Correction (2026-08-31)" note.
      STILL FLAGGED (out of this pass's scope): --bg-quaternary, --bg-success-secondary,
      and the whole --fg-* icon-color system have no DesignOS source either and
      were left untouched -- a further TOKENIZE pass would be needed for those.
   2) Success/Warning/Error tint/border steps (-50/-100/-200) now derive via
      color-mix() from the confirmed anchors (success-600/warning-500/error-500),
      per token_color.md's Status Tint Ramps section.
      STILL FLAGGED: --success-700 and --warning-700 (darker on-tint text/border
      shade) have no DesignOS-confirmed equivalent and were left as the original
      Figma-kit values -- error already had a confirmed "strong" shade to use,
      success/warning don't yet.
   ========================================================================== */

:root {
  /* Color — text */
  --text-primary: #253746; /* = color.neutral.text.primary (token_color.md v1.3) */
  --text-secondary: #445260; /* = color.neutral.text.secondary (token_color.md v1.3) */
  --neutral-mid: #a5a5a5; /* = color.neutral.mid (token_color.md) -- kept as its own var since text-quaternary/placeholder reuse it directly */
  --text-tertiary: color-mix(in srgb, var(--text-secondary) 65%, var(--neutral-mid) 35%); /* = color.neutral.text.tertiary (token_color.md v1.3) -- contrast-checked ~5.1:1, NOT the raw neutral.mid (~2.4:1, fails AA) */
  --text-quaternary: var(--neutral-mid); /* = color.neutral.text.quaternary (token_color.md v1.3) -- placeholder/disabled only, not AA-safe for real content */
  --text-placeholder: var(--neutral-mid);
  --text-brand-secondary: #02324a;
  --text-success-primary: #079455;
  --text-warning-primary: #dc6803;
  --text-error-primary: #d92d20;

  /* Color — background */
  --bg-primary: #fffffe; /* = color.neutral.surface.base = Off-White 100 (token_color.md v1.3) -- NOT literal #ffffff, DesignOS never uses pure white */
  --bg-primary-hover: #f4f2ee; /* = color.neutral.surface.subtle = Off-White 300 "soft" (token_color.md v1.3) */
  --bg-secondary: #f9fafb; /* CORRECTED 2026-08-31 (role_design_experience_lead, direct instruction, matching addressbook's page background) -- NOTE this reopens, rather than confirms, token_color.md v1.4's "Surface -- subtle (page bg) = #F4F2EE, Confirmed (existing anchor)" row: that confirmation was for the page background specifically, and this instruction now moves the page background itself onto the cool-grey #F9FAFB value v1.4 had scoped to hover states only. Flagged here rather than silently treated as consistent with v1.4 -- token_color.md's page-bg row needs a doc-side follow-up decision, not assumed resolved by this CSS change alone. */
  --bg-secondary-alt: #f4f2ee;
  --bg-active: #f9fafb; /* CORRECTED 2026-08-31 (role_design_experience_lead, direct instruction): NOT color.neutral.surface.subtle -- the DesignOS Neutral UI Scale (token_color.md v1.3) mapped hover states to the warm Off-White ramp, but visual review of the real product against this confirms hover states actually use the cool grey the Neutral UI Scale was meant to replace. token_color.md v1.3 itself flagged this exact risk ("validate visually on a real dense screen before rolling out product-wide") -- this is that validation, and it overturned the assumption for hover specifically. See token_color.md for the pending doc-side correction. */
  --bg-quaternary: #e4e7ec;
  --bg-success-secondary: #dcfae6;

  /* Color — border */
  --border-primary: #c9c7c2; /* = color.neutral.border.primary = Off-White 700 (token_color.md v1.3) */
  --border-secondary: color-mix(in srgb, var(--border-primary) 55%, white); /* = color.neutral.border.secondary (token_color.md v1.3) */
  --border-tertiary: color-mix(in srgb, var(--border-primary) 30%, white); /* extends the same derivation one step lighter -- not itself a separate DesignOS token */

  /* Color — foreground / icons */
  --fg-quaternary: #667085;
  --fg-quinary: #98a2b3;
  --fg-senary: #d0d5dd;
  --fg-white: #ffffff;
  --fg-success-primary: #079455;
  --fg-success-secondary: #17b26a;
  --fg-error-primary: #d92d20;

  /* Brand */
  --brand-900: #023852;
  --brand-700: #02324a;
  --brand-200: #91bcd0;
  --brand-50: #ebf4f8;
  --accent-cyan: #2BFEBB; /* color.brand.accent (token_color.md) — the Focus-ring color per policy_accessibility's focus_visibility rule; was missing entirely, so every :focus-visible outline below fell back to the wrong --brand-200 Petrol tone */

  /* Sub-brand accent — CARO Petrol (guardrails: ≤10% of surface, Active-Nav/Counter-Badges/Avatar-Gradient only) */
  --accent-caro-700: #1f6f8b;
  --accent-caro-200: #bfd5dd; /* corrected to DesignOS CARO ramp 300-stop (token_color.md); name kept as -200 for this file's own scale, flagged for renaming */
  --accent-caro-50: color-mix(in srgb, var(--accent-caro-700) 12%, white); /* DesignOS has no confirmed extra tint stop below 300 for sub-brands; derived via token_color.md's documented color-mix tinting method from the confirmed 500-stop (--accent-caro-700). FLAG: 12% mix ratio is not independently confirmed by DesignOS -- Design Lead sign-off needed if this should become a real token. */

  /* Utility — success */
  --success-700: #067647;
  --success-600: #079455;
  --success-500: #17b26a;
  --success-200: color-mix(in srgb, var(--success-600) 35%, white); /* = color.status.success.border (token_color.md v1.3) */
  --success-100: color-mix(in srgb, var(--success-600) 20%, white); /* = color.status.success.tint-strong (token_color.md v1.3) */
  --success-50: color-mix(in srgb, var(--success-600) 12%, white); /* = color.status.success.tint (token_color.md v1.3) */

  /* Utility — warning */
  --warning-700: #b54708;
  --warning-500: #f79009;
  --warning-200: color-mix(in srgb, var(--warning-500) 35%, white); /* = color.status.warning.border (token_color.md v1.3) */
  --warning-100: color-mix(in srgb, var(--warning-500) 20%, white); /* = color.status.warning.tint-strong (token_color.md v1.3) */
  --warning-50: color-mix(in srgb, var(--warning-500) 12%, white); /* = color.status.warning.tint (token_color.md v1.3) */

  /* Utility — error */
  --error-700: #b62549; /* = color.status.error.strong (token_color.md) */
  --error-500: #f96d61; /* = color.status.error.soft (token_color.md) */
  --error-200: color-mix(in srgb, var(--error-500) 32%, white); /* = color.status.error.border (token_color.md v1.3) */
  --error-100: color-mix(in srgb, var(--error-500) 18%, white); /* = color.status.error.tint-strong (token_color.md v1.3) */
  --error-50: color-mix(in srgb, var(--error-500) 10%, white); /* = color.status.error.tint (token_color.md v1.3) */

  /* Utility — blue (info) */
  --blue-700: #175cd3;
  --blue-500: #2e90fa;
  --blue-200: #b2ddff;
  --blue-100: #d1e9ff;
  --blue-50: #eff8ff;
  --blue-light-700: #026aa2;

  /* Utility — orange */
  --orange-700: #b93815;
  --orange-200: #f9dbaf;
  --orange-50: #fef6ee;

  /* Utility — gray */
  --gray-700: #344054;
  --gray-500: #667085;
  --gray-200: #e4e7ec;
  --gray-100: #f2f4f7;
  --gray-50: #f4f2ee; /* = color.neutral.surface.subtle = Off-White 300 (token_color.md v1.3) -- was #f9fafb (unrelated Figma-kit grey), same role as --bg-secondary (a resting/static surface, NOT a hover state -- --bg-active is intentionally a different value, see its own comment) */

  /* Buttons */
  --btn-primary-bg: #023852;
  --btn-primary-fg: #ffffff;
  --btn-secondary-bg: #ffffff;
  --btn-secondary-fg: #344054;
  --btn-secondary-border: #d0d5dd;
  --btn-tertiary-fg: #475467;
  --btn-tertiary-color-fg: #02324a;

  /* Spacing scale -- realigned to DesignOS token_spacing.md's confirmed 8-point scale (2026-08-28).
     Previous values were a raw Figma get_variable_defs export and did not match DesignOS
     under the same names (e.g. this file's old --sp-xl=16px vs. DesignOS space.xl=24px). */
  --sp-none: 0px;
  --sp-xxs: 2px;  /* = space.2xs -- confirmed 2026-09-01 by role_design_experience_lead directly (token_spacing.md v1.2), not a Design Guide transcription: this real, consistent usage across both CARO prototypes is exactly what was cited to confirm it. */
  --sp-xs: 4px;   /* = space.xs */
  --sp-sm: 8px;   /* = space.sm (was 6px) */
  --sp-md: 12px;  /* = space.md (was 8px) */
  --sp-lg: 16px;  /* = space.lg (was 12px) */
  --sp-xl: 24px;  /* = space.xl -- also the confirmed 12-col grid gap (was 16px) */
  --sp-2xl: 32px; /* = space.2xl (was 20px) */
  --sp-3xl: 48px; /* = space.3xl (was 24px) */
  --sp-4xl: 32px; /* = space.4xl -- REVISED 2026-08-31 (role_design_experience_lead, direct instruction): token_spacing.md v1.1 revised space.4xl from 64px back to 32px vault-wide, after reference-minimal's 64px page padding was judged too large against addressbook's own 32px. See token_spacing.md's Correction note. */
  /* --sp-5xl (40px, unused) and --sp-6xl (48px, 1 usage) removed: no DesignOS space.* step
     exists beyond 4xl=64px. FLAG: if a step between 3xl and 4xl is genuinely needed,
     it should be proposed to DesignOS as a new confirmed token, not reinvented here. */

  /* Radius -- realigned to DesignOS token_radius.md's 4 confirmed roles (2026-08-28).
     Previous scale had 6 steps; DesignOS defines only compact/standard/prominent/full.
     --r-sm and --r-lg are kept as aliases (unchanged usages elsewhere in this file)
     but now resolve to the same values as their nearest confirmed role. */
  --r-sm: 8px;    /* = radius.compact (was 6px, no separate "sm" role exists in DesignOS) */
  --r-md: 8px;    /* = radius.compact */
  --r-lg: 12px;   /* = radius.standard (was 10px, no separate "lg" role exists in DesignOS) */
  --r-xl: 12px;   /* = radius.standard */
  --r-2xl: 16px;  /* = radius.prominent (also the hard ceiling for Cards) */
  --r-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 #1018280d;
  --shadow-sm: 0 1px 3px 0 #1018281a, 0 1px 2px 0 #1018280f;
  --shadow-lg: 0 12px 16px -4px #10182814, 0 4px 6px -2px #10182808;

  /* Typography */
  --font-body: "Archivo", -apple-system, sans-serif;
  --font-display: "Archivo", -apple-system, sans-serif;
  /* Reserved for codes/IDs/compliance-codes only (DesignOS tokens.md: "Counterpoint — Code, IDs, Compliance-Codes") — never for general status labels like .pill */
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Consolas, monospace;

  /* Typography — scale (Figma: display-md/sm/xs, text-lg/md/sm/xs) */
  --fs-display-md: 36px; --lh-display-md: 44px;
  --fs-display-sm: 30px; --lh-display-sm: 38px;
  --fs-display-xs: 24px; --lh-display-xs: 32px;
  --fs-lg: 18px; --lh-lg: 28px;
  --fs-md: 16px; --lh-md: 24px;
  --fs-sm: 14px; --lh-sm: 20px;
  --fs-xs: 12px; --lh-xs: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scrollbar-gutter: stable; } /* prevents the page-content/tab-bar from shifting horizontally when switching between same-chrome pages whose content height crosses the viewport (e.g. Team Management Overview <-> Activity Log) */
body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-secondary);
  font-size: var(--fs-sm);
  line-height: var(--lh-sm);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: var(--fs-sm); }

.icon { width: 20px; height: 20px; flex-shrink: 0; fill: none; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }

/* ==========================================================================
   App shell
   ========================================================================== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 288px;
  flex-shrink: 0;
  background: var(--bg-primary);
  border-right: 1px solid var(--border-secondary);
  display: flex;
  flex-direction: column;
  padding: var(--sp-3xl) var(--sp-xl);
  gap: var(--sp-3xl);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-logo { display: flex; align-items: center; gap: var(--sp-md); padding: 0 var(--sp-md); }
.sidebar-logo img { height: 40px; min-height: 40px; } /* DesignOS: product logos ≥40px height on all surfaces */
.sidebar-nav { display: flex; flex-direction: column; gap: var(--sp-xxs); flex: 1; }
.nav-section { display: flex; flex-direction: column; gap: var(--sp-xxs); margin-top: var(--sp-lg); }
.nav-section-label {
  font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--fg-quaternary); padding: var(--sp-sm) var(--sp-md) var(--sp-xxs);
  font-family: var(--font-mono);
}
.nav-group { display: flex; flex-direction: column; }
.nav-item, .nav-group-toggle {
  display: flex; align-items: center; gap: var(--sp-lg);
  padding: var(--sp-md) var(--sp-md);
  border-radius: var(--r-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: var(--fs-sm);
  width: 100%;
  border: none;
  background: none;
  text-align: left;
}
.nav-item:hover, .nav-group-toggle:hover { background: var(--bg-active); }
.nav-item.active { background: var(--accent-caro-50); color: var(--accent-caro-700); }
.nav-item .icon, .nav-group-toggle .icon { color: var(--fg-quaternary); }
.nav-item.active .icon { color: var(--accent-caro-700); }
.nav-group-toggle { justify-content: space-between; }
.nav-group-toggle .toggle-main { display: flex; align-items: center; gap: var(--sp-lg); }
.nav-group-toggle .chevron { transition: transform .15s ease; color: var(--fg-quaternary); }
.nav-group.open .chevron { transform: rotate(180deg); }
.nav-subitems { display: flex; flex-direction: column; padding-left: 44px; gap: var(--sp-xxs); max-height: 0; overflow: hidden; transition: max-height .2s ease; }
.nav-group.open .nav-subitems { max-height: 400px; }
.nav-subitem {
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--r-md);
  color: var(--text-tertiary);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.nav-subitem:hover { background: var(--bg-active); color: var(--text-secondary); }
.nav-subitem.active { background: var(--accent-caro-50); color: var(--accent-caro-700); font-weight: 600; }

/* Coming Soon — for nav items, quick-actions and links that intentionally have no data behind
   them yet. Never a plain dead href="#" or a silently no-op button: always this explicit,
   reused marker so "not built" always looks the same wherever it appears (ADR-CARO-06). */
.badge-soon {
  display: inline-flex; align-items: center; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 1px 6px; border-radius: var(--r-full); background: var(--gray-100); color: var(--text-quaternary); flex-shrink: 0;
}
.nav-item.is-soon, .nav-subitem.is-soon, .nav-group-toggle.is-soon { display: flex; align-items: center; color: var(--fg-senary); cursor: default; justify-content: space-between; }
.nav-item.is-soon:hover, .nav-subitem.is-soon:hover, .nav-group-toggle.is-soon:hover { background: none; }
.nav-item.is-soon .icon, .nav-group-toggle.is-soon .icon { color: var(--fg-senary); }
.quick-action.is-soon, .btn-link.is-soon { cursor: default; }
.quick-action.is-soon { opacity: .7; }
.quick-action.is-soon:hover { border-color: var(--border-secondary); }
.quick-action.is-soon .icon-wrap { background: var(--gray-100); color: var(--fg-quaternary); }
.quick-action strong .badge-soon { margin-left: var(--sp-xs); vertical-align: middle; }
.btn-link.is-soon { color: var(--fg-quaternary); pointer-events: none; }
.btn-link.is-soon .badge-soon { margin-left: var(--sp-xxs); }

.sidebar-user { display: flex; align-items: center; gap: var(--sp-lg); padding: var(--sp-md); border-radius: var(--r-md); position: relative; border: 1px  solid var(--border-secondary); background: var(--bg-primary); }
.sidebar-user:hover { background: var(--bg-active); cursor: pointer; }
.sidebar-user .avatar { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--accent-caro-200); color: var(--accent-caro-700); font-weight: 700; font-size: var(--fs-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-user .user-meta { flex: 1; min-width: 0; }
.sidebar-user .user-name { font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user .user-email { font-size: var(--fs-sm); color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user > .icon { color: var(--fg-quaternary); flex-shrink: 0; }
/* DesignOS component_ui_side_nav v1.3: sidebar-bottom = user block (name + user context menu) */
.role-pill {
  font-size: var(--fs-xs); font-weight: 600; padding: 2px 8px; border-radius: var(--r-full);
  background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-200);
}

.company-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 240px;
  background: var(--bg-primary); border: 1px solid var(--border-secondary); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); padding: var(--sp-sm); display: none; z-index: 40;
}
.company-menu.open { display: block; }
.company-menu-label { font-size: var(--fs-xs); color: var(--text-quaternary); padding: var(--sp-sm) var(--sp-lg); text-transform: uppercase; letter-spacing: .03em; font-weight: 600; font-family: var(--font-mono); }
.company-menu-item { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-md) var(--sp-lg); border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: 500; color: var(--text-secondary); }
.company-menu-item:hover { background: var(--bg-active); cursor: pointer; }
.company-menu-item.selected { color: var(--brand-700); font-weight: 600; }
.company-menu-item .icon { color: var(--success-600); }
.company-menu-divider { height: 1px; background: var(--border-secondary); margin: var(--sp-sm) var(--sp-xs); }
/* DesignOS component_ui_side_nav v1.3: topbar-right = company block (name + company config + company switch) */

.user-menu {
  position: absolute; bottom: calc(100% + 8px); left: var(--sp-md); right: var(--sp-md);
  background: var(--bg-primary); border: 1px solid var(--border-secondary); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); padding: var(--sp-sm); display: none; z-index: 40;
}
.user-menu.open { display: block; }
.user-menu-item { display: flex; align-items: center; padding: var(--sp-md) var(--sp-lg); border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: 500; color: var(--text-secondary); }
.user-menu-item:hover { background: var(--bg-active); cursor: pointer; }
.user-menu-divider { height: 1px; background: var(--border-secondary); margin: var(--sp-sm) var(--sp-xs); }

/* ==========================================================================
   Main content
   ========================================================================== */
.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-xl) var(--sp-4xl) 0;
}
.breadcrumb { display: flex; align-items: center; gap: var(--sp-sm); font-size: var(--fs-sm); color: var(--text-tertiary); font-weight: 500; }
.breadcrumb .icon { color: var(--fg-quaternary); width: 18px; height: 18px; }
.breadcrumb .sep { color: var(--fg-senary); width: 16px; height: 16px; }
.breadcrumb .current { background: var(--gray-100); color: var(--text-secondary); padding: 2px 8px; border-radius: var(--r-sm); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: var(--sp-md); }
.topbar-org { display: flex; align-items: center; gap: var(--sp-md); padding: var(--sp-xs) var(--sp-md); margin-left: var(--sp-xs); border: 1px solid var(--border-secondary); position: relative; cursor: pointer; border-radius: var(--r-md); }
.topbar-org:hover { background: var(--bg-active); }
.topbar-org .avatar { width: 32px; height: 32px; border-radius: var(--r-md); background: var(--gray-100); color: var(--text-tertiary); font-size: var(--fs-xs); font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.topbar-org .org-meta { display: flex; flex-direction: column; }
.topbar-org .org-name { font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); }
.topbar-org .org-role { font-size: var(--fs-xs); color: var(--text-tertiary); }
.topbar-org > .icon { color: var(--fg-quaternary); flex-shrink: 0; }
.icon-btn {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-md); border: 1px solid var(--border-primary); background: var(--bg-primary);
  color: var(--text-tertiary);
}
.icon-btn:hover { background: var(--bg-active); }
.icon-btn.primary { background: var(--btn-primary-bg); color: var(--btn-primary-fg); border-color: var(--btn-primary-bg); }

/* .icon-btn-inline, added 2026-08-31: a small, borderless icon trigger for use
   inline within table cells/text (e.g. "show QR code" next to a DID value) -
   .icon-btn's 40px bordered box reads too heavy at that scale. See
   pattern_wallet.md v1.2. */
.icon-btn-inline {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 28px; height: 28px; padding: 0; border: none; border-radius: var(--r-sm);
  background: none; color: var(--text-tertiary); cursor: pointer;
}
.icon-btn-inline .icon { width: 18px; height: 18px; }
.icon-btn-inline:hover { background: var(--bg-secondary); color: var(--text-primary); }
.icon-btn-inline:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
/* .pw-input-wrap / .pw-toggle-btn, added 2026-09-01 (role_design_experience_lead): the real
   User Settings Security tab (Bildschirmfoto 2026-08-28 um 09.11.28.png) shows a show/hide
   (icon-eye) toggle inside each password field; reuses .icon-btn-inline for the icon itself. */
.pw-input-wrap { position: relative; }
.pw-input-wrap input { padding-right: 40px; }
.pw-toggle-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }

/* Close-X — matches Figma "Buttons/Button close X, Size=sm": 36px hit area, r-md radius, hover fill */
.close-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--r-md);
  border: none; background: none; color: var(--fg-quaternary); cursor: pointer; flex-shrink: 0;
}
.close-x:hover { background: var(--bg-active); color: var(--text-secondary); }
.icon-btn:focus-visible, .close-x:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }

.page-content { padding: var(--sp-4xl); }
.page-header { margin-bottom: var(--sp-3xl); display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-xl); }
.page-header h1 { font-size: var(--fs-display-sm); font-weight: 600; letter-spacing: -0.02em; margin-bottom: var(--sp-sm); }
.page-header .subtitle { color: var(--text-tertiary); font-size: var(--fs-md); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: var(--sp-sm);
  padding: var(--sp-lg) var(--sp-xl);
  border-radius: var(--r-md);
  font-size: var(--fs-sm); font-weight: 600;
  border: 1px solid transparent;
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
  position: relative;
}
.btn .icon { width: 20px; height: 20px; }
/* .btn had no :focus-visible rule at all — every primary/secondary/tertiary/destructive button was keyboard-invisible on focus (policy_accessibility, focus_visibility, Hard-Refuse, WCAG 2.4.7 AA) */
.btn:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-fg); }
.btn-primary:hover { background: var(--brand-700); }
.btn-secondary { background: var(--btn-secondary-bg); color: var(--btn-secondary-fg); border-color: var(--btn-secondary-border); }
.btn-secondary:hover { background: var(--bg-active); }
.btn-tertiary { background: none; box-shadow: none; color: var(--btn-tertiary-fg); }
.btn-tertiary:hover { background: var(--bg-active); }
.btn-destructive { background: var(--error-500); color: #fff; }
.btn-destructive:hover { background: var(--error-700); }
.btn-outline-destructive { background: var(--bg-primary); color: var(--error-700); border-color: var(--error-200); }
.btn-outline-destructive:hover { background: var(--error-50); }
.btn-sm { padding: var(--sp-sm) var(--sp-lg); font-size: var(--fs-sm); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Loading state — Figma "Buttons/Button, State=Loading": label hidden, centered spinner, button keeps its size */
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading[disabled] { opacity: 1; }
.btn.is-loading .icon { visibility: hidden; }
.btn.is-loading::after {
  content: '';
  position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%;
  border: 2px solid var(--btn-spinner-color, currentColor);
  border-top-color: transparent;
  animation: btn-spin .6s linear infinite;
}
.btn-primary.is-loading::after, .btn-destructive.is-loading::after { --btn-spinner-color: #fff; }
.btn-secondary.is-loading::after { --btn-spinner-color: var(--text-secondary); }
.btn-tertiary.is-loading::after { --btn-spinner-color: var(--btn-tertiary-fg); }
.btn-outline-destructive.is-loading::after { --btn-spinner-color: var(--error-700); }
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .btn.is-loading::after { animation-duration: 1.5s; }
}
.btn-link { background: none; border: none; box-shadow: none; color: var(--brand-700); font-weight: 600; font-size: var(--fs-sm); display: inline-flex; align-items: center; gap: var(--sp-xs); }

/* ==========================================================================
   Metric tiles
   ========================================================================== */
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-xl); margin-bottom: var(--sp-3xl); }
.metric-row.cols-4 { grid-template-columns: repeat(4, 1fr); }
.metric-tile {
  background: var(--bg-primary); border: 1px solid var(--border-secondary); border-radius: var(--r-xl);
  padding: var(--sp-xl); box-shadow: var(--shadow-xs);
}
.metric-tile-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-md); }
.metric-tile-head span { font-size: var(--fs-sm); font-weight: 500; color: var(--text-tertiary); }
.metric-tile-head .icon { color: var(--fg-quaternary); width: 18px; height: 18px; }
.metric-value-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-md); }
.metric-value { font-size: var(--fs-display-sm); font-weight: 600; letter-spacing: -0.02em; }
.metric-delta {
  display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-xs); font-weight: 600;
  padding: 2px 8px; border-radius: var(--r-full); background: var(--success-50); color: var(--success-700);
}
.metric-delta .icon { width: 12px; height: 12px; }
.metric-avatars { display: flex; }
.metric-avatars img { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #fff; margin-left: -8px; object-fit: cover; background: var(--gray-200); }
.metric-avatars img:first-child { margin-left: 0; }
.metric-avatars span { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #fff; margin-left: -8px; background: var(--accent-caro-200); color: var(--accent-caro-700); font-size: var(--fs-xs); font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.metric-avatars span:first-child { margin-left: 0; }

/* ==========================================================================
   Filter bar / A-Z + search
   ========================================================================== */
.az-filter { display: flex; gap: var(--sp-xs); flex-wrap: wrap; margin-bottom: var(--sp-xl); }
.az-btn {
  min-width: 36px; height: 36px; padding: 0 var(--sp-md); display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-md); border: 1px solid var(--border-primary); background: var(--bg-primary);
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary);
}
.az-btn:hover { background: var(--bg-active); }
.az-btn.active { background: var(--btn-primary-bg); color: #fff; border-color: var(--btn-primary-bg); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-xl); margin-bottom: var(--sp-xl); flex-wrap: wrap; }
.toolbar-left { display: flex; align-items: center; gap: var(--sp-md); flex: 1; } .toolbar-left .btn { height: 44px; padding-top: 0; padding-bottom: 0; } /* row controls (search input, filter button) share one 44px row height, added 2026-08-31 -- .btn defaults to ~52px which visibly mismatched the 44px .search-input beside it */
.tab-pill-group { display: flex; gap: var(--sp-xs); padding: 4px; background: var(--gray-50); border: 1px solid var(--border-secondary); border-radius: var(--r-md); }
.tab-pill { background: none; border: none; appearance: none; text-align: left; cursor: pointer; padding: var(--sp-sm) var(--sp-lg); border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 600; color: var(--text-tertiary); display: flex; align-items: center; gap: var(--sp-xs); }
.tab-pill.active { background: var(--bg-primary); color: var(--text-primary); box-shadow: var(--shadow-xs); }
.search-input {
  display: flex; align-items: center; gap: var(--sp-md); border: 1px solid var(--border-primary); border-radius: var(--r-md);
  padding: 0 var(--sp-lg); height: 44px; min-width: 280px; background: var(--bg-primary);
}
.search-input .icon { color: var(--fg-quaternary); }
.search-input input { border: none; flex: 1; font-size: var(--fs-sm); color: var(--text-primary); background: none; }
.search-input input:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; border-radius: var(--r-sm); }
.toolbar-right { display: flex; align-items: center; gap: var(--sp-md); }

/* ==========================================================================
   Table
   ========================================================================== */
.data-table-wrap { background: var(--bg-primary); border: 1px solid var(--border-secondary); border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-xs); }
table.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  text-align: left; font-size: var(--fs-xs); font-weight: 600; color: var(--text-quaternary);
  text-transform: uppercase; letter-spacing: .02em;
  padding: var(--sp-lg) var(--sp-xl); border-bottom: 1px solid var(--border-secondary); background: var(--bg-secondary);
}
.data-table tbody tr { border-bottom: 1px solid var(--border-secondary); }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr.clickable:hover { background: var(--bg-active); cursor: pointer; }
.data-table td { padding: var(--sp-lg) var(--sp-xl); font-size: var(--fs-sm); color: var(--text-secondary); vertical-align: middle; }
.cell-company { display: flex; align-items: center; gap: var(--sp-lg); }
.avatar-initials {
  width: 40px; height: 40px; border-radius: 50%; background: var(--gray-100); color: var(--text-tertiary);
  display: flex; align-items: center; justify-content: center; font-size: var(--fs-sm); font-weight: 600; flex-shrink: 0;
}
.cell-company .company-name { color: var(--text-primary); font-weight: 600; }
.cell-address .addr-1 { color: var(--text-primary); }
.cell-address .addr-2 { color: var(--text-tertiary); font-size: var(--fs-sm); }
.row-chevron { color: var(--fg-quaternary); }

/* Pills / Badges */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 500; padding: 2px 10px; border-radius: var(--r-full); border: 1px solid var(--border-secondary); color: var(--text-tertiary); background: var(--gray-50); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-success { background: var(--success-50); color: var(--success-700); border-color: var(--success-200); }
.pill-warning { background: var(--warning-50); color: var(--warning-700); border-color: var(--warning-200); }
.pill-error { background: var(--error-50); color: var(--error-700); border-color: var(--error-200); }
.pill-info { background: var(--blue-50); color: var(--blue-700); border-color: var(--blue-200); }
.pill-neutral { background: var(--gray-50); color: var(--gray-700); border-color: var(--border-secondary); }
.pill-brand { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-200); }

.source-tag { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 600; padding: 3px 10px 3px 8px; border-radius: var(--r-full); }
.source-tag .icon { width: 14px; height: 14px; }
.source-manual { background: var(--gray-100); color: var(--gray-700); }
.source-vrs { background: var(--blue-50); color: var(--blue-700); }
.source-tpn { background: var(--accent-caro-50); color: var(--accent-caro-700); }
.source-xatp { background: var(--orange-50); color: var(--orange-700); }

/* Document-Type Identification Badge — Untitled UI "Document, Type=Default" file-type icon asset
   (folded-corner outline + content lines, verified against the source SVG) with a code label
   overlaid near the base. NOT a solid colored rectangle, and NOT the generic `icon-file-04` line icon. */
.doc-icon { width: 32px; height: 40px; position: relative; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 5px; flex-shrink: 0; }
.doc-icon-file { position: absolute; top: 0; left: 0; width: 32px; height: 40px; }
.doc-icon-label {
  position: relative; font-family: var(--font-mono); font-size: 9px; font-weight: 700; line-height: 1;
  letter-spacing: .02em; padding: 3px 6px; border-radius: 4px; white-space: nowrap;
  background: var(--blue-500); color: #fff;
}
.doc-icon.lic .doc-icon-label { background: var(--bg-primary); color: var(--blue-500); border: 1px solid var(--border-primary); }
.doc-icon.lic::after { content: ''; position: absolute; top: -2px; right: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--success-500); border: 2px solid var(--bg-primary); }

/* Info-Tip — subtle marker for proposed/not-yet-agreed elements (icon + tooltip instead of a warning box) */
.info-tip { position: relative; display: inline-flex; align-items: center; vertical-align: middle; margin-left: 4px; }
.info-tip-trigger { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0; border: none; background: none; color: var(--fg-quaternary); cursor: help; border-radius: var(--r-sm); }
.info-tip-trigger:hover, .info-tip-trigger:focus-visible { color: var(--brand-700); }
.info-tip-trigger:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
/* Verified modifier, added 2026-08-31 (role_design_experience_lead): a positive-confirmation use of the same Info-Tip mechanism (e.g. a verified email address) - success-tinted rather than neutral, since it confirms a fact rather than flagging a draft/unconfirmed one. Icon is check-verified-01, not info-circle. */
.info-tip-trigger.verified { color: var(--success-600); }
.info-tip-trigger.verified:hover, .info-tip-trigger.verified:focus-visible { color: var(--success-700); }
.info-tip-trigger .icon { width: 16px; height: 16px; }
.info-tip .tooltip-bubble {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--text-primary); color: #fff; font-size: var(--fs-xs); line-height: var(--lh-xs);
  font-weight: 400; text-transform: none; letter-spacing: normal; text-align: left;
  padding: var(--sp-sm) var(--sp-md); border-radius: var(--r-md); width: 230px;
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .12s ease; box-shadow: var(--shadow-lg); z-index: 30;
}
.info-tip .tooltip-bubble::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--text-primary); }
.info-tip:hover .tooltip-bubble, .info-tip-trigger:focus-visible + .tooltip-bubble { opacity: 1; visibility: visible; }

/* Pagination — rendered by renderPagination() in app.js (added 2026-08-31, VRS Interactions
   pages) on every list, including a zero-row/single-page one: real screenshots of CARO's own
   Events/Reports/Trading Partners pages show this control disabled rather than hidden when
   there is nothing to page to (ADR-CARO-05: an affordance stays visible only if it does
   something real — a disabled control that honestly states there is nothing further still
   qualifies). Corrected 2026-08-31 — this comment previously said the opposite (hide when
   single-page), which no real screenshot ever supported. */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-xl); border-top: 1px solid var(--border-secondary); }
.pagination-nav {
  display: inline-flex; align-items: center; gap: var(--sp-xs);
  padding: var(--sp-sm) var(--sp-lg);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: none;
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary);
}
.pagination-nav:hover { background: var(--bg-active); }
.pagination-nav:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
.pagination-nav[disabled] { opacity: .4; cursor: not-allowed; pointer-events: none; }
.pagination-nav .icon { color: var(--fg-quaternary); width: 18px; height: 18px; }
.page-numbers { display: flex; gap: var(--sp-xs); }
.page-num { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: 600; color: var(--text-tertiary); }
.page-num.active { background: var(--gray-100); color: var(--text-primary); }
.page-num.ellipsis { color: var(--fg-quaternary); font-weight: 400; }

/* Empty state */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: var(--sp-4xl) var(--sp-3xl); }
/* asset_empty_states.md: state type maps to a specific color, never a single fixed gray for every case.
   Default (no modifier) = Gray = no-results, the only case built here so far. Add .empty-state-cyan for
   first-use/standard states and .empty-state-warning for permission-denied when those are built - never
   reuse the gray default for either. Cyan here uses CARO's own accent-caro scale as a pragmatic stand-in:
   this codebase has no true brand-cyan (#2BFEBB, token_color.md) CSS variable defined at all yet - a
   separate, still-open finding (2026-08-31), not resolved by this change. */
.empty-state .empty-icon-wrap { width: 56px; height: 56px; border-radius: 50%; background: var(--gray-100); display: flex; align-items: center; justify-content: center; margin-bottom: var(--sp-xl); color: var(--fg-quaternary); }
.empty-state-cyan .empty-icon-wrap { background: var(--accent-caro-50); color: var(--accent-caro-700); }
.empty-state-warning .empty-icon-wrap { background: var(--warning-100); color: var(--warning-700); }
.empty-state h2, .empty-state h3 { font-size: var(--fs-md); font-weight: 600; margin-bottom: var(--sp-sm); }
.empty-state p { color: var(--text-tertiary); font-size: var(--fs-sm); max-width: 360px; margin-bottom: var(--sp-xl); }

/* ==========================================================================
   Cards / Sections
   ========================================================================== */
.card { background: var(--bg-primary); border: 1px solid var(--border-secondary); border-radius: var(--r-xl); box-shadow: var(--shadow-xs); }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; padding: var(--sp-xl); border-bottom: 1px solid var(--border-secondary); }
.card-header h2 { font-size: var(--fs-md); font-weight: 600; margin-bottom: 2px; }
.card-header p { font-size: var(--fs-sm); color: var(--text-tertiary); }
.card-body { padding: var(--sp-xl); }
.section-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-xl); }
.section-label span.label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-700); font-family: var(--font-mono); }
.section-label h2 { font-size: var(--fs-display-xs); font-weight: 600; margin-top: 2px; }

/* Callout / banner */
.callout { display: flex; gap: var(--sp-lg); padding: var(--sp-xl); border-radius: var(--r-xl); border: 1px solid; margin-bottom: var(--sp-3xl); position: relative; }
.callout .icon-wrap { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.callout h2, .callout h4 { font-size: var(--fs-sm); font-weight: 600; margin-bottom: 2px; }
.callout p { font-size: var(--fs-sm); line-height: var(--lh-sm); }
.callout:has(.close-x) h4 { padding-right: 20px; }
.callout .close-x { position: absolute; top: var(--sp-lg); right: var(--sp-lg); color: var(--fg-quaternary); background: none; border: none; }
.callout-warning { background: var(--warning-50); border-color: var(--warning-200); }
.callout-warning .icon-wrap { background: var(--warning-100); color: var(--warning-700); }
.callout-warning h4 { color: var(--warning-700); }
.callout-warning p { color: var(--warning-700); }
.callout-info { background: var(--blue-50); border-color: var(--blue-200); }
.callout-info .icon-wrap { background: var(--blue-100); color: var(--blue-700); }
.callout-info h4 { color: var(--blue-700); }
.callout-info p { color: var(--text-secondary); }
.callout-brand { background: var(--brand-50); border-color: var(--brand-200); }
.callout-brand .icon-wrap { background: var(--brand-200); color: var(--brand-700); }
.callout-brand h2, .callout-brand h4 { color: var(--brand-700); }
.callout-brand p { color: var(--text-secondary); }

/* ==========================================================================
   Modals
   ========================================================================== */
.overlay {
  position: fixed; inset: 0; background: rgba(16,24,40,.55); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: var(--sp-3xl);
}
.overlay.open { display: flex; }
.modal { background: var(--bg-primary); border-radius: var(--r-2xl); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column; animation: modal-in .18s ease; }
.modal.modal-wide { max-width: 720px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-lg); padding: var(--sp-2xl) var(--sp-2xl) var(--sp-xl); border-bottom: 1px solid var(--border-secondary); }
.modal-header .modal-icon { width: 44px; height: 44px; border-radius: var(--r-md); border: 1px solid var(--border-secondary); display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); margin-bottom: var(--sp-lg); }
.modal-header h3 { font-size: var(--fs-lg); font-weight: 600; margin-bottom: var(--sp-xs); }
.modal-header p { font-size: var(--fs-sm); color: var(--text-tertiary); }
.modal-header .close-x { background: none; border: none; color: var(--fg-quaternary); flex-shrink: 0; }
.modal-body { padding: var(--sp-2xl); overflow-y: auto; flex: 1; }
.modal-actions { display: flex; gap: var(--sp-lg); padding: var(--sp-xl) var(--sp-2xl); border-top: 1px solid var(--border-secondary); }
.modal-actions .btn { flex: 1; justify-content: center; }

.form-row { margin-bottom: var(--sp-xl); }
.form-row label { display: block; font-size: var(--fs-sm); font-weight: 500; color: var(--text-secondary); margin-bottom: var(--sp-sm); }
.form-row .hint { font-size: var(--fs-sm); color: var(--text-quaternary); margin-top: var(--sp-xs); }
/* .form-row-settings, added 2026-08-31: a full-width settings-style page (confirmed via a
   real screenshot, Enterprise Wallet > Profile) pairs a label+caption on the left with its
   control on the right, in the same row - unlike this file's own .form-row default (correct
   for narrow modals, e.g. "Acquire a new Credential"). A modifier, not a change to .form-row
   itself, since both real shapes are evidenced. See pattern_form.md v1.5. */
.form-row-settings { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: var(--sp-xl); align-items: start; }
.form-row-settings label { margin-bottom: var(--sp-xs); }
.form-row-settings .hint { margin-top: 0; }
@media (max-width: 720px) { .form-row-settings { grid-template-columns: 1fr; } }
.form-input, .form-textarea, .form-select {
  width: 100%; border: 1px solid var(--border-primary); border-radius: var(--r-md); padding: var(--sp-lg);
  font-size: var(--fs-sm); color: var(--text-primary); background: var(--bg-primary);
}
/* REVERSED 2026-09-02 (role_design_experience_lead, direct instruction): the 2026-08-31 override below
   making .form-select shorter than plain text inputs is retired - dropdowns must have the same height
   as text fields (.form-input/.form-textarea), confirmed directly against wallet-profile.html's Type
   dropdown sitting visibly shorter than its Display Name / Identifier fields above it. .form-select now
   inherits the shared padding from the .form-input, .form-textarea, .form-select rule above with no
   override - kept as an explicit empty-rule marker rather than silently deleting the selector, so this
   reversal stays visible in the stylesheet itself, not only in DesignOS prose. */
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-placeholder); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-input:focus, .form-textarea:focus, .form-select:focus { outline: 2px solid var(--accent-cyan); outline-offset: 2px; border-color: var(--brand-700); }
.form-input.error, .form-textarea.error { border-color: var(--error-500); }
.error-text { display: flex; align-items: center; gap: 4px; color: var(--error-700); font-size: var(--fs-sm); margin-top: var(--sp-xs); }
.error-text .icon { width: 14px; height: 14px; }

.tab-underline-group { display: flex; gap: var(--sp-3xl); border-bottom: 1px solid var(--border-secondary); margin-bottom: var(--sp-xl); }
.tab-underline { background: none; border: none; appearance: none; text-align: left; cursor: pointer; padding: var(--sp-lg) 0; font-size: var(--fs-sm); font-weight: 600; color: var(--text-quaternary); border-bottom: 2px solid transparent; margin-bottom: -1px; } /* background/border reset added 2026-08-31: this class is also used on real <button> elements (e.g. user-settings.html), which carry native browser chrome unless explicitly reset -- <a>-based usages were unaffected but looked fine by accident */
.tab-underline.active { color: var(--brand-700); border-color: var(--brand-700); }

.toggle-row { display: flex; align-items: center; gap: var(--sp-lg); padding: var(--sp-lg) 0; border-bottom: 1px solid var(--border-secondary); margin-bottom: var(--sp-xl); }
.toggle-row label { margin: 0; font-size: var(--fs-sm); font-weight: 500; color: var(--text-secondary); }
.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track { position: absolute; inset: 0; background: var(--gray-200); border-radius: var(--r-full); transition: .15s; cursor: pointer; }
.switch-track::before { content: ''; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: var(--shadow-xs); }
.switch input:checked + .switch-track { background: var(--btn-primary-bg); }
.switch input:checked + .switch-track::before { transform: translateX(18px); }

.checkbox-card { display: flex; gap: var(--sp-lg); padding: var(--sp-lg); border: 1px solid var(--border-secondary); border-radius: var(--r-lg); margin-bottom: var(--sp-lg); }
.checkbox-card input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--btn-primary-bg); }
.checkbox-card strong { font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); display: block; margin-bottom: 2px; }
.checkbox-card span.desc { font-size: var(--fs-sm); color: var(--text-tertiary); line-height: var(--lh-sm); }

.status-illustration { display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--sp-3xl) var(--sp-2xl); }
.status-illustration .icon-circle { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: var(--sp-xl); }
.status-illustration.success .icon-circle { background: var(--success-100); color: var(--success-600); }
.status-illustration h3 { font-size: var(--fs-lg); font-weight: 600; margin-bottom: var(--sp-xs); }
.status-illustration p { color: var(--text-tertiary); font-size: var(--fs-sm); }

.progress-ring-wrap { position: relative; width: 140px; height: 140px; margin: 0 auto var(--sp-xl); }
.progress-ring-wrap svg { transform: rotate(-90deg); }
.progress-ring-bg { fill: none; stroke: var(--gray-100); stroke-width: 10; }
.progress-ring-fg { fill: none; stroke: var(--btn-primary-bg); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .3s ease; }
.progress-ring-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: var(--fs-display-xs); font-weight: 700; }

/* ==========================================================================
   Slide-over panel
   ========================================================================== */
.slideover-scrim { position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 90; display: none; }
.slideover-scrim.open { display: block; }
.slideover {
  position: fixed; top: 0; right: -440px; width: 420px; height: 100vh; background: var(--bg-primary);
  box-shadow: var(--shadow-lg); z-index: 95; transition: right .22s ease; overflow-y: auto;
  border-left: 1px solid var(--border-secondary);
}
.slideover.open { right: 0; }
.slideover-header { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-xl) var(--sp-2xl); border-bottom: 1px solid var(--border-secondary); }
.slideover-header h3 { font-size: var(--fs-lg); font-weight: 600; }
.slideover-header button { background: none; border: none; color: var(--fg-quaternary); }
.slideover-body { padding: var(--sp-2xl); }
.slideover-profile { text-align: left; margin-bottom: var(--sp-2xl); }
.slideover-avatar-wrap { position: relative; width: 96px; height: 96px; margin-bottom: var(--sp-xl); }
.slideover-avatar { width: 96px; height: 96px; border-radius: 50%; background: var(--gray-100); display: flex; align-items: center; justify-content: center; font-size: var(--fs-display-sm); font-weight: 700; color: var(--text-tertiary); }
.verified-check { position: absolute; bottom: -2px; right: -2px; width: 28px; height: 28px; border-radius: 50%; background: var(--blue-500); color: #fff; display: flex; align-items: center; justify-content: center; border: 3px solid var(--bg-primary); }
.slideover-profile h2 { font-size: var(--fs-display-xs); font-weight: 600; margin-bottom: 2px; }
.slideover-profile .email { color: var(--text-tertiary); font-size: var(--fs-sm); margin-bottom: var(--sp-xl); }
.slideover-actions { display: flex; gap: var(--sp-md); margin-bottom: var(--sp-2xl); }
.slideover-section { padding: var(--sp-xl) 0; border-top: 1px solid var(--border-secondary); }
.slideover-section:first-of-type { border-top: none; padding-top: 0; }
.slideover-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-lg); }
.slideover-section-head h4 { font-size: var(--fs-md); font-weight: 600; }
.slideover-section-head .icon { color: var(--success-600); }
.kv-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-lg); }
.kv-row .k { font-size: var(--fs-sm); color: var(--text-quaternary); }
.kv-row .v { font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: var(--sp-sm); }
.kv-row .v button { background: none; border: none; color: var(--fg-quaternary); display: flex; }
.slideover-address { color: var(--text-primary); font-weight: 600; font-size: var(--fs-sm); line-height: var(--lh-sm); margin-bottom: var(--sp-lg); }
.slideover-map { width: 100%; height: 140px; border-radius: var(--r-lg); background: linear-gradient(135deg, #eef2f6, #e3e9ef); border: 1px solid var(--border-secondary); position: relative; overflow: hidden; }
.slideover-map svg { width: 100%; height: 100%; }
.log-table { width: 100%; font-size: var(--fs-sm); }
.log-table th { text-align: left; color: var(--text-quaternary); font-weight: 600; padding-bottom: var(--sp-sm); border-bottom: 1px solid var(--border-secondary); }
.log-table td { padding: var(--sp-md) 0; color: var(--text-secondary); border-bottom: 1px solid var(--border-tertiary); }

/* Tabs inside slideover (contact detail tabs) */
.slideover-tabs { display: flex; gap: var(--sp-xs); overflow-x: auto; margin: 0 calc(var(--sp-2xl) * -1) var(--sp-xl); padding: 0 var(--sp-2xl); border-bottom: 1px solid var(--border-secondary); }
.slideover-tab { padding: var(--sp-md) var(--sp-lg); font-size: var(--fs-sm); font-weight: 600; color: var(--text-quaternary); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.slideover-tab.active { color: var(--brand-700); border-color: var(--brand-700); }

/* Toast */
.toast-wrap { position: fixed; bottom: var(--sp-3xl); right: var(--sp-3xl); z-index: 200; display: flex; flex-direction: column; gap: var(--sp-md); }
.toast { display: flex; align-items: center; gap: var(--sp-md); background: var(--text-primary); color: #fff; padding: var(--sp-lg) var(--sp-xl); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); font-size: var(--fs-sm); font-weight: 500; animation: toast-in .2s ease; }
.toast .icon { color: var(--success-500); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Grids for dashboard */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-xl); margin-bottom: var(--sp-xl); }
.dash-donut-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-xl); margin-bottom: var(--sp-xl); }
.donut-chart-row { display: flex; align-items: center; gap: var(--sp-lg); }
.donut-wrap { position: relative; width: 128px; height: 128px; flex-shrink: 0; margin: 0; }
.donut-legend { display: flex; flex-direction: column; gap: var(--sp-sm); font-size: var(--fs-xs); }
.donut-legend .row { display: flex; align-items: center; gap: var(--sp-sm); color: var(--text-tertiary); }
.donut-legend .swatch { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Compliance card variants: meter / sparkline / stacked bar (donut variant above) */
.stat-value-row { display: flex; align-items: baseline; gap: var(--sp-sm); margin-bottom: var(--sp-lg); }
.stat-value-row .num { font-size: var(--fs-lg); font-weight: 700; color: var(--text-primary); }
.stat-value-row .unit { font-size: var(--fs-xs); color: var(--text-quaternary); }
.meter-track { width: 100%; height: 10px; border-radius: var(--r-full); overflow: hidden; margin-bottom: var(--sp-lg); }
.meter-fill { height: 100%; border-radius: var(--r-full); }
.stacked-bar { display: flex; gap: 2px; width: 100%; height: 10px; background: var(--bg-primary); border-radius: var(--r-full); overflow: hidden; margin-bottom: var(--sp-lg); }
.stacked-bar-seg { height: 100%; }
.sparkline-row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-md); margin-bottom: var(--sp-md); }
.bar-row { display: flex; align-items: center; gap: var(--sp-lg); margin-bottom: var(--sp-lg); }
.bar-row .label { width: 96px; font-size: var(--fs-sm); color: var(--text-secondary); font-weight: 500; flex-shrink: 0; }
.bar-track { flex: 1; height: 8px; background: var(--gray-100); border-radius: var(--r-full); overflow: hidden; }
.bar-fill { height: 100%; background: var(--btn-primary-bg); border-radius: var(--r-full); }
.bar-row .val { font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); width: 40px; text-align: right; }

.mini-tile-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-md); margin-top: var(--sp-lg); }
.mini-tile { padding: var(--sp-lg); border-radius: var(--r-lg); text-align: center; }
.mini-tile .num { font-size: var(--fs-display-xs); font-weight: 700; }
.mini-tile .lbl { font-size: var(--fs-xs); margin-top: 2px; }
.mini-tile.error { background: var(--error-50); } .mini-tile.error .num, .mini-tile.error .lbl { color: var(--error-700); }
.mini-tile.warning { background: var(--warning-50); } .mini-tile.warning .num, .mini-tile.warning .lbl { color: var(--warning-700); }
.mini-tile.success { background: var(--success-50); } .mini-tile.success .num, .mini-tile.success .lbl { color: var(--success-700); }

.stage-pill-row { display: flex; gap: var(--sp-md); margin-bottom: var(--sp-lg); }
.stage-tile { flex: 1; border-radius: var(--r-lg); padding: var(--sp-lg); text-align: center; }
.stage-tile .num { font-size: var(--fs-display-xs); font-weight: 700; }
.stage-tile .lbl { font-size: var(--fs-xs); margin-top: 2px; }
.stage-tile.a { background: var(--error-50); } .stage-tile.a .num,.stage-tile.a .lbl{ color: var(--error-700);}
.stage-tile.b { background: var(--blue-50); } .stage-tile.b .num,.stage-tile.b .lbl{ color: var(--blue-700);}
.stage-tile.c { background: var(--success-50); } .stage-tile.c .num,.stage-tile.c .lbl{ color: var(--success-700);}

.mini-list-row { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-md) 0; border-bottom: 1px solid var(--border-tertiary); font-size: var(--fs-sm); }
.mini-list-row:last-child { border-bottom: none; }
.mini-list-row .name { font-weight: 600; color: var(--text-primary); }
.mini-list-row .sub { color: var(--text-quaternary); font-size: var(--fs-xs); }

.quick-actions-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-xl); margin-bottom: var(--sp-3xl); }
.quick-action { display: flex; align-items: center; gap: var(--sp-lg); padding: var(--sp-xl); }
.quick-action .icon-wrap { width: 44px; height: 44px; border-radius: var(--r-lg); background: var(--brand-50); color: var(--brand-700); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.quick-action strong { display: block; font-size: var(--fs-sm); font-weight: 600; margin-bottom: 2px; }
.quick-action span.desc { font-size: var(--fs-sm); color: var(--text-tertiary); }
.quick-action { cursor: pointer; }
.quick-action:hover { border-color: var(--border-primary); }

.filter-bar { display: flex; gap: var(--sp-lg); align-items: center; margin-bottom: var(--sp-xl); }
/* DesignOS (2026-08-31, role_design_experience_lead, direct instruction): lowered from --sp-md --sp-lg. */
.select-input { display: flex; align-items: center; gap: var(--sp-sm); border: 1px solid var(--border-primary); border-radius: var(--r-md); padding: var(--sp-sm) var(--sp-lg); font-size: var(--fs-sm); font-weight: 500; color: var(--text-secondary); background: var(--bg-primary); }
.select-input .icon { color: var(--fg-quaternary); width: 16px; height: 16px; }

.wizard-steps { display: flex; align-items: center; margin-bottom: var(--sp-3xl); }
.wizard-step { display: flex; align-items: center; gap: var(--sp-md); }
.wizard-step .dot { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border-primary); display: flex; align-items: center; justify-content: center; font-size: var(--fs-sm); font-weight: 600; color: var(--text-quaternary); background: var(--bg-primary); flex-shrink: 0; }
.wizard-step.done .dot { background: var(--btn-primary-bg); border-color: var(--btn-primary-bg); color: #fff; }
.wizard-step.current .dot { border-color: var(--btn-primary-bg); color: var(--btn-primary-bg); }
.wizard-step .label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-quaternary); }
.wizard-step.current .label, .wizard-step.done .label { color: var(--text-primary); }
.wizard-connector { width: 64px; height: 2px; background: var(--border-secondary); margin: 0 var(--sp-lg); }
.wizard-connector.done { background: var(--btn-primary-bg); }

.locked-panel { position: relative; opacity: .6; filter: grayscale(.3); pointer-events: none; }
.locked-banner { display: flex; align-items: center; gap: var(--sp-md); background: var(--gray-50); border: 1px dashed var(--border-primary); border-radius: var(--r-lg); padding: var(--sp-lg); margin-bottom: var(--sp-xl); }
.locked-banner .icon { color: var(--text-quaternary); }
.locked-banner strong { font-size: var(--fs-sm); color: var(--text-secondary); }
.locked-banner span { font-size: var(--fs-xs); color: var(--text-quaternary); }

.hidden { display: none !important; }

@media (max-width: 1080px) {
  .metric-row, .metric-row.cols-4, .dash-donut-row { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: -288px; z-index: 80; transition: left .2s ease; }
  .sidebar.open { left: 0; }
  .page-content, .topbar { padding-left: var(--sp-xl); padding-right: var(--sp-xl); }
  .metric-row, .metric-row.cols-4, .dash-donut-row, .quick-actions-row { grid-template-columns: 1fr; }
  .data-table-wrap { overflow-x: auto; }
}

/* ==========================================================================
   Reference-Minimal additions (2026-08-28)
   Everything below extends the addressbook prototype's shared stylesheet for
   screens/components that prototype did not yet need. Each block cites the
   DesignOS Pattern it implements.
   ========================================================================== */

/* Company-Block "Test" environment badge — real markup convention from
   design-mockups/Design Guide/product-caro.html (.topbar-org .test-badge). */
.topbar-org .org-name { display: flex; align-items: center; gap: var(--sp-sm); }
.test-badge {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .06em;
  padding: 2px 6px; border-radius: 3px; font-weight: 700; text-transform: uppercase;
  color: var(--accent-caro-700); background: var(--accent-caro-50);
}
/* MADE INTERACTIVE 2026-08-31 (role_design_experience_lead) - see app.js's renderTopbar() comment.
   .topbar-org itself already has cursor:pointer + a hover state from the shared addressbook stylesheet
   above; this override, which forced a static cursor while the Company-menu content was unresolved, is
   removed now that it is resolved. .company-menu/.company-menu-item/.company-menu-divider are also
   inherited unchanged from that shared stylesheet - no new CSS needed for this menu. */

/* Topbar avatar-initials icon button — used for the User Settings entry point.
   No generic "user" icon exists in this sprite (component_ui_side_nav v1.4
   notes the same gap), so this reuses the .icon-btn shape with initials text
   instead of inventing a new icon. */
.avatar-icon-btn { font-family: var(--font-mono); font-size: 11px; font-weight: 700; }

/* ---- pattern_selection_grid: single-select radio-card grid ---- */
.radio-card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-lg); margin-bottom: var(--sp-xl); }
.radio-card {
  position: relative; display: flex; flex-direction: column; gap: var(--sp-sm);
  padding: var(--sp-xl); border: 1px solid var(--border-primary); border-radius: var(--r-lg);
  cursor: pointer; background: var(--bg-primary);
}
.radio-card input { position: absolute; top: var(--sp-lg); right: var(--sp-lg); width: 18px; height: 18px; accent-color: var(--btn-primary-bg); }
.radio-card .icon-wrap { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--gray-100); color: var(--text-tertiary); display: flex; align-items: center; justify-content: center; }
.radio-card strong { font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); padding-right: var(--sp-2xl); }
.radio-card span.desc { font-size: var(--fs-sm); color: var(--text-tertiary); }
.radio-card:hover { border-color: var(--border-primary); background: var(--bg-active); }
.radio-card:has(input:checked) { border-color: var(--btn-primary-bg); border-width: 2px; box-shadow: 0 0 0 1px var(--btn-primary-bg) inset; background: var(--brand-50); }
.radio-card:has(input:checked) .icon-wrap { background: var(--brand-700); color: #fff; }
.radio-card:has(input:focus-visible) { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }

/* ---- pattern_filter_builder: Filters button + two-level flyout ---- */
.filter-flyout-wrap { position: relative; }
.filter-flyout {
  position: absolute; top: calc(100% + 8px); left: 0; width: 260px; z-index: 40;
  background: var(--bg-primary); border: 1px solid var(--border-secondary); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); padding: var(--sp-sm); display: none;
}
.filter-flyout.open { display: block; }
.filter-flyout-back { display: flex; align-items: center; gap: var(--sp-sm); padding: var(--sp-md) var(--sp-lg); font-size: var(--fs-sm); font-weight: 600; color: var(--text-tertiary); border-bottom: 1px solid var(--border-secondary); margin-bottom: var(--sp-sm); }
.filter-flyout-back .icon { width: 16px; height: 16px; }
.filter-flyout-item { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-md) var(--sp-lg); border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: 500; color: var(--text-secondary); }
.filter-flyout-item:hover { background: var(--bg-active); cursor: pointer; }
.filter-flyout-item .icon { width: 16px; height: 16px; color: var(--fg-quaternary); }
.filter-flyout-checkbox { display: flex; align-items: center; gap: var(--sp-md); padding: var(--sp-md) var(--sp-lg); font-size: var(--fs-sm); color: var(--text-secondary); }
.filter-flyout-checkbox input { accent-color: var(--btn-primary-bg); width: 16px; height: 16px; }
.filter-flyout-apply { display: flex; gap: var(--sp-sm); padding: var(--sp-sm); border-top: 1px solid var(--border-secondary); margin-top: var(--sp-sm); }
.filter-flyout-apply .btn { flex: 1; justify-content: center; }
.active-filter-chip { display: inline-flex; align-items: center; gap: var(--sp-xs); font-size: var(--fs-xs); font-weight: 600; padding: 4px 10px; border-radius: var(--r-full); background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-200); }
.active-filter-row { display: flex; gap: var(--sp-sm); margin-bottom: var(--sp-lg); flex-wrap: wrap; }

/* A minimal date-range picker — real evidence (pattern_filter_builder) is that
   "Created" opens a calendar range-picker rather than a typed field; this is
   the simplest compliant rendering of that requirement, not a full calendar
   widget. */
.date-range-picker { padding: var(--sp-lg); }
.date-range-inputs { display: flex; gap: var(--sp-md); margin-bottom: var(--sp-md); }
.date-range-inputs input { flex: 1; }
.mini-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: var(--fs-xs); color: var(--text-tertiary); }
.mini-calendar .day { padding: var(--sp-sm) 0; border-radius: var(--r-sm); }
.mini-calendar .day.in-range { background: var(--brand-50); color: var(--brand-700); }
.mini-calendar .day.today { font-weight: 700; color: var(--text-primary); }

/* ---- Settings General tab: link-out cards (pattern_settings Flow step 5) ---- */
.linkout-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-lg); }
.linkout-card { display: flex; align-items: center; gap: var(--sp-lg); padding: var(--sp-xl); border: 1px solid var(--border-secondary); border-radius: var(--r-xl); background: var(--bg-primary); }
.linkout-card:hover { border-color: var(--border-primary); background: var(--bg-active); }
.linkout-card .icon-wrap { width: 44px; height: 44px; border-radius: var(--r-lg); background: var(--brand-50); color: var(--brand-700); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.linkout-card strong { display: block; font-size: var(--fs-sm); font-weight: 600; margin-bottom: 2px; }
.linkout-card span.desc { font-size: var(--fs-sm); color: var(--text-tertiary); }
.linkout-card .icon.ext { margin-left: auto; color: var(--fg-quaternary); flex-shrink: 0; }

/* ---- Disabled tab (pattern_user_profile: Notifications, "present but
   disabled" — a named, honest gap, not hidden and not built as functional) ---- */
.tab-underline.disabled, .tab-pill.disabled {
  color: var(--fg-senary); cursor: not-allowed; pointer-events: none;
}
.tab-underline.disabled .tab-note, .tab-pill.disabled .tab-note {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  margin-left: var(--sp-xs); color: var(--fg-quaternary);
}

/* ---- pattern_messaging: Inbox list + thread detail + data-proposal card ---- */
.inbox-list { display: flex; flex-direction: column; }
.inbox-row { display: grid; grid-template-columns: 1fr 90px 2fr 110px; align-items: center; gap: var(--sp-lg); padding: var(--sp-lg) var(--sp-xl); border-bottom: 1px solid var(--border-secondary); }
.inbox-row:last-child { border-bottom: none; }
.inbox-row:hover { background: var(--bg-active); cursor: pointer; }
.inbox-row .counterparty { font-weight: 600; color: var(--text-primary); font-size: var(--fs-sm); }
.inbox-row .subject { color: var(--text-secondary); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-row .ref { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-quaternary); text-align: right; }

.thread-message { padding: var(--sp-xl); border-bottom: 1px solid var(--border-secondary); }
.thread-message:last-child { border-bottom: none; }
.thread-message-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--sp-sm); }
.thread-message-head strong { font-size: var(--fs-sm); color: var(--text-primary); }
.thread-message-head span.time { font-size: var(--fs-xs); color: var(--text-quaternary); }
.thread-message p { font-size: var(--fs-sm); color: var(--text-secondary); line-height: var(--lh-sm); }

.data-proposal-card { margin-top: var(--sp-lg); border: 1px solid var(--brand-200); background: var(--brand-50); border-radius: var(--r-lg); padding: var(--sp-lg); }
.data-proposal-card h4 { font-size: var(--fs-sm); font-weight: 600; color: var(--brand-700); margin-bottom: var(--sp-md); }
.data-proposal-fields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-md) var(--sp-xl); margin-bottom: var(--sp-lg); }
.data-proposal-fields .k { font-size: var(--fs-xs); color: var(--text-quaternary); text-transform: uppercase; letter-spacing: .02em; }
.data-proposal-fields .v { font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); }

/* ---- pattern_form: grouped-section composition (Contact modal) ---- */
.form-group-label { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-quaternary); font-family: var(--font-mono); margin: var(--sp-2xl) 0 var(--sp-lg); }
.form-group-label:first-child { margin-top: 0; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-lg); margin-bottom: var(--sp-xl); }
.form-row-2 .form-row { margin-bottom: 0; }

/* ---- Company Profile / logo upload dropzone ---- */
.upload-dropzone { display: flex; align-items: center; gap: var(--sp-lg); border: 1px dashed var(--border-primary); border-radius: var(--r-lg); padding: var(--sp-xl); }
.upload-dropzone { cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.upload-dropzone.dropzone-active { border-color: var(--brand-700); background: var(--gray-50); }
.upload-dropzone-prompt { display: flex; align-items: center; gap: var(--sp-lg); flex: 1; min-width: 0; }
.upload-file-list { display: flex; flex-direction: column; gap: var(--sp-sm); margin-top: var(--sp-sm); }
.upload-file-row { display: flex; align-items: center; gap: var(--sp-sm); padding: var(--sp-sm) var(--sp-md); border: 1px solid var(--border-secondary); border-radius: var(--r-md); font-size: var(--fs-sm); }
.upload-file-row .icon { color: var(--fg-quaternary); flex-shrink: 0; }
.upload-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.upload-file-size { color: var(--text-quaternary); font-size: var(--fs-xs); flex-shrink: 0; }

.upload-dropzone .icon-wrap { width: 44px; height: 44px; border-radius: var(--r-lg); background: var(--gray-100); color: var(--fg-quaternary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.upload-dropzone strong { display: block; font-size: var(--fs-sm); font-weight: 600; }
.upload-dropzone span.desc { font-size: var(--fs-xs); color: var(--text-quaternary); }

/* Read-only field treatment (pattern_company_profile: Identifier is read-only) */
.form-input[readonly] { background: var(--bg-secondary); color: var(--text-tertiary); cursor: not-allowed; }

/* Issuer trust badge — paired with status, never shown alone (pattern_wallet) */
.issuer-badge { display: inline-flex; align-items: center; gap: var(--sp-xs); font-size: var(--fs-xs); font-weight: 600; color: var(--text-secondary); }
.issuer-badge .icon { width: 14px; height: 14px; color: var(--success-600); }

@media (max-width: 720px) {
  .radio-card-grid, .linkout-grid, .form-row-2, .data-proposal-fields { grid-template-columns: 1fr; }
  .inbox-row { grid-template-columns: 1fr; gap: var(--sp-xs); }
}

/* Contact Detail page (D9/D12, 2026-08-31, role_design_experience_lead): the Location/Credentials cards'
   dark square icon-wrap, and a compact pill-style sub-tab group for the Communication tab's
   View All/Incoming/Outgoing toggle - reproduced from the real screenshot's anatomy. */
.detail-icon-wrap { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--brand-700); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.subtab-group { display: flex; gap: var(--sp-sm); }
.subtab { display: flex; align-items: center; gap: var(--sp-xs); background: var(--bg-primary); border: 1px solid var(--border-primary); border-radius: var(--r-md); padding: var(--sp-sm) var(--sp-lg); font-size: var(--fs-sm); font-weight: 500; color: var(--text-secondary); cursor: pointer; }
.subtab.active { background: var(--text-primary); border-color: var(--text-primary); color: #fff; }
.subtab:not(.active):hover { background: var(--bg-active); }
