/* ═══════════════════════════════════════════════════════════════════════════
   ArcBig Portal — Light design system (single source of truth)
   60-30-10: 60% --n-50 bg · 30% white surfaces · 10% --blue-500 accent
   Marketing pages: light layout in main.css (index, business-model, auth)
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  /* Brand accents */
  --blue-50: #eef3ff;
  --blue-100: #dbe6ff;
  --blue-200: #b9ccff;
  --blue-400: #5b8bff;
  --blue-500: #1e5eff;
  --blue-600: #1a4fd6;
  --blue-700: #163f9e;
  --navy: #0b2545;

  /* Neutrals */
  --n-50: #f7f9fc;
  --n-100: #eef1f6;
  --n-200: #e3e8ef;
  --n-300: #cbd3df;
  --n-400: #9aa5b1;
  --n-500: #6b7280;
  --ink: #1a1a1a;

  /* Semantic */
  --success: #128a3a;
  --success-bg: #ecfdf3;
  --success-border: #b8e6c8;
  --warning: #b8860b;
  --warning-bg: #fffbeb;
  --warning-border: #f0d78c;
  --error: #c0392b;
  --error-bg: #fef2f2;
  --error-border: #f5c6c2;

  /* Spacing — strict 8px increments */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;

  /* Radii */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-full: 999px;

  /* Shadows — soft, blue-tinted */
  --shadow-sm: 0 1px 2px rgba(11, 37, 69, 0.05), 0 1px 3px rgba(30, 94, 255, 0.04);
  --shadow-md: 0 4px 12px rgba(11, 37, 69, 0.07), 0 2px 6px rgba(30, 94, 255, 0.05);
  --shadow-lg: 0 12px 32px rgba(11, 37, 69, 0.1), 0 4px 12px rgba(30, 94, 255, 0.06);

  /* Motion */
  --transition-fast: 150ms ease;
  --transition: 150ms ease;

  /* Typography — Degular only, max 3 weights (400 / 600 / 700) */
  --font-family: "Degular", sans-serif;
  --font-display: var(--font-family);
  --font-body: var(--font-family);
  --text-display: 52px;
  --text-h1: 36px;
  --text-h2: 28px;
  --text-h3: 20px;
  --text-body: 16px;
  --text-caption: 13px;
  --text-sm: 14px;
  --text-table: 15px;
  --fw-display: 800;
  --fw-h1: 700;
  --fw-h2: 600;
  --fw-h3: 600;
  --fw-body: 400;
  --fw-caption: 500;
  --lh-body: 1.6;
  --lh-heading: 1.2;
  --lh-display: 1.1;
  --label-spacing: 0.06em;
  --measure: 65ch;

  /* Unified header rhythm — eyebrow → title → subtitle */
  --header-eyebrow-gap: var(--space-2);
  --header-title-gap: 10px;
  --header-subtitle-gap: var(--space-2);
  --header-title-tracking: -0.01em;
  --header-block-max: var(--measure);
  --header-center-max: 720px;
  --header-subtitle-max: 60ch;

  /* Surfaces (60-30-10) */
  --surface-bg: var(--n-50);
  --surface-card: #ffffff;
  --text-color: var(--ink);
  --text-muted: var(--n-500);

  /* —— Compatibility aliases (existing markup) —— */
  --arc-blue-50: var(--blue-50);
  --arc-blue-100: var(--blue-100);
  --arc-blue-400: var(--blue-400);
  --arc-blue-500: var(--blue-500);
  --arc-blue-600: var(--blue-600);
  --arc-blue-700: var(--blue-700);
  --arc-blue-800: #123580;
  --arc-blue-900: var(--navy);
  --arc-blue: var(--blue-500);
  --arc-blue-hover: var(--blue-600);
  --gray-50: var(--n-50);
  --gray-100: var(--n-100);
  --gray-200: var(--n-200);
  --gray-300: var(--n-300);
  --gray-400: var(--n-400);
  --gray-500: var(--n-500);
  --gray-600: #4b5563;
  --gray-700: #374151;
  --navy-core: var(--navy);
  --deep-blue: var(--navy);
  --white: #ffffff;
  --cream-bg: var(--n-50);
  --off-white: var(--n-50);
  --border: var(--n-200);
  --border-subtle: var(--n-200);
  --border-strong: var(--n-300);
  --success-green: var(--success);
  --warning-amber: var(--warning);
  --progress-blue: var(--blue-500);
  --progress-blue-soft: var(--blue-50);
  --piki-blue: var(--blue-500);
  --piki-blue-hover: var(--blue-600);
  --piki-soft: var(--blue-50);
  --malaga-red: var(--error);
  --coral-soft: var(--error-bg);
  --mediterranean: #17d1c8;
  --teal-soft: rgba(23, 209, 200, 0.12);
  --wa: #25d366;
  --sidebar-w: 260px;
  --radius-glass: var(--radius-lg);

  /* Legacy aliases — solid surfaces only (no blur in portal) */
  --glass-light-bg: var(--surface-card);
  --glass-light-border: var(--n-200);
  --glass-light-shadow: var(--shadow-sm);
  --modal-scrim: rgba(11, 37, 69, 0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--fw-body);
  background-color: var(--n-50);
  color: var(--ink);
  line-height: var(--lh-body);
  text-align: left;
  letter-spacing: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.app-portal {
  background-color: var(--n-50);
  background-image: none;
}

p, li, td, label, input, select, textarea, .text-body {
  color: var(--ink);
  text-align: left;
}

a { color: var(--blue-500); text-decoration: none; transition: color var(--transition-fast); }
a:hover { text-decoration: none; color: var(--blue-600); }
a:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; border-radius: 2px; }

.app-portal .sidebar a:hover {
  color: inherit;
}

img { max-width: 100%; display: block; }

.hidden { display: none !important; }

/* Typography — Brand Style Guide scale */
.display, .font-display {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: var(--fw-display);
  line-height: var(--lh-display);
  color: var(--navy);
  max-width: var(--measure);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--navy);
  line-height: var(--lh-heading);
  max-width: var(--measure);
}

h1 {
  font-size: var(--text-h1);
  font-weight: var(--fw-h1);
}

h2 {
  font-size: var(--text-h2);
  font-weight: var(--fw-h2);
}

h3 {
  font-size: var(--text-h3);
  font-weight: var(--fw-h3);
}

h4, .caption, .form-label, label {
  font-size: var(--text-caption);
  font-weight: var(--fw-caption);
  text-transform: uppercase;
  letter-spacing: var(--label-spacing);
  color: var(--n-500);
}

.text-muted { color: var(--n-500); }
.text-caption { font-size: var(--text-caption); font-weight: var(--fw-caption); line-height: var(--lh-body); }
.text-sm { font-size: var(--text-sm); font-weight: 500; line-height: var(--lh-body); }
.text-xs { font-size: 12px; line-height: 1.5; } /* minimum scale */

.brand { font-weight: var(--fw-h1); letter-spacing: -0.02em; font-family: var(--font-display); }
.brand span { color: var(--blue-500); }

.prose, .auth-subtitle {
  max-width: var(--measure);
}

/* Logo */
.logo-link {
  display: block;
  width: 100%;
  text-decoration: none;
  line-height: 0;
}

.logo-link:hover { text-decoration: none; }

.logo {
  display: block;
  width: auto;
  height: auto;
}

.logo-sidebar {
  display: block;
  height: 56px;
  width: 100%;
  max-width: 104px;
  object-fit: contain;
  object-position: left center;
  mix-blend-mode: lighten;
}

.logo-auth {
  display: block;
  width: 45%;
  height: auto;
  margin: 0 auto;
  padding: 0;
  object-fit: contain;
  object-position: center;
}

.auth-logo {
  margin: 0;
  padding: 20px 0;
  line-height: 0;
  text-align: center;
  height: auto;
}

.auth-box:has(.auth-logo) {
  padding: 36px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 10px var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-body);
  letter-spacing: 0;
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast),
    opacity var(--transition-fast);
}
.btn:hover { text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-primary {
  background: var(--blue-500);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover:not(:disabled) {
  background: var(--blue-600);
  box-shadow: var(--shadow-md);
}
.btn-primary:active:not(:disabled) {
  background: var(--blue-700);
}
.btn-secondary {
  background: var(--white);
  color: var(--navy);
  border-color: var(--n-300);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--n-50);
  border-color: var(--n-400);
}
.btn-secondary:active:not(:disabled) {
  background: var(--n-100);
}
.btn-ghost {
  background: transparent;
  color: var(--n-500);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--n-100);
  color: var(--navy);
}
.btn-danger {
  background: var(--error);
  color: var(--white);
}
.btn-danger:hover:not(:disabled) {
  background: #a93226;
}
.btn-danger:active:not(:disabled) {
  background: #922b21;
}
.btn-deep { background: var(--navy); color: var(--white); }
.btn-deep:hover:not(:disabled) { background: var(--blue-700); }
.btn:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px var(--blue-100);
}
.btn-teal { background: var(--mediterranean); color: var(--arc-blue-900); }
.btn-coral { background: var(--malaga-red); color: var(--white); }
.btn-signout {
  margin-top: var(--space-3);
  background: var(--arc-blue);
  color: var(--white);
  border: none;
}
.btn-signout:hover:not(:disabled) {
  background: var(--arc-blue-hover);
}
.btn-signout:active:not(:disabled) {
  transform: translateY(1px);
}
.btn-wa { background: var(--wa); color: var(--white); }
.btn-sm { min-height: 32px; padding: 6px var(--space-3); font-size: var(--text-caption); }
.btn-block { width: 100%; }

