/* Salvaro Identity visual system (docs/product/DESIGN.md).
   One OKLCH token set drives all three locked shells:
   - Auth Card Shell (sign-in, passkey, magic link, consent, access denied, errors)
   - Account Workspace Shell (topbar + segmented nav: /account, later /account/apps)
   - Admin Console Shell (/admin-ui, adds admin.css)
   Colours use light-dark(), so a client theme that forces `color-scheme` (src/branding.ts)
   switches every token. Client themes set --brand-primary, --brand-primary-fg and --brand-bg. */

:root {
  color-scheme: light dark;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Surfaces: neutrals tinted towards the accent hue so nothing reads as dead grey. */
  --bg: var(--brand-bg, light-dark(oklch(98.2% 0.004 260), oklch(15% 0.012 260)));
  --surface: light-dark(oklch(100% 0 0), oklch(19.5% 0.014 260));
  --surface-2: light-dark(oklch(96.8% 0.005 260), oklch(23.5% 0.015 260));
  --border: light-dark(oklch(91% 0.008 260), oklch(29% 0.016 260));
  --border-strong: light-dark(oklch(84% 0.01 260), oklch(37% 0.018 260));
  --dot: light-dark(oklch(0% 0 0 / 0.09), oklch(100% 0 0 / 0.07));

  /* Text */
  --text: light-dark(oklch(22% 0.02 260), oklch(95% 0.006 260));
  --muted: light-dark(oklch(47% 0.018 260), oklch(73% 0.014 260));
  --subtle: light-dark(oklch(56% 0.015 260), oklch(64% 0.014 260));

  /* Primary action: the client's brand colour when set, otherwise ink. */
  --ink: var(--brand-primary, light-dark(oklch(22% 0.02 260), oklch(96% 0.006 260)));
  --on-ink: var(--brand-primary-fg, light-dark(oklch(99% 0 0), oklch(18% 0.014 260)));
  --accent: var(--brand-primary, light-dark(oklch(54% 0.14 255), oklch(72% 0.13 255)));
  --accent-bg: color-mix(in oklab, var(--accent) 12%, var(--surface));
  --ring: color-mix(in oklab, var(--accent) 38%, transparent);

  /* Semantic colours: status and destructive feedback only. */
  --success: light-dark(oklch(48% 0.12 155), oklch(78% 0.13 155));
  --success-bg: light-dark(oklch(96% 0.035 155), oklch(30% 0.05 155 / 0.5));
  --warning: light-dark(oklch(52% 0.12 70), oklch(82% 0.13 80));
  --warning-bg: light-dark(oklch(96.5% 0.04 85), oklch(32% 0.06 75 / 0.5));
  --danger: light-dark(oklch(52% 0.19 25), oklch(74% 0.15 25));
  --danger-bg: light-dark(oklch(96.5% 0.02 25), oklch(32% 0.07 25 / 0.45));

  --shadow-near: light-dark(oklch(22% 0.02 260 / 0.05), oklch(0% 0 0 / 0.3));
  --shadow-far: light-dark(oklch(22% 0.02 260 / 0.12), oklch(0% 0 0 / 0.5));
  --shadow: 0 1px 2px var(--shadow-near), 0 24px 48px -12px var(--shadow-far);

  /* 4px grid */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  font-family: var(--font);
  accent-color: var(--accent);
  scrollbar-color: var(--border-strong) transparent;
}

/* Explicit theme (dev gallery toggle) */
:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: color-mix(in oklab, var(--accent) 28%, transparent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Auth Card Shell backdrop: faint dot grid fading out from the centre. */
body:not(.ws-body),
.auth-frame {
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 22px 22px;
}

body:not(.ws-body) {
  background-attachment: fixed;
}

body:not(.ws-body)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse 70% 60% at 50% 42%, transparent 0%, var(--bg) 85%);
  pointer-events: none;
}

a {
  color: inherit;
}

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

