/* Essence — semantic theme aliases. THREE themes, resolved in this order:
     1. [data-essence-theme="..."]  — the user's stored choice (light | dark | high-contrast), always wins
     2. prefers-contrast: more      — the platform high-contrast affordance (an accessibility NEED)
     3. light, as the base — the PRIMARY Essence theme
   Light is the base because it is the primary Essence theme, not merely the fallback: transparency
   is the product, and a light ground states it. Dark ships complete and validated, but only when a
   user asks for it. */
:root{
  --bg-page:#F5F5F8;--bg-sidebar:#FFFFFF;--bg-card:#FFFFFF;--bg-surface:#FFFFFF;--bg-elevated:#FFFFFF;--bg-input:#FFFFFF;
  --border-default:#E0E1E8;--border-subtle:#D8DAE5;--border-focus:#2280A3;
  --text-primary:#161828;--text-secondary:#525880;--text-muted:#6E7291;--text-dim:#8E92AB;--text-on-accent:#FFFFFF;
  --interactive-primary:#2280A3;--interactive-primary-hover:#2A97BD;--interactive-secondary:#148968;
  --interactive-destructive:#C00D45;--interactive-ghost:rgba(34,128,163,0.08);
  --status-encrypted:#148968;--status-verified:#2280A3;--status-shared:#7710A0;--status-shared-text:#7710A0;--status-active:#148968;
  --status-pending:#B47800;--status-expiring:#B47800;--status-revoked:#C00D45;--status-expired:#8E92AB;
  --status-success:#148968;--status-warning:#B47800;--status-error:#C00D45;--status-info:#4F46E5;
  --gradient-brand:linear-gradient(135deg,#2280A3,#148968); /* @kind other */
  --gradient-wave:linear-gradient(90deg,rgba(20,137,104,0.12),rgba(34,128,163,0.08)); /* @kind other */
  --blob-crimson-opacity:0.03; /* @kind other */--blob-emerald-opacity:0.03; /* @kind other */
}
/* Dark is NOT applied from prefers-color-scheme. Essence is light-first on purpose: the product's
   claim is transparency, and the light theme is the one that looks like it has nothing to hide. Dark
   is a first-class, fully-specified USER CHOICE — [data-essence-theme='dark'] below — never a
   platform default that silently replaces the validated primary theme. */
@media (prefers-contrast:more){:root{
  --bg-page:#FFFFFF;--bg-sidebar:#FFFFFF;--bg-card:#FFFFFF;--bg-surface:#FFFFFF;--bg-elevated:#FFFFFF;--bg-input:#FFFFFF;
  --border-default:#000000;--border-subtle:#161828;--border-focus:#000000;
  --text-primary:#000000;--text-secondary:#161828;--text-muted:#31344D;--text-dim:#31344D;--text-on-accent:#FFFFFF;
  --interactive-primary:#0B4A61;--interactive-primary-hover:#062E3D;--interactive-secondary:#0A4433;
  --interactive-destructive:#8A0322;--interactive-ghost:rgba(0,0,0,0.12);
  --status-encrypted:#0A4433;--status-verified:#0B4A61;--status-shared:#3B1C6B;--status-shared-text:#3B1C6B;--status-active:#0A4433;
  --status-pending:#6B3F00;--status-expiring:#6B3F00;--status-revoked:#8A0322;--status-expired:#31344D;
  --status-success:#0A4433;--status-warning:#6B3F00;--status-error:#8A0322;--status-info:#0B4A61;
  --gradient-brand:#0B4A61; /* @kind other */--gradient-wave:#FFFFFF; /* @kind other */
  --blob-crimson-opacity:0; /* @kind other */--blob-emerald-opacity:0; /* @kind other */
}}
[data-essence-theme='light']{
  --bg-page:#F5F5F8;--bg-sidebar:#FFFFFF;--bg-card:#FFFFFF;--bg-surface:#FFFFFF;--bg-elevated:#FFFFFF;--bg-input:#FFFFFF;
  --border-default:#E0E1E8;--border-subtle:#D8DAE5;--border-focus:#2280A3;
  --text-primary:#161828;--text-secondary:#525880;--text-muted:#6E7291;--text-dim:#8E92AB;--text-on-accent:#FFFFFF;
  --interactive-primary:#2280A3;--interactive-primary-hover:#2A97BD;--interactive-secondary:#148968;
  --interactive-destructive:#C00D45;--interactive-ghost:rgba(34,128,163,0.08);
  --status-encrypted:#148968;--status-verified:#2280A3;--status-shared:#7710A0;--status-shared-text:#7710A0;--status-active:#148968;
  --status-pending:#B47800;--status-expiring:#B47800;--status-revoked:#C00D45;--status-expired:#8E92AB;
  --status-success:#148968;--status-warning:#B47800;--status-error:#C00D45;--status-info:#4F46E5;
  --gradient-brand:linear-gradient(135deg,#2280A3,#148968); /* @kind other */
  --gradient-wave:linear-gradient(90deg,rgba(20,137,104,0.12),rgba(34,128,163,0.08)); /* @kind other */
  --blob-crimson-opacity:0.03; /* @kind other */--blob-emerald-opacity:0.03; /* @kind other */
}
[data-essence-theme='dark']{
  --bg-page:#0D0F1A;--bg-sidebar:#161828;--bg-card:#181B2C;--bg-surface:#20233A;--bg-elevated:#2E3252;--bg-input:#181B2C;
  --border-default:#2E3252;--border-subtle:#20233A;--border-focus:#33ADD3;
  --text-primary:#FFFFFF;--text-secondary:#B8BCCE;--text-muted:#8E92AB;--text-dim:#525880;--text-on-accent:#0D0F1A;
  --interactive-primary:#33ADD3;--interactive-primary-hover:#4DC3DB;--interactive-secondary:#20BEA0;
  --interactive-destructive:#EE1457;--interactive-ghost:rgba(51,173,211,0.10);
  --status-encrypted:#20BEA0;--status-verified:#33ADD3;--status-shared:#A516DE;--status-shared-text:#C77DEB;--status-active:#20BEA0;
  --status-pending:#EB9B0B;--status-expiring:#EB9B0B;--status-revoked:#EE1457;--status-expired:#6E7291;
  --status-success:#20BEA0;--status-warning:#EB9B0B;--status-error:#EE1457;--status-info:#6366F1;
  --gradient-brand:linear-gradient(135deg,#33ADD3,#20BEA0); /* @kind other */
  --gradient-wave:linear-gradient(90deg,rgba(32,190,160,0.15),rgba(51,173,211,0.08)); /* @kind other */
  --blob-crimson-opacity:0.08; /* @kind other */--blob-emerald-opacity:0.06; /* @kind other */
}
[data-essence-theme='high-contrast']{
  --bg-page:#FFFFFF;--bg-sidebar:#FFFFFF;--bg-card:#FFFFFF;--bg-surface:#FFFFFF;--bg-elevated:#FFFFFF;--bg-input:#FFFFFF;
  --border-default:#000000;--border-subtle:#161828;--border-focus:#000000;
  --text-primary:#000000;--text-secondary:#161828;--text-muted:#31344D;--text-dim:#31344D;--text-on-accent:#FFFFFF;
  --interactive-primary:#0B4A61;--interactive-primary-hover:#062E3D;--interactive-secondary:#0A4433;
  --interactive-destructive:#8A0322;--interactive-ghost:rgba(0,0,0,0.12);
  --status-encrypted:#0A4433;--status-verified:#0B4A61;--status-shared:#3B1C6B;--status-shared-text:#3B1C6B;--status-active:#0A4433;
  --status-pending:#6B3F00;--status-expiring:#6B3F00;--status-revoked:#8A0322;--status-expired:#31344D;
  --status-success:#0A4433;--status-warning:#6B3F00;--status-error:#8A0322;--status-info:#0B4A61;
  --gradient-brand:#0B4A61; /* @kind other */--gradient-wave:#FFFFFF; /* @kind other */
  --blob-crimson-opacity:0; /* @kind other */--blob-emerald-opacity:0; /* @kind other */
}

/* Focus, in every theme. :focus-visible so a mouse user isn't given a ring they didn't ask for,
   with a :focus fallback because losing the ring is worse than showing it. */
:focus{outline:2px solid var(--border-focus);outline-offset:2px}
:focus:not(:focus-visible){outline:none}
:focus-visible{outline:3px solid var(--border-focus);outline-offset:2px}
@media (prefers-contrast:more){:focus-visible{outline-width:4px}}
/* Forced-colors (Windows HC) replaces the palette entirely: keep the geometry, let the OS pick the colour. */
@media (forced-colors:active){:focus-visible{outline:3px solid CanvasText}}