/* Forms — labels above fields, uppercase captions */
label:not(.toggle-row label):not(.option-btn) {
  display: block;
  font-size: var(--text-caption);
  font-weight: var(--fw-caption);
  font-family: var(--font-body);
  letter-spacing: var(--label-spacing);
  text-transform: uppercase;
  color: var(--n-500);
  margin-bottom: var(--space-2);
}

input, select, textarea {
  width: 100%;
  min-height: 42px;
  background: var(--white);
  border: 1px solid var(--n-300);
  border-radius: var(--radius-sm);
  padding: 10px var(--space-3);
  color: var(--ink);
  font-size: var(--text-body);
  font-weight: var(--fw-body);
  font-family: var(--font-body);
  margin-bottom: var(--space-3);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

input::placeholder,
textarea::placeholder {
  color: var(--n-400);
}

input:hover:not(:disabled):not(:focus),
select:hover:not(:disabled):not(:focus),
textarea:hover:not(:disabled):not(:focus) {
  border-color: var(--n-400);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px var(--blue-100);
}

input:disabled, select:disabled, textarea:disabled {
  background: var(--n-100);
  color: var(--n-400);
  cursor: not-allowed;
}

input.is-error, select.is-error, textarea.is-error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px var(--error-bg);
}

textarea { min-height: 110px; resize: vertical; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}

.form-grid .full { grid-column: 1 / -1; }

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 20px;
}

/* Cards — white surface, 1px n-200 border, 24px padding */
.card, .panel {
  background: var(--white);
  border: 1px solid var(--n-200);
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.panel-flush { padding: 0; overflow-x: auto; overflow-y: visible; -webkit-overflow-scrolling: touch; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3);
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--n-200);
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.stat-card .num {
  font-size: var(--text-h1);
  font-weight: var(--fw-h1);
  font-family: var(--font-display);
  color: var(--navy);
  line-height: var(--lh-heading);
}

.stat-card .lbl {
  font-size: var(--text-caption);
  color: var(--n-500);
  margin-top: var(--space-2);
}

.price-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.price-card.featured {
  border-color: var(--arc-blue);
  border-width: 2px;
}

.price-card .plan-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-block;
  font-size: var(--text-caption);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--arc-blue);
  background: var(--piki-soft);
  border: 1px solid rgba(58, 119, 232, 0.3);
  border-radius: 999px;
  padding: 4px 10px;
}

.plan-intro {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--navy-core);
  margin: 4px 0 8px;
}

.price-card .inr {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy-core);
  margin: 10px 0;
}

.price-card .inr small {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
}

.price-card ul {
  list-style: none;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.9;
}

.price-card ul li::before {
  content: "✓ ";
  color: var(--mediterranean);
  font-weight: 700;
}

/* Status pills */
.status,
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-caption);
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  border: 1px solid transparent;
}

.status-submitted,
.status-pill--submitted,
.status-pill--pending,
.status-pending {
  background: var(--n-100);
  color: var(--n-500);
  border-color: var(--n-200);
}

.status-in_design,
.status-pill--progress,
.status-scheduled {
  background: var(--blue-50);
  color: var(--blue-700);
  border-color: var(--blue-100);
}

.status-ready,
.status-sent_whatsapp,
.status-pill--ready,
.status-pill--whatsapp,
.status-approved,
.status-published,
.status-pill--published,
.status-posted,
.status-pill--posted {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-border);
}

.status-failed,
.status-pill--failed {
  background: var(--error-bg);
  color: var(--error);
  border-color: var(--error-border);
}

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

.btn-success {
  background: var(--success);
  color: #fff;
  border: none;
}

.btn-success:hover:not(:disabled) {
  background: #166534;
}

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: var(--text-table); line-height: 1.5; }

th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: var(--space-3);
  font-size: var(--text-caption);
  font-weight: 600;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: var(--label-spacing);
  color: var(--n-500);
  border-bottom: 1px solid var(--n-200);
  background: var(--n-50);
}

td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--n-100);
  vertical-align: middle;
  color: var(--ink);
  min-height: 48px;
}

tr:last-child td { border-bottom: none; }

.app-shell tbody tr:nth-child(even) {
  background: var(--n-50);
}

.app-shell tbody tr:hover {
  background: var(--blue-50);
}

.app-shell tbody tr:focus-within {
  outline: 2px solid var(--blue-500);
  outline-offset: -2px;
}

td.num, th.num,
td[data-align="right"],
th[data-align="right"] {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 20px;
  background: var(--piki-soft);
  border: 1px solid rgba(47, 91, 255, 0.25);
  border-radius: 10px;
  font-size: 14px;
}
.btn-download-pending {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

/* Callouts */
.callout {
  padding: 16px 24px;
  border-radius: var(--radius-glass);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--arc-blue);
  background: var(--white);
  margin: 16px 0;
}

.callout-warn { border-left-color: var(--malaga-red); background: var(--coral-soft); }
.callout-teal { border-left-color: var(--mediterranean); background: var(--teal-soft); }