/* Auth Card Shell: top bar, centred card, footer */

.shell {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  padding: 0 var(--s-4);
}

.topbar {
  width: 100%;
  max-width: 1120px;
  min-height: 70px;
  display: flex;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--on-ink);
  background: var(--ink);
}

.foot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--s-6) 0 28px;
  font-size: 13px;
  color: var(--subtle);
}

.foot .icon {
  width: 13px;
  height: 13px;
}

.card {
  align-self: center;
  width: 100%;
  max-width: 400px;
  margin: var(--s-4) 0;
  padding: 36px var(--s-8) var(--s-8);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: rise 0.45s var(--ease) both;
}

@media (max-width: 440px) {
  .card {
    padding: 28px var(--s-5) var(--s-6);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* Headings */

.head {
  text-align: center;
  margin-bottom: 28px;
}

h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

h1 strong {
  font-weight: inherit;
}

h2,
h3 {
  letter-spacing: -0.01em;
}

.sub {
  margin: var(--s-2) 0 0;
  color: var(--muted);
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.sub strong {
  color: var(--text);
  font-weight: 600;
}

.client-logo {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto var(--s-5);
  padding: 10px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.client-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.state-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 18px;
  border-radius: 50%;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.state-icon.danger {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: transparent;
}

.state-icon .icon {
  width: 22px;
  height: 22px;
}

/* Auth buttons. `.provider` is the full-width base button, `.btn-brand` the primary action. */

.providers {
  display: grid;
  gap: 10px;
}

.provider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 var(--s-4);
  font: inherit;
  font-weight: 550;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px var(--shadow-near);
  cursor: pointer;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease),
    box-shadow 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.provider:hover:not(:disabled) {
  background: var(--surface-2);
}

.provider:active:not(:disabled) {
  transform: translateY(1px);
}

.provider:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}

.provider:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn-brand {
  font-weight: 600;
  color: var(--on-ink);
  background: var(--ink);
  border-color: var(--ink);
}

.btn-brand:hover:not(:disabled) {
  background: color-mix(in oklab, var(--ink) 86%, var(--surface));
  border-color: transparent;
}

.secondary {
  color: var(--muted);
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.secondary:hover:not(:disabled) {
  color: var(--text);
}

.link-btn {
  color: var(--text);
}

/* Workspace buttons (account + admin): compact, one filled primary per view. */

.btn-primary,
.btn-secondary,
.btn-small,
.btn-danger,
.btn-destructive,
.btn-ghost {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.btn-small,
.btn-danger {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.btn-primary {
  color: var(--on-ink);
  background: var(--ink);
  border-color: var(--ink);
}

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

.btn-danger {
  color: var(--danger);
}

.btn-destructive {
  color: oklch(99% 0 0);
  background: light-dark(oklch(52% 0.19 25), oklch(58% 0.18 25));
  border-color: transparent;
}

:is(.btn-secondary, .btn-small, .btn-danger):hover:not(:disabled) {
  background: var(--surface-2);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface-2);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-bg);
  border-color: color-mix(in oklab, var(--danger) 40%, transparent);
}

:is(.btn-primary, .btn-destructive):hover:not(:disabled) {
  background: color-mix(in oklab, var(--ink) 86%, var(--surface));
}

.btn-destructive:hover:not(:disabled) {
  background: light-dark(oklch(47% 0.18 25), oklch(54% 0.18 25));
}

:is(.btn-primary, .btn-secondary, .btn-small, .btn-danger, .btn-destructive, .btn-ghost):active:not(:disabled) {
  transform: translateY(1px);
}

:is(.btn-primary, .btn-secondary, .btn-small, .btn-danger, .btn-destructive, .btn-ghost):disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

:is(.btn-primary, .btn-secondary, .btn-small, .btn-danger, .btn-destructive, .btn-ghost) .icon {
  width: 16px;
  height: 16px;
}

/* Busy: the button that started an action keeps full opacity and shows a spinner. */
button[aria-busy="true"] {
  opacity: 1 !important;
  cursor: progress;
}

button[aria-busy="true"] > * {
  visibility: hidden;
}

button[aria-busy="true"]::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}

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

.divider {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin: var(--s-1) 0;
  font-size: 13px;
  color: var(--subtle);
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.providers ~ .divider {
  margin: 22px 0 18px;
}

/* Forms (magic link, local password sign-in) */

.password {
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

.field > span,
.password > label {
  font-size: 13px;
  font-weight: 550;
}

.password input,
.search-input {
  width: 100%;
  min-height: 42px;
  padding: 0 var(--s-3);
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

:is(.password input, .search-input)::placeholder {
  color: var(--subtle);
}

:is(.password input, .search-input):focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}

.password .provider,
.password .status {
  margin-top: var(--s-1);
}

/* Consent */

.scopes {
  display: grid;
  gap: 2px;
  margin: 0 0 var(--s-6);
  padding: 6px;
  list-style: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.scopes li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--s-2) 10px;
  overflow-wrap: anywhere;
}

.scopes .icon {
  width: 16px;
  height: 16px;
  color: var(--success);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.note {
  margin: var(--s-5) 0 0;
  font-size: 13px;
  text-align: center;
  color: var(--subtle);
  text-wrap: pretty;
}

/* Account Workspace Shell: persistent topbar, segmented nav, user bar, workspace container. */

.ws-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
  container: ws-topbar / inline-size;
}

.ws-topbar-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "brand nav user";
  align-items: center;
  gap: var(--s-4);
  max-width: 1080px;
  min-height: 56px;
  margin: 0 auto;
  padding: var(--s-2) var(--s-4);
}

.ws-topbar .brand {
  grid-area: brand;
}

.seg-nav {
  grid-area: nav;
  justify-self: center;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.seg-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 var(--s-3);
  font-size: 14px;
  font-weight: 550;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  border-radius: 7px;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.seg-nav a:hover {
  color: var(--text);
}

.seg-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 2px var(--shadow-near), 0 0 0 1px var(--border);
}

.seg-nav .icon {
  width: 16px;
  height: 16px;
}

.ws-user {
  grid-area: user;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-width: 0;
}

.ws-email {
  max-width: 200px;
  overflow: hidden;
  font-size: 13px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--s-8) var(--s-4) 48px;
}

.ws-narrow {
  max-width: 720px;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-3) var(--s-6);
  margin-bottom: var(--s-6);
}