/* Tags */
.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: var(--text-caption);
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* Toast */
.toast {
  position: fixed;
  bottom: var(--space-4);
  right: var(--space-4);
  background: var(--navy);
  color: var(--white);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-size: var(--text-caption);
  z-index: 9999;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Marketing header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header nav { display: flex; gap: 24px; align-items: center; }
.site-header nav a { color: var(--deep-blue); font-size: 14px; font-weight: 500; text-decoration: none; }
.site-header nav a:hover { color: var(--piki-blue); }

.site-footer {
  background: var(--deep-blue);
  color: rgba(255,255,255,0.7);
  padding: 48px 24px 32px;
  margin-top: 80px;
}

.site-footer a { color: var(--mediterranean); }
.site-footer .brand { color: var(--white); }
.site-footer .brand span { color: var(--mediterranean); }

/* Hero */
.hero {
  padding: 72px 24px 80px;
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-badge {
  display: inline-block;
  background: var(--teal-soft);
  color: #0a8a84;
  font-size: var(--text-caption);
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.hero p.lead {
  font-size: 18px;
  color: var(--text-muted);
  margin: 16px 0 28px;
  max-width: 480px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-visual {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.workflow-step {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.workflow-step:last-child { border-bottom: none; }

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--piki-blue);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 64px 24px;
}

.section-header { margin-bottom: 32px; }

/* ═══ Portal page headers — left-aligned, shared left edge ═══ */
.app-portal .page-header {
  text-align: left;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
  max-width: var(--header-block-max);
}

.app-portal .page-header > :is(h1, h2, h3, p) {
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
  text-indent: 0;
  text-align: left;
  max-width: none;
}

.app-portal .page-header > h1,
.app-portal .page-header > h2 {
  margin-top: 0;
  margin-bottom: var(--header-title-gap);
  letter-spacing: var(--header-title-tracking);
}

.app-portal .page-header > p {
  margin-top: 0;
  margin-bottom: 0;
  color: var(--text-muted);
  max-width: var(--header-subtitle-max);
}

/* ═══ Public / marketing headers — centered on one axis ═══ */
:is(
  .section-header,
  .text-header,
  .auth-hero-panel__inner
) {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;
  padding-right: 0;
  max-width: var(--header-center-max);
}

.auth-box > h1,
.auth-box > .auth-subtitle {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;
  padding-right: 0;
  text-indent: 0;
  letter-spacing: var(--header-title-tracking);
}

.auth-box > h1 {
  margin-top: 0;
  margin-bottom: var(--header-title-gap);
}

.auth-box > .auth-subtitle {
  margin-top: 0;
  margin-bottom: var(--space-4);
  max-width: var(--header-subtitle-max);
  color: var(--text-muted);
}

:is(
  .section-header,
  .text-header,
  .auth-hero-panel__inner
) > :is(
  .kicker,
  .eyebrow,
  .blog-kicker,
  .cta-band__kicker,
  .lead-form-kicker,
  h1,
  h2,
  h3,
  .auth-subtitle,
  .blog-lead
) {
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;
  padding-right: 0;
  text-indent: 0;
  text-align: center;
  max-width: 100%;
}

:is(
  .section-header,
  .text-header,
  .auth-hero-panel__inner
) > :is(p, .auth-subtitle, .blog-lead) {
  max-width: var(--header-subtitle-max);
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

:is(.kicker, .eyebrow, .blog-kicker, .cta-band__kicker, .lead-form-kicker) {
  display: block;
  margin-top: 0;
  margin-bottom: var(--header-eyebrow-gap);
  font-size: var(--text-caption);
  font-weight: 700;
  letter-spacing: var(--label-spacing);
  text-transform: uppercase;
  color: var(--text-muted);
}

:is(
  .section-header,
  .text-header,
  .auth-hero-panel__inner
) > :is(h1, h2, h3) {
  margin-top: 0;
  margin-bottom: var(--header-title-gap);
  letter-spacing: var(--header-title-tracking);
}

:is(
  .section-header,
  .text-header,
  .auth-hero-panel__inner
) > p,
:is(
  .section-header,
  .text-header,
  .auth-hero-panel__inner
) > .auth-subtitle,
:is(
  .section-header,
  .text-header,
  .auth-hero-panel__inner
) > .blog-lead {
  margin-top: 0;
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: var(--text-body);
  font-weight: var(--fw-body);
  line-height: var(--lh-body);
}

.section-header p { color: var(--text-muted); }

/* App shell (client + admin) */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  color: var(--white);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sidebar-brand span { color: var(--mediterranean); }

.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--space-3) 0 var(--space-4);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-group-block {
  display: flex;
  flex-direction: column;
}

.nav-section-title {
  padding: var(--space-2) var(--space-4) var(--space-3);
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: var(--label-spacing);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

.nav-group-block--spaced {
  margin-top: var(--space-4);
}

.nav-subgroup {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.nav-subgroup + .nav-subgroup {
  margin-top: var(--space-2);
}

.nav-logout-wrap {
  margin-top: var(--space-5);
  padding: 0 0 var(--space-2);
}

.nav-link:focus-visible {
  outline: 2px solid var(--arc-blue);
  outline-offset: -2px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.nav-group.is-open .nav-sub {
  display: flex;
}

.nav-sub {
  display: none;
  flex-direction: column;
  gap: var(--space-1);
  margin: var(--space-1) 0 0 var(--space-4);
  padding-left: var(--space-3);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-4);
  margin: 0 var(--space-2);
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.72);
  font-size: var(--text-caption);
  font-weight: 500;
  font-family: var(--font-body);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition);
}

.nav-link__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.45);
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link__icon svg {
  width: 18px;
  height: 18px;
}

.nav-link__label {
  flex: 1;
  min-width: 0;
}

.nav-link:hover:not(.active) {
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.nav-link:hover:not(.active) .nav-link__icon {
  color: rgba(255, 255, 255, 0.9);
}

.nav-link.active {
  color: var(--white);
  font-weight: 600;
  background: rgba(30, 94, 255, 0.18);
  border-left-color: var(--blue-500);
}

.nav-link.active .nav-link__icon {
  color: var(--blue-400);
}

.nav-link-sub {
  padding: 8px var(--space-3) 8px var(--space-3);
  font-size: var(--text-caption);
  font-weight: 500;
}

.nav-link-sub.active {
  font-weight: 600;
  background: rgba(30, 94, 255, 0.14);
}

.nav-link-parent.active {
  background: rgba(30, 94, 255, 0.1);
}

.nav-link-logout {
  width: calc(100% - var(--space-4));
  margin: var(--space-2) var(--space-2) 0;
  padding: var(--space-3) var(--space-4);
  border-top: none;
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  font-size: var(--text-caption);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  transition:
    background var(--transition),
    color var(--transition);
}

.nav-link-logout .nav-link__icon {
  color: rgba(255, 255, 255, 0.45);
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link-logout:hover {
  color: #fca5a5;
  background: rgba(220, 38, 38, 0.12);
}

.nav-link-logout:hover .nav-link__icon {
  color: #fca5a5;
}

@media (prefers-reduced-motion: reduce) {
  .nav-link,
  .nav-link-logout,
  .nav-link__icon {
    transition: background var(--transition-fast), color var(--transition-fast), border-left-color var(--transition-fast);
  }
}

.account-form {
  max-width: 640px;
}

.account-form .form-section {
  margin-bottom: 18px;
}

.account-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

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

.toggle-row label {
  font-size: 14px;
  font-weight: 600;
  color: var(--deep-blue);
}

.toggle-row span {
  display: block;
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 4px;
}

.sidebar-footer {
  padding: var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sidebar-footer .user-name {
  font-size: var(--text-caption);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

.sidebar-footer .user-meta {
  margin-top: var(--space-2);
  line-height: 1.4;
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.5);
}

.plan-badge {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid rgba(30, 94, 255, 0.35);
  border-radius: var(--radius-full);
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: var(--label-spacing);
  text-transform: uppercase;
  color: var(--arc-blue-200);
  background: rgba(30, 94, 255, 0.15);
}

.nav-shell-error {
  padding: 16px 22px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
}

.nav-shell-error a {
  color: var(--arc-blue);
  font-weight: 600;
}

.app-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: var(--space-5);
  padding-bottom: max(var(--space-5), env(safe-area-inset-bottom));
  min-height: 100vh;
  background: var(--n-50);
  width: calc(100% - var(--sidebar-w));
  box-sizing: border-box;
}

.page-header {
  margin-bottom: var(--space-5);
}

.page-header h1 {
  font-size: var(--text-h1);
  font-weight: var(--fw-h1);
  line-height: var(--lh-heading);
  color: var(--navy);
}

.page-header p {
  color: var(--n-500);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.workflow-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-card);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  font-size: var(--text-caption);
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
}

.workflow-bar strong { color: var(--arc-blue-900); }

/* Login page */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: var(--n-50);
}

.auth-box {
  width: 100%;
  max-width: 440px;
  padding: var(--space-6) var(--space-5);
  overflow: visible;
  position: relative;
  background: var(--white);
  border: 1px solid var(--n-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.auth-box::before {
  display: none;
}

.auth-box > * {
  position: relative;
  z-index: 1;
}

#client-auth {
  overflow: visible;
}

.auth-box h1 {
  font-size: var(--text-h2);
  color: var(--navy);
}

.role-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding: var(--space-1);
  background: var(--n-100);
  border-radius: var(--radius);
}

.role-tab {
  flex: 1;
  min-width: 0;
  padding: 10px var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: var(--text-caption);
  font-weight: var(--fw-caption);
  font-family: var(--font-body);
  cursor: pointer;
  color: var(--n-500);
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.role-tab:hover:not(.active) {
  color: var(--navy);
  background: var(--white);
}

.role-tab.active {
  background: var(--white);
  color: var(--blue-500);
  border-color: var(--n-200);
  box-shadow: var(--shadow-sm);
}

.role-tab:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px var(--blue-100);
}

.demo-box {
  margin-top: var(--space-4);
  padding: var(--space-3);
  background: var(--arc-blue-50);
  border: 1px solid var(--arc-blue-100);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.7;
}

.demo-box code {
  background: var(--white);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: var(--text-caption);
  color: var(--arc-blue-900);
}

.social-auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 24px;
  overflow: visible;
}

.social-auth__label {
  margin: 0 0 16px;
  width: 100%;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.social-auth__icons {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 28px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 4px 8px;
  overflow: visible;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  border: 1px solid var(--gray-200);
  background: var(--white);
  text-decoration: none;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast);
}

.social-icon:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--arc-blue-200);
}

.social-icon:focus-visible {
  outline: 2px solid var(--arc-blue);
  outline-offset: 2px;
}

.social-icon svg {
  display: block;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.social-icon--disabled {
  cursor: not-allowed;
}

.social-icon--disabled:hover {
  transform: none;
  box-shadow: none;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 20px;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

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

.auth-divider span {
  white-space: nowrap;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  color: var(--text-muted);
}

.empty-state p { margin-bottom: var(--space-3); }

.empty-state-card {
  padding: var(--space-6);
  text-align: center;
  background: var(--surface-card);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.empty-state-card__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-4);
  color: var(--arc-blue-400);
}

.empty-state-card__icon svg {
  width: 56px;
  height: 56px;
}

.empty-state-card h2 {
  font-size: var(--text-h3);
  font-weight: 600;
  color: var(--arc-blue-900);
  margin-bottom: var(--space-2);
}

.empty-state-card p {
  font-size: var(--text-body);
  color: var(--text-muted);
  max-width: 420px;
  margin: 0 auto var(--space-4);
  line-height: var(--lh-body);
}

.panel-heading {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-heading h2,
.panel-heading h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy-core);
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy-core);
  margin: 32px 0 16px;
}

/* ——— New request form: glass + button UI ——— */
.app-main-form {
  background: transparent;
}

.request-form {
  max-width: 720px;
  padding: 32px;
}

.form-section {
  margin-bottom: 28px;
}

.form-section:last-of-type {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-caption);
  font-weight: var(--fw-caption);
  letter-spacing: var(--label-spacing);
  text-transform: uppercase;
  color: var(--n-500);
  margin-bottom: var(--space-2);
}

.form-hint {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 8px;
  letter-spacing: -0.02em;
}

.option-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}

.option-btn-category {
  justify-content: center;
  min-height: 44px;
  text-align: center;
}

.sub-options-section {
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--n-200);
  background: var(--n-50);
}

.sub-options-section[hidden] {
  display: none;
}

.option-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid var(--n-300);
  background: var(--white);
  color: var(--navy);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}

.option-btn:hover {
  border-color: var(--blue-400);
  background: var(--blue-50);
}

.option-btn:active {
  transform: scale(0.98);
}

.option-btn.active {
  background: var(--piki-blue);
  border-color: var(--piki-blue);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(51, 102, 238, 0.28);
}

.option-btn .option-icon {
  font-size: 15px;
  line-height: 1;
  opacity: 0.85;
}

.glass-field {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--n-300);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--ink);
  font-size: var(--text-body);
  font-family: inherit;
  margin-bottom: 0;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.glass-field:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px var(--blue-50);
}

.glass-field::placeholder {
  color: var(--n-400);
}

.request-form textarea.glass-field {
  min-height: 120px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row .form-section {
  margin-bottom: 0;
}

.form-actions {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(34, 36, 74, 0.08);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.form-actions .btn-primary {
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 15px;
}

.form-actions-hint {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  padding: 20px 16px;
  border-radius: 12px;
  border: 1px dashed var(--n-300);
  background: var(--n-50);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
}

.upload-zone:hover {
  border-color: var(--blue-500);
  background: var(--blue-50);
}

.upload-zone.has-file {
  border-style: solid;
  border-color: rgba(51, 102, 238, 0.35);
  background: rgba(51, 102, 238, 0.06);
}

.upload-zone-title {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--deep-blue);
  letter-spacing: -0.02em;
}

.upload-zone-hint {
  font-size: var(--text-caption);
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

.upload-preview {
  width: 100%;
  margin-top: 12px;
}

.upload-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  margin-top: 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(34, 36, 74, 0.08);
  font-size: var(--text-sm);
  color: var(--deep-blue);
  text-align: left;
}

.upload-file-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-remove {
  flex-shrink: 0;
  padding: 2px 8px;
  border: none;
  border-radius: 6px;
  background: var(--coral-soft);
  color: #c44a38;
  font-size: var(--text-caption);
  font-weight: 700;
  cursor: pointer;
  font-family: "Inter", sans-serif;
}

.upload-logo-thumb {
  max-height: 48px;
  max-width: 100%;
  margin-top: 10px;
  object-fit: contain;
  border-radius: 6px;
}

.attach-badge {
  display: inline-block;
  font-size: var(--text-caption);
  color: var(--piki-blue);
  font-weight: 600;
  margin-top: 4px;
}

.addon-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.addon-search {
  flex: 1;
  min-width: 220px;
  margin: 0;
}

.addon-count {
  font-size: var(--text-sm);
  color: var(--text-muted);
  white-space: nowrap;
}

.addon-table td.addon-price {
  color: var(--navy-core);
  font-weight: 700;
  white-space: nowrap;
}

.addon-table th:last-child,
.addon-table td:last-child {
  width: 100px;
  text-align: right;
}

.addon-price-inline {
  color: var(--navy-core);
  font-weight: 600;
}

.addon-banner {
  margin-bottom: 20px;
}

.addon-change-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--piki-blue);
  text-decoration: none;
}

.addon-change-link:hover {
  color: var(--arc-blue-hover);
  opacity: 0.9;
}

.job-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.job-panel {
  padding: 22px 24px;
}

.job-panel h3 {
  margin-bottom: 16px;
}

.job-dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px 16px;
  font-size: 14px;
}

.job-dl dt {
  color: var(--text-muted);
  font-weight: 600;
}

.job-dl dd {
  margin: 0;
  color: var(--deep-blue);
}

.job-brief {
  white-space: pre-wrap;
  line-height: 1.6;
  color: var(--deep-blue);
  font-size: 14px;
}

.job-logo-preview {
  max-height: 120px;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--off-white);
  padding: 8px;
}

.deliver-block {
  padding: 16px;
  border-radius: var(--radius);
  border: 1px dashed var(--n-300);
  background: var(--n-50);
}

/* ——— Solid card alias (portal — no glass) ——— */
.glass-light {
  background: var(--glass-light-bg);
  border: 1px solid var(--glass-light-border);
  border-radius: var(--radius-glass);
  box-shadow: var(--glass-light-shadow);
}

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

@keyframes portal-rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .app-portal .stat-card:hover,
  .app-portal .empty-state-card:hover,
  .app-portal .callout:hover,
  .app-portal .card:hover,
  .app-portal .price-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-300);
  }

  .app-portal .portal-enter,
  .app-portal .stat-card,
  .app-portal .stat-strip,
  .app-portal .empty-state-card,
  .app-portal .pipeline-stepper,
  .app-portal .panel,
  .app-portal .card,
  .app-portal .callout,
  .app-portal .dashboard-panel,
  .app-portal .request-form,
  .app-portal .price-card {
    animation: portal-rise-in 300ms ease-out both;
  }

  .app-portal .auth-box {
    animation: portal-fade-in 300ms ease-out both;
  }

  .stats-row .stat-card:nth-child(1),
  .stats-layout--active .stat-card:nth-child(1) { animation-delay: 0ms; }
  .stats-row .stat-card:nth-child(2),
  .stats-layout--active .stat-card:nth-child(2) { animation-delay: 60ms; }
  .stats-row .stat-card:nth-child(3),
  .stats-layout--active .stat-card:nth-child(3) { animation-delay: 120ms; }
  .stats-row .stat-card:nth-child(4),
  .stats-layout--active .stat-card:nth-child(4) { animation-delay: 180ms; }

  .stats-layout--empty .stat-strip { animation-delay: 0ms; }
  .stats-layout--empty .stat-card--quota { animation-delay: 60ms; }

  .pipeline-stepper { animation-delay: 0ms; }
  .dashboard-ctas { animation: portal-rise-in 300ms ease-out 120ms both; }
  .empty-state-card { animation-delay: 180ms; }
  .dashboard-panel { animation-delay: 240ms; }
}

@media (prefers-reduced-motion: reduce) {
  .app-portal .stat-card:hover,
  .app-portal .empty-state-card:hover,
  .app-portal .callout:hover,
  .app-portal .card:hover,
  .app-portal .price-card:hover {
    box-shadow: var(--shadow-sm);
  }

  .app-portal .portal-enter,
  .app-portal .stat-card,
  .app-portal .stat-strip,
  .app-portal .empty-state-card,
  .app-portal .pipeline-stepper,
  .app-portal .panel,
  .app-portal .card,
  .app-portal .callout,
  .app-portal .dashboard-panel,
  .app-portal .auth-box,
  .app-portal .request-form,
  .app-portal .price-card,
  .app-portal .dashboard-ctas,
  .pipeline-step--active {
    animation: none !important;
  }
}