.page-head .sub {
  margin-top: var(--s-1);
}

/* Stack the topbar by its own width (also inside /_design frames), not the viewport. */
@container ws-topbar (max-width: 960px) {
  .ws-topbar-inner {
    grid-template-columns: auto 1fr;
    grid-template-areas: "brand user" "nav nav";
    gap: var(--s-2) var(--s-3);
  }

  .seg-nav {
    justify-self: stretch;
    display: flex;
  }

  .seg-nav a {
    flex: 1;
    justify-content: center;
  }

  .ws-email {
    display: none;
  }
}

@container ws-topbar (max-width: 400px) {
  .seg-nav a .icon {
    display: none;
  }
}

@media (max-width: 720px) {
  .ws-main {
    padding-top: var(--s-6);
  }
}

/* Workspace cards (account profile, passkeys) */

.ws-card {
  margin-bottom: var(--s-3);
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ws-card > h2 {
  margin: 0 0 var(--s-3);
  font-size: 15px;
  font-weight: 650;
}

.identity {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-width: 0;
}

.identity > div {
  display: grid;
  min-width: 0;
}

.identity + .identity-meta {
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--border);
}

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-weight: 650;
  color: var(--on-ink);
  background: var(--ink);
}

.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 13px;
}

.email {
  display: block;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.panel-head {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
}

.panel-head > div {
  flex: 1;
  min-width: 0;
}

.panel-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.panel-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}