/* Portal surfaces — 60-30-10 */
.app-portal .stat-card,
.app-portal .stat-strip,
.app-portal .empty-state-card,
.app-portal .panel,
.app-portal .card,
.app-portal .callout,
.app-portal .dashboard-panel,
.app-portal .auth-box,
.app-portal .request-form,
.app-portal .price-card,
.app-portal .workflow-bar,
.app-portal .pipeline-stepper {
  background: var(--white);
  border: 1px solid var(--n-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.app-portal .auth-box {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.app-portal .btn-secondary {
  background: var(--white);
  border: 1px solid var(--n-300);
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}

.app-portal .btn-secondary:hover:not(:disabled) {
  background: var(--n-50);
  border-color: var(--n-400);
  color: var(--blue-600);
}

/* Table: container glass only, opaque rows inside */
.app-portal .panel.panel-flush,
.app-portal .dashboard-panel {
  padding: 0;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.app-portal .panel.panel-flush table,
.app-portal .dashboard-panel table {
  min-width: 880px;
}

.app-portal .panel.panel-flush th,
.app-portal .panel.panel-flush td,
.app-portal .dashboard-panel th,
.app-portal .dashboard-panel td {
  padding: 14px 16px;
  vertical-align: top;
}

.app-portal .panel.panel-flush td:nth-child(2),
.app-portal .dashboard-panel td:nth-child(2) {
  white-space: normal;
  word-break: break-word;
  min-width: 160px;
  max-width: 220px;
}

.app-portal .panel.panel-flush td:last-child,
.app-portal .dashboard-panel td:last-child {
  white-space: nowrap;
}

.app-portal .panel.panel-flush thead th,
.app-portal .dashboard-panel thead th,
.app-portal .dashboard-panel h2,
.app-portal .panel-heading {
  background: var(--n-50);
  border-bottom: 1px solid var(--n-200);
}

.app-portal .panel.panel-flush tbody tr,
.app-portal .dashboard-panel tbody tr {
  background: var(--white);
}

.app-portal .panel.panel-flush tbody tr:nth-child(even),
.app-portal .dashboard-panel tbody tr:nth-child(even) {
  background: var(--n-50);
}

.app-portal .panel.panel-flush tbody tr:hover,
.app-portal .dashboard-panel tbody tr:hover {
  background: var(--blue-50);
  cursor: pointer;
}

.app-portal .panel.panel-flush tbody tr:nth-child(even):hover,
.app-portal .dashboard-panel tbody tr:nth-child(even):hover {
  background: var(--blue-50);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--modal-scrim);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.modal-panel {
  width: 100%;
  max-width: 520px;
  padding: var(--space-5);
  max-height: calc(100vh - var(--space-6));
  overflow-y: auto;
  background: var(--surface-card);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.modal-panel.glass-light,
.modal-panel.glass-dark {
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Pipeline stepper */
.pipeline-stepper {
  display: flex;
  align-items: stretch;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  padding: var(--space-2);
  background: var(--surface-card);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.pipeline-step {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-caption);
  font-weight: 600;
  color: var(--gray-500);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  text-align: center;
  min-height: 48px;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.pipeline-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  font-size: var(--text-caption);
  font-weight: 600;
  flex-shrink: 0;
  background: var(--gray-200);
  color: var(--gray-600);
}

.pipeline-step--completed {
  color: var(--arc-blue-900);
  border-color: var(--gray-200);
  background: var(--white);
}

.pipeline-step--completed .pipeline-step__num {
  background: var(--success-bg);
  color: var(--success);
  font-size: 14px;
}

.pipeline-step--active {
  background: var(--blue-500);
  border-color: var(--blue-500);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.pipeline-step--active .pipeline-step__num {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
}

/* Dashboard stats layouts */
.stats-layout--empty {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 280px);
  gap: 16px;
  margin-bottom: 24px;
  align-items: stretch;
}

.stat-strip {
  display: flex;
  align-items: stretch;
  overflow: hidden;
}

.stat-strip-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 24px;
  min-height: 72px;
}

.stat-strip-item + .stat-strip-item {
  border-left: 1px solid rgba(255, 255, 255, 0.35);
}

.stat-strip-item .num {
  font-size: 24px;
  font-weight: 700;
  color: var(--navy-core);
  line-height: 1;
}

.stat-strip-item .lbl {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
}

.stat-card--quota {
  border-left: 4px solid var(--arc-blue);
}

.stats-layout--active {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stats-layout--active .stat-card {
  padding: 24px;
}

.stats-layout--active .stat-card .num {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-indicator {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.stat-indicator--amber,
.stat-indicator--blue { background: var(--arc-blue); }
.stat-indicator--green { background: var(--success-green); }

.dashboard-ctas {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.dashboard-panel h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy-core);
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

/* Icon action buttons */
.icon-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--navy-core);
  cursor: pointer;
  text-decoration: none;
  padding: 0;
}

.icon-btn:hover:not(:disabled) {
  background: rgba(245, 240, 230, 0.8);
  border-color: var(--navy-core);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--arc-blue);
  outline-offset: 2px;
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 900px) {
  .stats-layout--empty { grid-template-columns: 1fr; }
  .stats-layout--active { grid-template-columns: repeat(2, 1fr); }
  .pipeline-stepper { flex-direction: column; }
}

@media (max-width: 900px) {
  .upload-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .request-form { padding: 24px 20px; }
  .account-form .form-row { grid-template-columns: 1fr; }
  .job-dl { grid-template-columns: 1fr; }
}

/* Responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 80;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.28);
  }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(20, 36, 60, 0.45);
  }
  .sidebar-backdrop[hidden] {
    display: none !important;
  }
  body.sidebar-open {
    overflow: hidden;
  }
  .app-main {
    margin-left: 0;
    width: 100%;
    padding: 72px 16px 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
  .mobile-menu-btn {
    display: flex;
    top: max(14px, env(safe-area-inset-top));
    left: max(14px, env(safe-area-inset-left));
    bottom: auto;
    right: auto;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(20, 36, 60, 0.22);
  }
  body.sidebar-open .mobile-menu-btn {
    z-index: 90;
  }
  .page-header h1 { font-size: 26px; }
  .job-card-grid {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }
  .job-card {
    width: 100%;
    min-height: 0;
  }
  .job-filters {
    flex-direction: column;
    align-items: stretch;
  }
  .job-filters select,
  .job-filters input[type="search"] {
    width: 100%;
    min-width: 0;
  }
  .sidebar-footer .btn-signout {
    min-height: 44px;
  }
}

.mobile-menu-btn {
  display: none;
  position: fixed;
  z-index: 75;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: background var(--transition-fast);
}

.mobile-menu-btn:hover {
  background: var(--blue-700);
}

.mobile-menu-btn:focus-visible {
  outline: 2px solid var(--arc-blue);
  outline-offset: 2px;
}

.burger-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 20px;
  height: 16px;
}

.burger-icon span {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

body.sidebar-open .burger-icon span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.sidebar-open .burger-icon span:nth-child(2) {
  opacity: 0;
}

body.sidebar-open .burger-icon span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ——— Team module ——— */
.role-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: var(--text-caption);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
}

.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--error);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--arc-blue-900);
}

.nav-link {
  position: relative;
}

.nav-link .nav-badge {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.team-quick-add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  margin-bottom: 24px;
}

.team-quick-add input,
.team-quick-add select {
  flex: 1 1 160px;
  min-width: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.75);
}

.team-quick-add input[type="date"] {
  flex: 0 1 150px;
}

.team-quick-add .btn {
  flex: 0 0 auto;
}

.team-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.team-column__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.team-task-card {
  padding: 16px;
  margin-bottom: 12px;
}

.team-task-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.team-task-card__title {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.4;
}

.team-task-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.client-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: var(--text-caption);
  font-weight: 600;
  background: rgba(51, 102, 238, 0.1);
  color: var(--arc-blue);
}

.overdue-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: var(--text-caption);
  font-weight: 600;
  background: rgba(229, 57, 53, 0.12);
  color: #c62828;
}

.revision-review-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: var(--text-caption);
  font-weight: 600;
  background: rgba(255, 125, 106, 0.12);
  color: var(--malaga-red);
}

.team-task-note {
  width: 100%;
  margin-top: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.7);
  resize: vertical;
  min-height: 36px;
}

.team-status-btn {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.team-status-btn:focus-visible {
  outline: 2px solid var(--arc-blue);
  outline-offset: 2px;
  border-radius: 999px;
}

.team-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin: 20px 0 12px;
  border: 1px solid var(--glass-light-border);
  border-radius: var(--radius-glass);
  background: rgba(255, 255, 255, 0.45);
  font-weight: 600;
  cursor: pointer;
}

.team-section-toggle[aria-expanded="false"] + .team-section-body {
  display: none;
}

.team-warnings {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.team-warning {
  padding: 12px 16px;
  border-radius: var(--radius);
  background: rgba(229, 57, 53, 0.08);
  border: 1px solid rgba(229, 57, 53, 0.2);
  color: #b71c1c;
  font-size: 14px;
}

.team-overview-table tbody tr.inactive-row {
  opacity: 0.65;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(107, 114, 128, 0.35);
  border-radius: 999px;
  transition: background 0.2s;
}

.toggle-slider:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--success-green);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.reassignment-note {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 6px;
  font-style: italic;
}

@media (max-width: 700px) {
  .team-quick-add {
    flex-direction: column;
    align-items: stretch;
  }

  .team-quick-add input,
  .team-quick-add select,
  .team-quick-add input[type="date"] {
    flex: 1 1 auto;
    width: 100%;
  }
}