.panel-head p {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.meta {
  display: flex;
  justify-content: space-between;
  margin: var(--s-4) 0;
  padding: var(--s-3) 0 0;
  font-size: 14px;
  border-top: 1px solid var(--border);
}

.meta dt {
  color: var(--muted);
}

.meta dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* App launcher pictogram grid (/account/apps from M1; previewed on /_design). */

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s-3);
}

.app-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-width: 0;
  padding: 14px;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.app-tile:hover {
  border-color: var(--border-strong);
  box-shadow: 0 6px 16px -10px var(--shadow-far);
  transform: translateY(-1px);
}

.app-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  overflow: hidden;
  color: var(--text);
  font-weight: 650;
  font-size: 17px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.app-icon .icon {
  width: 22px;
  height: 22px;
}

.app-icon.monogram {
  color: var(--accent);
  background: var(--accent-bg);
  border-color: transparent;
}

.app-text {
  display: grid;
  min-width: 0;
  flex: 1;
}

.app-name,
.app-domain {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-name {
  font-weight: 600;
}

.app-domain {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}

.app-arrow {
  color: var(--subtle);
  opacity: 0;
  transform: translate(-3px, 3px);
  transition: opacity 0.15s var(--ease), transform 0.2s var(--ease);
}

.app-arrow .icon {
  width: 16px;
  height: 16px;
}

.app-tile:hover .app-arrow,
.app-tile:focus-visible .app-arrow {
  opacity: 1;
  transform: none;
}

/* Shared helpers */

.label {
  display: block;
  margin: 0 0 var(--s-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-block;
  max-width: 100%;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

/* Empty, error and loading states */

.empty-state {
  display: grid;
  justify-items: center;
  gap: var(--s-1);
  padding: var(--s-8) var(--s-5);
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.empty-state::before {
  content: "";
  width: 40px;
  height: 40px;
  margin-bottom: var(--s-2);
  border-radius: 50%;
  background: var(--surface-2) center / 20px no-repeat;
  /* Inbox pictogram as a CSS image (img-src allows data:, so this stays CSP-safe). */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8fa0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E");
}

.empty-state.is-error {
  border-style: solid;
  border-color: color-mix(in oklab, var(--danger) 30%, transparent);
  background: var(--danger-bg);
}

.empty-state.is-error::before {
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c2412d' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E");
}

.empty-state strong {
  font-weight: 600;
}

.empty-state span {
  max-width: 44ch;
  font-size: 14px;
  color: var(--muted);
  text-wrap: pretty;
}

.empty-state .btn-secondary {
  margin-top: var(--s-3);
}

.skeleton-list {
  display: grid;
  gap: var(--s-3);
}

.skeleton-card {
  display: grid;
  gap: 10px;
  padding: var(--s-4) 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.sk {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  animation: pulse 1.4s ease-in-out infinite;
}

.sk-title {
  width: 32%;
  height: 12px;
}

.sk-line {
  width: 68%;
}

.sk-short {
  width: 44%;
}

@keyframes pulse {
  50% {
    opacity: 0.45;
  }
}

/* Feedback */

.error,
.status {
  margin: var(--s-5) 0 0;
  padding: 10px var(--s-3);
  font-size: 14px;
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}

.error {
  color: var(--danger);
  background: var(--danger-bg);
}

.status {
  color: var(--success);
  background: var(--success-bg);
}

/* Shared confirmation dialog: every destructive action states its exact impact here. */

.confirm-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.confirm-dialog[open] {
  animation: dialog-in 0.2s var(--ease);
}

.confirm-dialog::backdrop {
  background: oklch(15% 0.012 260 / 0.45);
}

.confirm-dialog form {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-6);
}

.confirm-dialog h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.confirm-dialog p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--s-2);
  margin-top: var(--s-4);
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  button[aria-busy="true"]::before {
    animation: spin 1.5s linear infinite !important;
  }
}