/* ——— Job card grid & shared content lane ——— */
.app-portal .app-main > .team-quick-add,
.app-portal .app-main > .job-filters,
.app-portal .app-main > .stats-row,
.app-portal .app-main > .team-warning,
.app-portal .app-main > #job-grid-wrap,
.app-portal .app-main > #active-tasks,
.app-portal .app-main > #history-list,
.app-portal .app-main > #completed-wrap,
.app-portal .app-main > .jobs-toolbar,
.app-portal .app-main > .dashboard-ctas,
.app-portal .app-main > h2,
.job-grid-host,
#job-grid-wrap,
#active-tasks,
#completed-tasks,
#completed-wrap,
#history-list,
.job-grid-empty {
  width: 100%;
  max-width: min(1280px, 100%);
  margin-inline: auto;
}

.app-portal .app-main > p.text-sm.text-muted {
  max-width: min(1280px, 100%);
  margin-inline: auto;
  width: 100%;
}

.job-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 340px);
  justify-content: center;
  gap: 20px;
  align-items: stretch;
}

.job-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 340px;
  min-height: 280px;
  box-sizing: border-box;
}

.job-card--unassigned {
  border-left: 4px solid var(--arc-blue);
}

.job-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.job-card__code {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.job-card__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}

.job-card__type {
  margin: 0;
}

.job-card__due {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.job-card__assign {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  font-size: var(--text-sm);
  min-height: 32px;
}

.job-card__assign-label {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  height: 32px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0;
  white-space: nowrap;
  line-height: 1;
}

.needs-assignment {
  flex: 1 1 100%;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--arc-blue);
  line-height: 1.2;
  margin: 0;
}

.job-card__assign .job-assign-select {
  flex: 1 1 0;
  min-width: 120px;
  margin: 0;
}

.job-assign-select,
.job-emp-status-select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.75);
  height: 32px;
  box-sizing: border-box;
  margin: 0;
}

.assignee-pill {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
}

.job-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.job-card__actions .actions {
  flex: 1 1 auto;
}

.job-card__upload {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(34, 36, 74, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.job-card__upload-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: rgba(34, 36, 74, 0.65);
  margin: 0;
}

.job-card__upload input[type="file"] {
  font-size: var(--text-sm);
  max-width: 100%;
}

.job-card__upload-name {
  margin: 0;
  word-break: break-all;
}

.job-card--revision {
  border-left: 4px solid var(--malaga-red);
}

.job-card__revision {
  background: rgba(255, 125, 106, 0.1);
  border: 1px solid rgba(255, 125, 106, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.job-card__revision-label {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--malaga-red);
}

.job-card__revision-comment {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.client-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.client-review-panel {
  margin-top: 20px;
}

.client-review-panel h3 {
  margin-bottom: 8px;
}

.client-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.client-review-no-file {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle, rgba(0, 0, 0, 0.03));
}

.design-preview-wrap {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle, rgba(0, 0, 0, 0.03));
  border: 1px solid var(--border-subtle);
  text-align: center;
}

.design-preview-wrap--file {
  text-align: left;
}

.design-preview {
  display: block;
  max-width: 100%;
  max-height: min(70vh, 720px);
  margin: 0 auto;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(34, 36, 74, 0.08);
}

.client-revision-limit {
  margin-top: 12px;
}

.client-revision-form .revision-modal__comment {
  margin-bottom: 12px;
}

.client-revision-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Design proof viewer */
.proof-viewer {
  margin-top: 0;
}

.proof-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.proof-stage-grid {
  display: grid;
  gap: 16px;
}

.proof-stage-grid.proof-compare-grid {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 900px) {
  .proof-stage-grid.proof-compare-grid {
    grid-template-columns: 1fr;
  }
}

.proof-pane-label {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
  margin-bottom: 8px;
}

.proof-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: min(70vh, 640px);
  background: #0f172a08;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.proof-canvas-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.proof-image,
.proof-pdf-canvas,
.proof-pdf-embed {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.proof-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  z-index: 2;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.proof-pin-dot {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--piki-blue, #2563eb);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.45);
  border: 2px solid #fff;
}

.proof-pin--resolved .proof-pin-dot {
  background: #94a3b8;
  box-shadow: none;
}

.proof-pin--active .proof-pin-dot {
  transform: scale(1.15);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.25);
}

.proof-thread {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--surface-subtle, rgba(0, 0, 0, 0.03));
}

.proof-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.proof-thread-body {
  margin: 0 0 10px;
  white-space: pre-wrap;
}

.proof-reply {
  font-size: 13px;
  padding: 8px 0;
  border-top: 1px solid var(--border-subtle);
}

.proof-reply-compose {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.proof-checklist {
  margin-bottom: 12px;
}

.proof-checklist ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.proof-hint {
  margin-top: 10px;
}

.proof-pin-summary {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
}

.proof-pin-summary li {
  margin-bottom: 4px;
}

.job-card__revision-pins {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.15);
}

.billing-banner {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.billing-banner--past-due {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
}

.billing-banner--suspended {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.35);
}

.billing-status-dl {
  margin-top: 12px;
}

.client-revision-sent {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle, rgba(0, 0, 0, 0.03));
  border: 1px solid var(--border-subtle);
}

.revision-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--modal-scrim);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.revision-modal {
  width: min(480px, 100%);
  max-height: 90vh;
  overflow-y: auto;
}

.revision-modal__comment {
  width: 100%;
  margin-bottom: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}

.revision-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.clients-table-panel {
  width: 100%;
}

.clients-table td.clients-table__email {
  font-size: inherit;
}

.job-card-submit-btn {
  background: var(--arc-blue);
  color: var(--white);
  align-self: stretch;
  font-weight: 600;
}

.job-card-submit-btn:hover:not(:disabled) {
  background: var(--arc-blue-hover);
}

.job-card__emp-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.job-grid-empty {
  grid-column: 1 / -1;
}

.job-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.job-filters select,
.job-filters input[type="search"] {
  width: auto;
  min-width: 160px;
  margin: 0;
}

.job-filters input[type="search"] {
  flex: 1;
  min-width: 200px;
}

.jobs-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.job-card--unassigned {
  border-left: 4px solid var(--arc-blue);
}

.job-card--accepted {
  border-left: 4px solid var(--success-green);
}

.job-card--completed {
  opacity: 0.55;
  animation: job-fade-complete 0.6s ease-out both;
}

@keyframes job-fade-complete {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0.55;
    transform: scale(0.99);
  }
}

.job-card__time {
  font-size: var(--text-sm);
  font-weight: 600;
  margin: 0;
}

.job-card__time--live {
  color: var(--arc-blue);
}

.job-card__time--overdue {
  color: var(--malaga-red);
}

.job-card__time--live .job-timer {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.job-card__time--done {
  color: var(--success-green);
}

.job-card__time-label {
  font-weight: 600;
}

/* Brand kit — designer job views */
.brand-kit-panel {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(34, 36, 74, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.65);
  text-align: left;
}
.brand-kit-panel--compact {
  font-size: var(--text-sm);
  max-height: 280px;
  overflow: auto;
}
.brand-kit-panel__head {
  margin-bottom: 8px;
}
.brand-kit-warning {
  margin: 8px 0 12px;
}
.brand-kit-warning-label {
  font-size: var(--text-caption);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 8px 0 4px;
  color: #991b1b;
}
.brand-kit-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.brand-kit-logo {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 140px;
}
.brand-kit-logo img {
  width: 100%;
  max-height: 72px;
  object-fit: contain;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid rgba(34, 36, 74, 0.08);
}
.brand-kit-logo-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--text-caption);
}
.brand-kit-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.brand-kit-swatch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(34, 36, 74, 0.12);
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: var(--text-sm);
}
.brand-kit-swatch-chip {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--swatch, #ccc);
  border: 1px solid rgba(0, 0, 0, 0.12);
}
.brand-kit-meta {
  margin: 6px 0;
  font-size: var(--text-sm);
}
.brand-kit-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 8px 0;
}
.brand-kit-col-label {
  font-size: var(--text-caption);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 4px;
  color: rgba(34, 36, 74, 0.55);
}
.brand-kit-list {
  margin: 0;
  padding-left: 1.1em;
  font-size: var(--text-sm);
}
.brand-kit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}
.brand-kit-chips-label {
  font-size: var(--text-caption);
  font-weight: 700;
  color: rgba(34, 36, 74, 0.55);
  margin-right: 4px;
}
.brand-kit-chip {
  border: 1px solid rgba(34, 36, 74, 0.12);
  background: #f1f5f9;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: var(--text-caption);
  cursor: pointer;
}
.brand-kit-guardrail {
  border: 1px solid #f59e0b;
  background: #fffbeb;
  border-radius: 10px;
  padding: 12px 14px;
}
.brand-kit-guardrail-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 8px 0;
  font-size: 13px;
  cursor: pointer;
}
.brand-kit-guard-kind {
  font-weight: 700;
  color: #b45309;
  white-space: nowrap;
}
.brand-kit-from {
  margin-top: 4px;
}
.brand-kit-from-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.brand-kit-from-item {
  width: 96px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--text-caption);
}
.brand-kit-from-item img,
.brand-kit-from-ph {
  width: 96px;
  height: 64px;
  object-fit: contain;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid rgba(34, 36, 74, 0.08);
}

.client-instructions {
  margin-top: 12px;
  padding: 16px 18px;
  border: 2px solid var(--piki-blue, #3b5bdb);
  border-radius: 12px;
  background: var(--n-50, #f8fafc);
  text-align: left;
}
.client-instructions--compact {
  font-size: var(--text-sm);
  padding: 12px 14px;
}
.client-instructions-panel {
  margin-bottom: 20px;
}
.client-instructions-panel > .client-instructions {
  margin-top: 0;
  padding: 0;
  border: none;
  background: transparent;
}
.client-instructions__title {
  margin: 4px 0 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--deep-blue);
  line-height: 1.35;
}
.client-instructions--compact .client-instructions__title {
  font-size: 16px;
}
.client-instructions__brief {
  margin: 0;
}
.client-instructions__attachments {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #e2e8f0);
}
.client-instructions__attachments .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

/* Portal messaging */
.msg-widget {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.65);
  margin-top: 16px;
}
.msg-widget-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.msg-list {
  max-height: 320px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  padding-right: 4px;
}
.msg-bubble {
  border-radius: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.msg-bubble.msg-role-client { background: #eff6ff; border-color: #bfdbfe; }
.msg-bubble.msg-role-employee,
.msg-bubble.msg-role-admin { background: #f0fdf4; border-color: #bbf7d0; }
.msg-meta { margin-bottom: 4px; }
.msg-body { white-space: pre-wrap; font-size: 14px; line-height: 1.45; }
.msg-attachments { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.msg-attach-link {
  font-size: var(--text-sm);
  padding: 4px 8px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
}
.msg-compose-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.msg-attach-preview { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.msg-attach-chip {
  font-size: var(--text-caption);
  padding: 4px 8px;
  border-radius: 999px;
  background: #ede9fe;
  color: #5b21b6;
}
.msg-inbox-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 800px) {
  .msg-inbox-layout { grid-template-columns: 1fr; }
}
.msg-inbox-list { display: flex; flex-direction: column; gap: 8px; }
.msg-inbox-row {
  text-align: left;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}
.msg-inbox-row.active { border-color: #6366f1; background: #eef2ff; }
.msg-inbox-row-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* CRM */
.crm-health {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: var(--text-sm);
}
.crm-health--healthy { background: #d1fae5; color: #065f46; }
.crm-health--watch { background: #fef3c7; color: #92400e; }
.crm-health--risk { background: #fee2e2; color: #991b1b; }
.crm-stage {
  display: inline-block;
  font-size: var(--text-caption);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
}
.crm-stage--at_risk { background: #fee2e2; color: #991b1b; }
.crm-stage--churned { background: #f1f5f9; color: #64748b; }
.crm-stage--lead { background: #ede9fe; color: #5b21b6; }
.crm-tag {
  display: inline-block;
  font-size: var(--text-caption);
  padding: 2px 8px;
  margin: 2px 4px 2px 0;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
}
.crm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 12px;
}
.crm-tab {
  border: 1px solid var(--gray-200);
  background: var(--white);
  border-radius: var(--radius-full);
  padding: 8px 14px;
  font-size: var(--text-caption);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.crm-tab:hover:not(.active) {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.crm-tab.active {
  background: var(--arc-blue-50);
  border-color: var(--arc-blue-200);
  color: var(--arc-blue-700);
}
.crm-profile-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.crm-quick-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.crm-profile-panel { padding: 18px; }
.crm-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.crm-stat-card {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.6);
}
.crm-stat-label { display: block; font-size: var(--text-caption); color: #64748b; margin-bottom: 6px; }
.crm-note-list { margin: 0; padding-left: 18px; }
.crm-note {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: rgba(255,255,255,0.65);
}
.crm-note--pinned { border-color: #6366f1; background: #eef2ff; }
.crm-note-head { margin-bottom: 6px; }
.crm-note-compose { margin-bottom: 16px; }

@media (prefers-reduced-motion: reduce) {
  .btn-signout:hover:not(:disabled),
  .btn-signout:active:not(:disabled) {
    transform: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Portal premium polish — light SaaS motion & components
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --motion-fast: 150ms;
  --motion-normal: 200ms;
  --motion-slow: 250ms;
  --shadow-xs: 0 1px 2px rgba(11, 37, 69, 0.04);
  --shadow-hover: 0 6px 20px rgba(11, 37, 69, 0.08), 0 2px 6px rgba(30, 94, 255, 0.06);
  --shadow-focus: 0 0 0 3px var(--blue-50);
  --frosted-surface: rgba(255, 255, 255, 0.94);
  --hairline: 1px solid var(--n-200);
}

/* —— Buttons: press + lift —— */
.app-portal .btn {
  position: relative;
  isolation: isolate;
}

@media (prefers-reduced-motion: no-preference) {
  .app-portal .btn:hover:not(:disabled) {
    transform: translateY(-1px);
  }

  .app-portal .btn:active:not(:disabled) {
    transform: scale(0.98) translateY(0);
    transition-duration: 80ms;
  }

  .app-portal .btn-primary {
    background-image: linear-gradient(180deg, #2f6fff 0%, var(--blue-500) 100%);
  }

  .app-portal .btn-primary:hover:not(:disabled) {
    background-image: linear-gradient(180deg, #3d7aff 0%, var(--blue-600) 100%);
    box-shadow: var(--shadow-hover);
  }
}

.app-portal .btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus), var(--shadow-sm);
}

/* —— Inputs: animated focus ring —— */
.app-portal input:not([type="checkbox"]):not([type="radio"]),
.app-portal select,
.app-portal textarea,
.app-portal .glass-field {
  transition:
    border-color var(--motion-fast) var(--ease-out),
    box-shadow var(--motion-fast) var(--ease-out),
    background var(--motion-fast) var(--ease-out);
}

.app-portal input:focus-visible,
.app-portal select:focus-visible,
.app-portal textarea:focus-visible,
.app-portal .glass-field:focus-visible {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: var(--shadow-focus);
}

/* —— Cards & interactive rows —— */
.app-portal .card,
.app-portal .stat-card,
.app-portal .price-card,
.app-portal .panel:not(.panel-flush),
.app-portal .job-panel {
  transition:
    box-shadow var(--motion-normal) var(--ease-out),
    border-color var(--motion-normal) var(--ease-out),
    transform var(--motion-normal) var(--ease-out);
}

@media (prefers-reduced-motion: no-preference) {
  .app-portal .card:hover,
  .app-portal .stat-card:hover,
  .app-portal .price-card:hover,
  .app-portal .job-panel:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--n-300);
  }

  .app-portal tbody tr {
    transition: background var(--motion-fast) var(--ease-out);
  }
}

.app-portal tbody tr[role="button"],
.app-portal tbody tr.is-clickable,
.app-portal .panel tbody tr {
  cursor: default;
}

.app-portal .panel tbody tr:hover {
  background: var(--blue-50);
}

.app-portal table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--white);
  box-shadow: 0 1px 0 var(--n-200);
}

.app-portal .th-sortable {
  cursor: pointer;
  user-select: none;
}

.app-portal .th-sortable::after {
  content: "↕";
  margin-left: 6px;
  font-size: 12px;
  color: var(--n-400);
  opacity: 0.6;
}

/* —— Content reveal —— */
@keyframes portal-content-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  .app-portal.portal-ready .portal-reveal {
    animation: portal-content-in var(--motion-slow) var(--ease-out) both;
    animation-delay: calc(var(--reveal-i, 0) * 40ms);
  }

  .app-portal.portal-ready .portal-reveal-root > .page-header {
    --reveal-i: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-portal .portal-reveal {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}

/* —— Nav active + badges —— */
.app-portal .nav-link {
  transition:
    background var(--motion-fast) var(--ease-out),
    color var(--motion-fast) var(--ease-out),
    padding-left var(--motion-normal) var(--ease-out);
}

.app-portal .nav-link.active {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 3px 0 0 var(--blue-400);
}

.app-portal .nav-badge {
  transition: transform var(--motion-fast) var(--ease-out);
}

@media (prefers-reduced-motion: no-preference) {
  .app-portal .nav-link.active .nav-badge {
    animation: nav-badge-pop 400ms var(--ease-out);
  }
}

@keyframes nav-badge-pop {
  0% { transform: scale(0.85); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* —— Tabs: animated underline —— */
.app-portal .role-tabs,
.app-portal .crm-tabs {
  position: relative;
}

.app-portal .role-tab,
.app-portal .crm-tab {
  transition:
    color var(--motion-fast) var(--ease-out),
    background var(--motion-fast) var(--ease-out),
    box-shadow var(--motion-fast) var(--ease-out);
}

.app-portal .role-tab.active,
.app-portal .crm-tab.active {
  box-shadow: inset 0 -2px 0 var(--blue-500);
}

/* —— Modals —— */
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes modal-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  .modal-overlay {
    animation: modal-backdrop-in var(--motion-normal) var(--ease-out);
  }

  .modal-panel,
  .revision-modal {
    animation: modal-in var(--motion-slow) var(--ease-out);
  }

  .sidebar.open {
    transition: transform var(--motion-slow) var(--ease-out);
  }
}

/* —— Toast —— */
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(12px);
  opacity: 0;
  transition:
    transform var(--motion-normal) var(--ease-out),
    opacity var(--motion-normal) var(--ease-out);
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.toast--success {
  background: var(--success);
  border-color: rgba(255, 255, 255, 0.15);
}

.toast__icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.toast__icon svg {
  width: 18px;
  height: 18px;
}

/* —— Skeletons —— */
.skeleton-zone {
  padding: 4px 0;
}

.skeleton {
  display: block;
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    var(--n-100) 0%,
    var(--n-50) 40%,
    var(--n-100) 80%
  );
  background-size: 200% 100%;
  min-height: 14px;
}

@media (prefers-reduced-motion: no-preference) {
  .skeleton {
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
  }
}

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

.skeleton-text { height: 14px; margin: 6px 0; }
.skeleton-text--sm { height: 10px; }
.skeleton-pill { width: 72px; height: 22px; border-radius: 999px; }
.skeleton-block { width: 100%; border-radius: var(--radius); }
.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-bottom: 12px;
}
.skeleton-avatar--sm { width: 32px; height: 32px; margin: 0; }
.skeleton-avatar--lg { width: 64px; height: 64px; }

.skeleton-card {
  padding: 16px;
  border: var(--hairline);
  border-radius: var(--radius);
  background: var(--white);
}

.skeleton-zone--cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.skeleton-zone--media {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.skeleton-media-tile {
  aspect-ratio: 1;
  border-radius: var(--radius);
}

.skeleton-zone--calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.skeleton-cal-cell {
  aspect-ratio: 1.1;
  border-radius: var(--radius-sm);
}

.skeleton-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.skeleton-row td {
  padding: 14px 16px;
}

/* —— Avatars —— */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  background: var(--blue-100);
  border: var(--hairline);
  flex-shrink: 0;
}

.avatar--sm { width: 28px; height: 28px; font-size: 12px; }
.avatar--lg { width: 48px; height: 48px; font-size: 16px; }

.avatar[data-hue="1"] { background: #dbe6ff; color: #163f9e; }
.avatar[data-hue="2"] { background: #ecfdf3; color: #128a3a; }
.avatar[data-hue="3"] { background: #fffbeb; color: #b8860b; }
.avatar[data-hue="4"] { background: #fef2f2; color: #c0392b; }

/* —— Chips, toggles, progress —— */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: var(--text-caption);
  font-weight: 600;
  border: var(--hairline);
  background: var(--white);
  color: var(--n-500);
}

.chip--blue { background: var(--blue-50); border-color: var(--blue-100); color: var(--blue-700); }
.chip--success { background: var(--success-bg); border-color: var(--success-border); color: var(--success); }

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: var(--n-300);
  border: none;
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease-out);
}

.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow-xs);
  transition: transform var(--motion-fast) var(--ease-out);
}

.toggle[aria-checked="true"] {
  background: var(--blue-500);
}

.toggle[aria-checked="true"]::after {
  transform: translateX(20px);
}

.progress-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--n-100);
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-400), var(--blue-500));
  transition: width var(--motion-slow) var(--ease-out);
}

/* —— Tooltips —— */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--white);
  background: var(--navy);
  border-radius: var(--radius-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-fast), transform var(--motion-fast);
  z-index: 100;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* —— Segmented control —— */
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--n-100);
  border-radius: var(--radius);
  border: var(--hairline);
}

.segmented__btn {
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: var(--text-caption);
  font-weight: 600;
  color: var(--n-500);
  cursor: pointer;
  transition: background var(--motion-fast), color var(--motion-fast), box-shadow var(--motion-fast);
}

.segmented__btn[aria-selected="true"] {
  background: var(--white);
  color: var(--navy);
  box-shadow: var(--shadow-xs);
}

/* —— Frosted overlay (light, legible) —— */
.surface-frosted {
  background: var(--frosted-surface);
  border-bottom: var(--hairline);
}

@supports (backdrop-filter: blur(8px)) {
  .surface-frosted--blur {
    backdrop-filter: blur(8px) saturate(140%);
    -webkit-backdrop-filter: blur(8px) saturate(140%);
  }
}

/* —— Celebration burst —— */
.celebrate-burst {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.celebrate-burst span {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue-400);
  animation: celebrate-pop 700ms var(--ease-out) forwards;
}

.celebrate-burst span:nth-child(1) { --a: 0deg; background: var(--blue-500); }
.celebrate-burst span:nth-child(2) { --a: 60deg; background: #17d1c8; }
.celebrate-burst span:nth-child(3) { --a: 120deg; }
.celebrate-burst span:nth-child(4) { --a: 180deg; background: var(--success); }
.celebrate-burst span:nth-child(5) { --a: 240deg; }
.celebrate-burst span:nth-child(6) { --a: 300deg; background: #17d1c8; }

@keyframes celebrate-pop {
  0% { transform: rotate(var(--a)) translateY(0) scale(1); opacity: 1; }
  100% { transform: rotate(var(--a)) translateY(-48px) scale(0); opacity: 0; }
}

/* —— Command palette —— */
.cmd-palette-root {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
}

.cmd-palette-root[hidden] { display: none !important; }

.cmd-palette-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 37, 69, 0.4);
}

.cmd-palette {
  position: relative;
  width: min(560px, 100%);
  background: var(--white);
  border: var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  transform: scale(0.98) translateY(-8px);
  transition: opacity var(--motion-normal) var(--ease-out), transform var(--motion-normal) var(--ease-out);
}

.cmd-palette-root.is-open .cmd-palette {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.cmd-palette__search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: var(--hairline);
}

.cmd-palette__search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 16px;
  color: var(--ink);
  margin: 0;
  padding: 0;
  min-height: 28px;
}

.cmd-palette__search input:focus {
  outline: none;
  box-shadow: none;
}

.cmd-palette__icon {
  display: inline-flex;
  color: var(--n-400);
  width: 20px;
  height: 20px;
}

.cmd-palette__icon svg { width: 20px; height: 20px; }

.cmd-palette__kbd {
  font-size: var(--text-caption);
  padding: 3px 7px;
  border-radius: 6px;
  border: var(--hairline);
  color: var(--n-500);
  background: var(--n-50);
  text-transform: uppercase;
}

.cmd-palette__list {
  list-style: none;
  margin: 0;
  padding: 8px;
  max-height: 320px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.cmd-palette__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: background var(--motion-fast);
}

.cmd-palette__item:hover,
.cmd-palette__item.is-active {
  background: var(--blue-50);
  color: var(--navy);
}

.cmd-palette__item-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  color: var(--blue-500);
}

.cmd-palette__item-icon svg { width: 18px; height: 18px; }

.cmd-palette__foot {
  display: flex;
  gap: 16px;
  padding: 10px 16px;
  border-top: var(--hairline);
  font-size: var(--text-caption);
  color: var(--n-500);
}

.cmd-palette__foot kbd {
  font-size: var(--text-sm);
  padding: 2px 5px;
  border-radius: 4px;
  border: var(--hairline);
  background: var(--n-50);
  margin: 0 2px;
}

body.cmd-palette-open { overflow: hidden; }

/* —— Empty states —— */
.empty-state-card {
  transition: box-shadow var(--motion-normal) var(--ease-out);
}

.empty-state-card .btn {
  margin-top: var(--space-2);
}

/* —— Touch & mobile —— */
@media (max-width: 768px) {
  .app-portal .btn {
    min-height: 44px;
  }

  .app-portal .nav-link {
    min-height: 44px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .app-portal .app-main {
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }

  .mobile-menu-btn {
    bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

.pipeline-step__num .pipeline-check-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  color: var(--white);
}

.pipeline-step__num .pipeline-check-icon svg {
  width: 16px;
  height: 16px;
}

@media (prefers-reduced-motion: reduce) {
  .celebrate-burst { display: none; }
  .cmd-palette { transition: none; }
  .toast { transition: none; opacity: 1; transform: none; }
  .modal-overlay,
  .modal-panel,
  .revision-modal { animation: none !important; }
  .app-portal .btn:hover:not(:disabled),
  .app-portal .btn:active:not(:disabled) { transform: none; }
}

