@import url("tokens.css");

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--alec-slate-50);
  color: var(--alec-ink);
  font-family: var(--alec-font-body);
  font-size: var(--alec-text-md);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

a { color: inherit; text-decoration: none; }

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

h1,
h2,
h3,
h4,
p { margin-top: 0; }

h1,
h2,
h3,
h4 {
  font-family: var(--alec-font-display);
  letter-spacing: -0.025em;
  line-height: 1.12;
}

:focus-visible {
  outline: 3px solid rgba(86, 194, 243, 0.42);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: var(--alec-space-4);
  top: -80px;
  z-index: 1000;
  border-radius: var(--alec-radius-sm);
  background: var(--alec-white);
  color: var(--alec-navy-950);
  padding: 0.7rem 1rem;
  box-shadow: var(--alec-shadow-md);
  transition: top var(--alec-speed) var(--alec-ease);
}

.skip-link:focus { top: var(--alec-space-4); }

.portal {
  min-height: 100vh;
  background:
    radial-gradient(circle at 5% 0%, rgba(86, 194, 243, 0.08), transparent 25rem),
    var(--alec-slate-50);
}

.portal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 0 var(--alec-space-8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(7, 30, 51, 0.96);
  color: var(--alec-white);
  backdrop-filter: blur(18px);
}

.portal-brand,
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.portal-brand img,
.brand-lockup img {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: white;
  object-fit: contain;
  padding: 3px;
  box-shadow: 0 7px 22px rgba(0, 0, 0, 0.18);
}

.portal-brand strong,
.brand-lockup strong { display: block; font-family: var(--alec-font-display); line-height: 1.05; }

.portal-brand small,
.brand-lockup small {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
  text-transform: uppercase;
}

.portal-nav { display: flex; align-items: center; gap: 0.35rem; }

.portal-nav a {
  border-radius: var(--alec-radius-pill);
  color: rgba(255, 255, 255, 0.68);
  font-size: var(--alec-text-sm);
  font-weight: 700;
  padding: 0.64rem 0.92rem;
  transition: background var(--alec-speed-fast), color var(--alec-speed-fast);
}

.portal-nav a:hover,
.portal-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.11);
  color: var(--alec-white);
}

.portal-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid rgba(86, 194, 243, 0.25);
  border-radius: var(--alec-radius-pill);
  color: var(--alec-sky-200);
  font-size: var(--alec-text-xs);
  font-weight: 800;
  padding: 0.42rem 0.7rem;
}

.portal-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--alec-sky-400);
  box-shadow: 0 0 0 4px rgba(86, 194, 243, 0.14);
  content: "";
}

.mobile-nav-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  cursor: pointer;
}

.portal-main { min-height: calc(100vh - 76px); }

.ds-container,
.public-container {
  width: min(calc(100% - 40px), var(--alec-container));
  margin-inline: auto;
}

.ds-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(4.5rem, 10vw, 8.5rem) 0 5.5rem;
  background: var(--alec-navy-950);
  color: white;
}

.ds-hero::before,
.ds-hero::after {
  position: absolute;
  border: 1px solid rgba(86, 194, 243, 0.2);
  border-radius: 50%;
  content: "";
}

.ds-hero::before { width: 520px; height: 520px; right: -120px; top: -250px; }
.ds-hero::after { width: 300px; height: 300px; right: -10px; top: -140px; }

.ds-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--alec-gold-300);
  font-size: var(--alec-text-xs);
  font-weight: 900;
  letter-spacing: 0.14em;
  margin-bottom: var(--alec-space-5);
  text-transform: uppercase;
}

.eyebrow::before { width: 24px; height: 2px; background: currentColor; content: ""; }

.ds-hero h1 {
  max-width: 820px;
  font-size: var(--alec-text-4xl);
  margin-bottom: var(--alec-space-6);
}

.ds-hero h1 span { color: var(--alec-sky-300); }

.ds-hero .lead {
  max-width: 690px;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
}

.hero-note {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--alec-radius-xl);
  background: rgba(255, 255, 255, 0.07);
  padding: var(--alec-space-6);
  backdrop-filter: blur(14px);
}

.hero-note strong { display: block; font-size: 1.2rem; margin-bottom: 0.5rem; }
.hero-note p { color: rgba(255, 255, 255, 0.68); margin-bottom: 0; }

.ds-section { padding: clamp(4rem, 8vw, 7rem) 0; }
.ds-section + .ds-section { border-top: 1px solid var(--alec-slate-200); }
.ds-section.dark { background: var(--alec-navy-950); color: white; }

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(280px, 1fr);
  gap: 2rem;
  align-items: end;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

.section-heading h2 { font-size: var(--alec-text-3xl); margin-bottom: 0; }
.section-heading p { color: var(--alec-slate-600); margin-bottom: 0; max-width: 680px; }
.dark .section-heading p { color: rgba(255, 255, 255, 0.64); }

.principle-grid,
.token-grid,
.inventory-grid,
.component-grid,
.state-grid,
.flow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--alec-space-5);
}

.principle-card,
.inventory-card,
.component-panel,
.state-card,
.flow-card,
.surface-card {
  border: 1px solid var(--alec-slate-200);
  border-radius: var(--alec-radius-lg);
  background: var(--alec-white);
  box-shadow: var(--alec-shadow-sm);
}

.principle-card { min-height: 230px; padding: var(--alec-space-8); }
.principle-number { color: var(--alec-sky-600); font-family: var(--alec-font-mono); font-size: var(--alec-text-sm); }
.principle-card h3 { font-size: var(--alec-text-xl); margin: 2.6rem 0 0.65rem; }
.principle-card p { color: var(--alec-slate-600); margin-bottom: 0; }

.color-family { margin-bottom: var(--alec-space-10); }
.color-family h3 { font-size: var(--alec-text-lg); margin-bottom: var(--alec-space-4); }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.7rem; }
.swatch { overflow: hidden; border-radius: var(--alec-radius-md); background: white; box-shadow: var(--alec-shadow-sm); }
.swatch-color { height: 92px; }
.swatch-meta { padding: 0.75rem; }
.swatch-meta strong { display: block; font-size: var(--alec-text-xs); }
.swatch-meta code { color: var(--alec-slate-600); font-family: var(--alec-font-mono); font-size: 0.69rem; }

.type-specimen {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: var(--alec-space-8);
  align-items: baseline;
  padding: var(--alec-space-6) 0;
  border-bottom: 1px solid var(--alec-slate-200);
}

.type-specimen code { color: var(--alec-slate-600); font-family: var(--alec-font-mono); font-size: var(--alec-text-xs); }
.type-display { font-family: var(--alec-font-display); font-size: clamp(2.4rem, 6vw, 5.2rem); font-weight: 700; letter-spacing: -0.06em; line-height: 0.95; }
.type-heading { font-family: var(--alec-font-display); font-size: 2rem; font-weight: 700; }
.type-body { max-width: 720px; color: var(--alec-slate-700); font-size: 1.05rem; }

.spacing-row { display: flex; align-items: flex-end; gap: 0.5rem; margin-top: 2rem; }
.space-token { display: grid; place-items: end center; flex: 1; min-width: 34px; border-radius: 7px 7px 0 0; background: linear-gradient(180deg, var(--alec-sky-300), var(--alec-sky-500)); color: var(--alec-navy-950); font: 700 0.66rem var(--alec-font-mono); padding-bottom: 0.35rem; }

.component-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.component-panel { padding: var(--alec-space-8); }
.component-panel.wide { grid-column: 1 / -1; }
.component-panel h3 { margin-bottom: 0.4rem; }
.component-panel > p { color: var(--alec-slate-600); font-size: var(--alec-text-sm); }
.specimen-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1.4rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--alec-radius-pill);
  cursor: pointer;
  font-weight: 800;
  padding: 0.68rem 1.05rem;
  transition: transform var(--alec-speed-fast), box-shadow var(--alec-speed-fast), background var(--alec-speed-fast);
}

.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--alec-navy-950); color: white; box-shadow: 0 8px 20px rgba(7, 30, 51, 0.18); }
.btn-primary:hover { background: var(--alec-navy-800); }
.btn-sky { background: var(--alec-sky-400); color: var(--alec-navy-950); }
.btn-gold { background: var(--alec-gold-400); color: var(--alec-navy-950); }
.btn-secondary { border-color: var(--alec-slate-300); background: white; color: var(--alec-navy-950); }
.btn-ghost { background: transparent; color: var(--alec-navy-700); }
.btn-danger { background: var(--alec-danger-bg); color: var(--alec-danger); }
.btn:disabled { cursor: not-allowed; opacity: 0.45; transform: none; }

/* Restrained attention cue for the few primary calls to action: a slow, soft ring, not a bounce. */
.field-error { color: var(--alec-danger); font-weight: 700; }
@keyframes btn-attention-ring {
  0%, 60%, 100% { box-shadow: 0 8px 20px rgba(7, 30, 51, 0.18), 0 0 0 0 rgba(86, 194, 243, 0), 0 0 0 0 rgba(86, 194, 243, 0); }
  30% { box-shadow: 0 8px 20px rgba(7, 30, 51, 0.18), 0 0 0 7px rgba(86, 194, 243, 0.55), 0 0 28px 10px rgba(86, 194, 243, 0.5); }
}
.btn-attention { animation: btn-attention-ring 2.8s ease-in-out infinite; }
.btn-attention:hover, .btn-attention:focus-visible { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .btn-attention { animation: none; }
}

.field { display: grid; gap: 0.42rem; width: 100%; }
.field label { color: var(--alec-navy-950); font-size: var(--alec-text-sm); font-weight: 800; }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--alec-slate-300);
  border-radius: 11px;
  background: white;
  color: var(--alec-ink);
  padding: 0.72rem 0.82rem;
  transition: border var(--alec-speed-fast), box-shadow var(--alec-speed-fast);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--alec-sky-500); box-shadow: 0 0 0 4px rgba(86, 194, 243, 0.16); outline: 0; }
.field small { color: var(--alec-slate-600); }
.field.error input { border-color: var(--alec-danger); }

/* Same box treatment as `.field select`, for a <select> used standalone
   (e.g. AutoSubmitSelect's inline status/role/category dropdowns) rather
   than inside a full labeled .field block. */
.select-input {
  min-height: 38px;
  border: 1px solid var(--alec-slate-300);
  border-radius: 11px;
  background: white;
  color: var(--alec-ink);
  padding: 0.45rem 0.6rem;
  font: inherit;
  transition: border var(--alec-speed-fast), box-shadow var(--alec-speed-fast);
}
.select-input:focus { border-color: var(--alec-sky-500); box-shadow: 0 0 0 4px rgba(86, 194, 243, 0.16); outline: 0; }
.select-input:disabled { opacity: .6; cursor: default; }
.field.error small { color: var(--alec-danger); }

.badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: var(--alec-radius-pill);
  font-size: var(--alec-text-xs);
  font-weight: 800;
  padding: 0.32rem 0.62rem;
}
.badge { background: var(--alec-sky-100); color: var(--alec-sky-800); }
.status-live { background: var(--alec-success-bg); color: var(--alec-success); }
.status-draft { background: var(--alec-slate-100); color: var(--alec-slate-700); }
.status-review { background: var(--alec-warning-bg); color: var(--alec-warning); }
.status-closed { background: var(--alec-danger-bg); color: var(--alec-danger); }

.alert { display: flex; gap: 0.8rem; align-items: flex-start; border-radius: var(--alec-radius-md); padding: 1rem; font-size: var(--alec-text-sm); }
.alert strong { display: block; margin-bottom: 0.15rem; }
.alert-info { background: var(--alec-info-bg); color: #1a5e92; }
.alert-success { background: var(--alec-success-bg); color: #176b51; }
.alert-warning { background: var(--alec-warning-bg); color: #855612; }
.alert-danger { background: var(--alec-danger-bg); color: #8e2d37; }

.table-wrap { overflow-x: auto; border: 1px solid var(--alec-slate-200); border-radius: var(--alec-radius-md); }
.data-table { width: 100%; border-collapse: collapse; background: white; }
.data-table th,
.data-table td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--alec-slate-200); text-align: left; white-space: nowrap; }
.data-table th { background: var(--alec-slate-50); color: var(--alec-slate-600); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; }
.data-table tr:last-child td { border-bottom: 0; }

.state-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.state-card { padding: var(--alec-space-6); }
.state-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: var(--alec-slate-100); color: var(--alec-navy-700); font-size: 1.2rem; }
.state-card h3 { margin: 1.5rem 0 0.45rem; font-size: 1rem; }
.state-card p { color: var(--alec-slate-600); font-size: var(--alec-text-sm); margin-bottom: 0; }

.inventory-card { padding: var(--alec-space-6); }
.inventory-card .count { color: var(--alec-sky-600); font: 800 2rem var(--alec-font-display); }
.inventory-card h3 { margin: 0.6rem 0; }
.inventory-card ul { list-style: none; padding: 0; margin: 0; color: var(--alec-slate-600); font-size: var(--alec-text-sm); }
.inventory-card li { padding: 0.35rem 0; }
.inventory-card li::before { color: var(--alec-gold-500); content: "•"; margin-right: 0.55rem; }

.preview-toolbar {
  position: sticky;
  top: 76px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.72rem max(20px, calc((100% - var(--alec-container)) / 2));
  border-bottom: 1px solid var(--alec-slate-200);
  background: rgba(247, 249, 251, 0.94);
  backdrop-filter: blur(16px);
}
.preview-toolbar > strong { flex: 0 0 auto; color: var(--alec-navy-950); font-size: var(--alec-text-sm); }
.screen-tabs { display: flex; gap: 0.35rem; overflow-x: auto; scrollbar-width: none; }
.screen-tabs::-webkit-scrollbar { display: none; }
.screen-tab { flex: 0 0 auto; border: 1px solid transparent; border-radius: var(--alec-radius-pill); background: transparent; color: var(--alec-slate-600); cursor: pointer; font-size: 0.78rem; font-weight: 800; padding: 0.48rem 0.78rem; }
.screen-tab:hover { color: var(--alec-navy-950); }
.screen-tab.active { border-color: var(--alec-slate-200); background: white; color: var(--alec-navy-950); box-shadow: var(--alec-shadow-sm); }
.prototype-canvas { min-height: calc(100vh - 132px); background: white; }

/* Public website */
.public-site { min-height: 100%; background: white; color: var(--alec-ink); }
.public-topline { background: var(--alec-navy-950); color: rgba(255, 255, 255, 0.74); font-size: 0.75rem; }
.public-topline .public-container { display: flex; justify-content: space-between; gap: 1rem; padding-block: 0.48rem; }
/* top: 0, not the prototype's 132px — that offset only made sense inside the
   design-system tool's own portal chrome (nav bar + screen-tabs toolbar)
   stacked above the public site preview, which doesn't exist in the real app. */
.public-header { position: sticky; top: 0; z-index: 60; border-bottom: 1px solid rgba(16, 47, 75, 0.09); background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(18px); }
.public-nav { display: flex; align-items: center; justify-content: space-between; min-height: 82px; gap: 1.5rem; }
.public-nav .brand-lockup img { width: 54px; height: 54px; box-shadow: none; border-color: var(--alec-slate-200); }
.public-nav .brand-lockup small { color: var(--alec-slate-600); }
.public-nav-links { display: flex; align-items: center; gap: 0.25rem; }
.public-nav-links button,
.public-nav-links a { border: 0; border-radius: var(--alec-radius-pill); background: transparent; color: var(--alec-slate-700); cursor: pointer; font-size: var(--alec-text-sm); font-weight: 800; padding: 0.6rem 0.8rem; text-decoration: none; }
.public-nav-links button:hover,
.public-nav-links a:hover,
.public-nav-links button.active,
.public-nav-links a.active { background: var(--alec-sky-50); color: var(--alec-sky-800); }
.public-menu-button { display: none; }

.public-hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(115deg, rgba(239, 250, 255, 0.96), rgba(255, 255, 255, 0.9) 52%, rgba(255, 249, 235, 0.84)),
    white;
  /* asymmetric on purpose: less top padding so hero content sits closer to
     the (now sticky-at-top-0, see Gotcha 2 in memory) header; more bottom
     padding to keep separation from the next section */
  padding: clamp(2rem, 4vw, 3rem) 0 clamp(4.5rem, 9vw, 8rem);
}
.public-hero::before { position: absolute; width: 560px; height: 560px; right: -230px; top: -220px; border: 1px solid var(--alec-sky-200); border-radius: 50%; content: ""; }
.public-hero-grid { display: grid; grid-template-columns: 1.08fr 0.92fr; gap: clamp(2.5rem, 7vw, 7rem); align-items: center; }
.public-hero h1 { max-width: 720px; color: var(--alec-navy-950); font-size: var(--alec-text-4xl); margin-bottom: 1.4rem; }
.public-hero h1 span { color: var(--alec-sky-600); }
.public-hero p { max-width: 650px; color: var(--alec-slate-700); font-size: clamp(1.05rem, 2vw, 1.25rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.trust-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.3rem; color: var(--alec-slate-600); font-size: var(--alec-text-sm); font-weight: 700; }
.trust-row span::before { color: var(--alec-success); content: "✓"; margin-right: 0.4rem; }

.impact-orbit { position: relative; display: grid; place-items: center; min-height: 470px; }
.impact-orbit::before,
.impact-orbit::after { position: absolute; border: 1px solid var(--alec-sky-200); border-radius: 50%; content: ""; }
.impact-orbit::before { width: 420px; height: 420px; }
.impact-orbit::after { width: 320px; height: 320px; }
.impact-core { position: relative; z-index: 2; display: grid; place-items: center; width: 240px; height: 300px; border-radius: 120px 120px 28px 28px; background: linear-gradient(165deg, var(--alec-sky-300), var(--alec-sky-600)); box-shadow: 0 30px 70px rgba(46, 168, 223, 0.28); }
.impact-core img { width: 130px; height: 130px; border-radius: 50%; background: white; object-fit: contain; padding: 8px; mix-blend-mode: multiply; }
.orbit-chip { position: absolute; z-index: 3; max-width: 190px; border: 1px solid rgba(255, 255, 255, 0.8); border-radius: var(--alec-radius-md); background: rgba(255, 255, 255, 0.88); color: var(--alec-navy-950); box-shadow: var(--alec-shadow-md); padding: 0.8rem 1rem; backdrop-filter: blur(14px); }
.orbit-chip strong { display: block; font-family: var(--alec-font-display); }
.orbit-chip small { color: var(--alec-slate-600); }
.orbit-chip.one { left: 0; top: 25%; }
.orbit-chip.two { right: -1rem; bottom: 20%; }
.orbit-chip.three { left: 1.5rem; bottom: 5%; }

.public-section { padding: clamp(4rem, 8vw, 7rem) 0; }
.public-section.tint { background: var(--alec-slate-50); }
.public-section.navy { background: var(--alec-navy-950); color: white; }
.public-heading { max-width: 740px; margin-bottom: 2.5rem; }
.public-heading.center { margin-inline: auto; text-align: center; }
.public-heading h2 { font-size: var(--alec-text-3xl); margin-bottom: 1rem; }
.public-heading p { color: var(--alec-slate-600); font-size: var(--alec-text-lg); }
.navy .public-heading p { color: rgba(255,255,255,.66); }

.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--alec-slate-200); border-radius: var(--alec-radius-xl); background: white; box-shadow: var(--alec-shadow-md); transform: translateY(-38px); }
.metric { padding: 1.6rem; border-right: 1px solid var(--alec-slate-200); }
.metric:last-child { border-right: 0; }
.metric strong { display: block; color: var(--alec-navy-950); font: 800 1.65rem var(--alec-font-display); }
.metric span { color: var(--alec-slate-600); font-size: var(--alec-text-sm); }

.service-grid,
.value-grid,
.product-grid,
.career-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.service-card,
.product-card,
.career-card { position: relative; overflow: hidden; border: 1px solid var(--alec-slate-200); border-radius: var(--alec-radius-lg); background: white; padding: 1.6rem; transition: transform var(--alec-speed) var(--alec-ease), box-shadow var(--alec-speed); }
.service-card:hover,
.product-card:hover,
.career-card:hover { transform: translateY(-4px); box-shadow: var(--alec-shadow-md); }
.card-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: var(--alec-sky-100); color: var(--alec-sky-800); font-size: 1.35rem; font-weight: 900; }
.service-card h3,
.product-card h3,
.career-card h3 { margin: 1.5rem 0 0.7rem; }
.service-card p,
.product-card p,
.career-card p { color: var(--alec-slate-600); }
.card-link { display: inline-flex; align-items: center; gap: 0.45rem; border: 0; background: none; color: var(--alec-sky-700); cursor: pointer; font-weight: 900; padding: 0; }

.story-grid,
.detail-grid,
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2rem, 7vw, 6rem); align-items: center; }
.story-art { position: relative; min-height: 430px; border-radius: var(--alec-radius-xl); background: linear-gradient(145deg, var(--alec-navy-950), var(--alec-sky-700)); overflow: hidden; box-shadow: var(--alec-shadow-lg); }
/* Logo-inspired pattern: the globe-and-hands mark repeated, white at low opacity on the gradient */
.story-art::after { position: absolute; inset: 0; background: url("/design-system/logo-pattern.png") center / 240px repeat; opacity: 0.1; content: ""; pointer-events: none; }
.story-art::before { position: absolute; inset: 12%; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; content: ""; }
.story-quote { z-index: 1; position: absolute; left: 2rem; right: 2rem; bottom: 2rem; border-radius: var(--alec-radius-lg); background: rgba(255,255,255,.11); color: white; padding: 1.5rem; backdrop-filter: blur(12px); }
.story-quote strong { display: block; color: var(--alec-gold-300); font-size: 1.5rem; margin-bottom: .4rem; }
.check-list { list-style: none; padding: 0; margin: 1.5rem 0; }
.check-list li { position: relative; padding: 0.55rem 0 0.55rem 2rem; }
.check-list li::before { position: absolute; left: 0; top: .5rem; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--alec-success-bg); color: var(--alec-success); content: "✓"; font-size: .72rem; font-weight: 900; }

.page-masthead { position: relative; overflow: hidden; padding: clamp(4rem, 8vw, 7rem) 0; background: var(--alec-navy-950); color: white; }
.page-masthead::after { position: absolute; width: 430px; height: 430px; right: -90px; top: -250px; border: 1px solid rgba(86,194,243,.22); border-radius: 50%; content: ""; }
.page-masthead h1 { max-width: 850px; font-size: var(--alec-text-3xl); }
.page-masthead p { max-width: 700px; color: rgba(255,255,255,.66); font-size: var(--alec-text-lg); }
.breadcrumbs { color: var(--alec-sky-200); font-size: var(--alec-text-sm); margin-bottom: 1.2rem; }

.value-grid { grid-template-columns: repeat(4, 1fr); }
.value-card { border-top: 3px solid var(--alec-sky-400); background: white; padding: 1.5rem; }
.value-card strong { display: block; font-family: var(--alec-font-display); font-size: 1.15rem; margin-bottom: .4rem; }
.value-card p { color: var(--alec-slate-600); margin-bottom: 0; font-size: var(--alec-text-sm); }

.product-card .product-type { color: var(--alec-sky-700); font-size: var(--alec-text-xs); font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.product-card .feature-list { display: grid; gap: .55rem; margin: 1.2rem 0; color: var(--alec-slate-700); font-size: var(--alec-text-sm); }
.product-card .feature-list span::before { color: var(--alec-gold-500); content: "•"; margin-right: .5rem; }
.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.filter-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.filter-chip { border: 1px solid var(--alec-slate-200); border-radius: var(--alec-radius-pill); background: white; color: var(--alec-slate-700); padding: .5rem .8rem; font-size: var(--alec-text-sm); font-weight: 800; }
.filter-chip.active { border-color: var(--alec-sky-300); background: var(--alec-sky-50); color: var(--alec-sky-800); }

.detail-aside { align-self: start; border: 1px solid var(--alec-slate-200); border-radius: var(--alec-radius-xl); background: white; box-shadow: var(--alec-shadow-md); padding: 1.5rem; }
.detail-aside .btn { width: 100%; }
.detail-fact { padding: 1rem 0; border-bottom: 1px solid var(--alec-slate-200); }
.detail-fact:last-of-type { border-bottom: 0; }
.detail-fact small { display: block; color: var(--alec-slate-600); }
.detail-fact strong { font-family: var(--alec-font-display); }

.contact-card { border: 1px solid var(--alec-slate-200); border-radius: var(--alec-radius-xl); background: white; box-shadow: var(--alec-shadow-md); padding: clamp(1.5rem, 4vw, 2.5rem); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.contact-details { display: grid; gap: 1rem; }
.contact-detail { display: flex; gap: 1rem; align-items: flex-start; padding: 1.1rem; border-radius: var(--alec-radius-md); background: var(--alec-slate-50); }
.contact-detail strong { display: block; }
.contact-detail span { color: var(--alec-slate-600); }
.map-placeholder { display: grid; place-items: center; min-height: 250px; border-radius: var(--alec-radius-lg); background: repeating-linear-gradient(45deg, var(--alec-slate-100), var(--alec-slate-100) 10px, var(--alec-slate-50) 10px, var(--alec-slate-50) 20px); color: var(--alec-slate-600); text-align: center; }

.career-card { display: flex; flex-direction: column; }
.career-meta { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .8rem; }
.career-card .card-link { margin-top: auto; }
.article { max-width: var(--alec-reading); }
.article h2 { margin: 2.5rem 0 1rem; }
.article p,
.article li { color: var(--alec-slate-700); }
.article li { margin-bottom: .5rem; }

.success-state,
.notfound-state { display: grid; place-items: center; min-height: 68vh; padding: 4rem 1.25rem; text-align: center; }
.success-mark { display: grid; place-items: center; width: 90px; height: 90px; border-radius: 50%; background: var(--alec-success-bg); color: var(--alec-success); font-size: 2.4rem; margin-bottom: 1.5rem; }
.notfound-code { color: var(--alec-sky-500); font: 900 clamp(5rem, 18vw, 12rem) / .8 var(--alec-font-display); letter-spacing: -.08em; }
.success-state h1,
.notfound-state h1 { font-size: var(--alec-text-3xl); }
.success-state p,
.notfound-state p { max-width: 600px; color: var(--alec-slate-600); }

.public-footer { padding: 4rem 0 1.5rem; background: var(--alec-navy-950); color: white; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
.public-footer h4 { color: var(--alec-sky-200); }
.public-footer p,
.public-footer li { color: rgba(255,255,255,.62); font-size: var(--alec-text-sm); }
.public-footer ul { list-style: none; padding: 0; }
.public-footer li { padding: .28rem 0; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.11); color: rgba(255,255,255,.48); font-size: var(--alec-text-xs); }

/* Admin console */
.admin-prototype { min-height: calc(100vh - 132px); background: #f4f7fa; }
/* min-height: 100vh, not the prototype's 132px-offset value — see the
   .public-header comment above for why. */
.admin-shell { display: grid; grid-template-columns: var(--alec-admin-sidebar) minmax(0, 1fr); min-height: 100vh; }
/* top: 0 / height: 100vh, not the prototype's 132px offset — see the
   .public-header comment above for why: that value only made sense inside
   the design-system tool's own portal chrome, which the real app doesn't have. */
.admin-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--alec-navy-950); color: white; padding: 1rem; }
.admin-sidebar .brand-lockup { margin: .25rem .35rem 1.5rem; }
.admin-sidebar .brand-lockup img { width: 42px; height: 42px; }
.admin-group-label { color: rgba(255,255,255,.4); font-size: .65rem; font-weight: 900; letter-spacing: .1em; margin: 1.2rem .75rem .45rem; text-transform: uppercase; }
.admin-nav { display: grid; gap: .2rem; }
.admin-nav button,
.admin-nav a { display: flex; align-items: center; gap: .7rem; width: 100%; border: 0; border-radius: 11px; background: transparent; color: rgba(255,255,255,.64); cursor: pointer; font-size: .82rem; font-weight: 700; padding: .68rem .75rem; text-align: left; text-decoration: none; }
.admin-nav button:hover,
.admin-nav a:hover,
.admin-nav button.active,
.admin-nav a.active { background: rgba(86,194,243,.12); color: white; }
.admin-nav button.active,
.admin-nav a.active { box-shadow: inset 3px 0 var(--alec-sky-400); }
.admin-nav .nav-icon { width: 22px; color: var(--alec-sky-300); text-align: center; }

.admin-main { min-width: 0; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding: 0 2rem; border-bottom: 1px solid var(--alec-slate-200); background: white; }
.admin-search { width: min(360px, 42vw); border: 1px solid var(--alec-slate-200); border-radius: var(--alec-radius-pill); background: var(--alec-slate-50); color: var(--alec-slate-700); padding: .62rem 1rem; }
.admin-user { display: flex; align-items: center; gap: .75rem; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--alec-sky-100); color: var(--alec-sky-800); font-size: .78rem; font-weight: 900; }
.admin-content { padding: clamp(1.25rem, 3.5vw, 2.5rem); }
.admin-titlebar { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.admin-titlebar h1 { font-size: 1.9rem; margin-bottom: .35rem; }
.admin-titlebar p { color: var(--alec-slate-600); margin-bottom: 0; }
.admin-actions { display: flex; flex-wrap: wrap; gap: .6rem; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.stat-card { border: 1px solid var(--alec-slate-200); border-radius: var(--alec-radius-lg); background: white; padding: 1.25rem; box-shadow: var(--alec-shadow-sm); }
.stat-top { display: flex; justify-content: space-between; color: var(--alec-slate-600); font-size: .78rem; font-weight: 800; }
.stat-card strong { display: block; font: 800 2rem var(--alec-font-display); margin: 1rem 0 .3rem; }
.trend-up { color: var(--alec-success); font-size: .75rem; font-weight: 800; }
.trend-neutral { color: var(--alec-slate-600); font-size: .75rem; font-weight: 800; }

.admin-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr); gap: 1rem; margin-top: 1rem; }
.admin-panel { border: 1px solid var(--alec-slate-200); border-radius: var(--alec-radius-lg); background: white; box-shadow: var(--alec-shadow-sm); }
.admin-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--alec-slate-200); }
.admin-panel-header h2 { font-size: 1rem; margin: 0; }
.admin-panel-body { padding: 1.25rem; }
.chart { display: flex; align-items: flex-end; gap: .6rem; height: 220px; padding-top: 1.5rem; }
.chart-bar { position: relative; flex: 1; min-width: 18px; border-radius: 8px 8px 2px 2px; background: linear-gradient(180deg, var(--alec-sky-300), var(--alec-sky-600)); }
.chart-bar span { position: absolute; left: 50%; bottom: -1.7rem; transform: translateX(-50%); color: var(--alec-slate-600); font-size: .67rem; }
.activity-list { display: grid; gap: 1rem; }
.activity-item { display: grid; grid-template-columns: 35px 1fr; gap: .75rem; align-items: start; }
.activity-item .dot { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 11px; background: var(--alec-sky-50); color: var(--alec-sky-700); font-weight: 900; }
.activity-item strong { display: block; font-size: .86rem; }
.activity-item small { color: var(--alec-slate-600); }

.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; }
.editor-section { border: 1px solid var(--alec-slate-200); border-radius: var(--alec-radius-lg); background: white; margin-bottom: 1rem; }
.editor-section h2 { padding: 1rem 1.25rem; border-bottom: 1px solid var(--alec-slate-200); font-size: 1rem; margin: 0; }
.editor-fields { display: grid; gap: 1rem; padding: 1.25rem; }
.editor-fields.two { grid-template-columns: 1fr 1fr; }
.upload-box { display: grid; place-items: center; min-height: 160px; border: 1.5px dashed var(--alec-slate-300); border-radius: var(--alec-radius-md); background: var(--alec-slate-50); color: var(--alec-slate-600); text-align: center; padding: 1.25rem; }
/* top: 1.5rem, not the prototype's 216px (132px portal chrome + admin
   titlebar height) — see the .public-header comment above for why. */
.publish-card { position: sticky; top: 1.5rem; border: 1px solid var(--alec-slate-200); border-radius: var(--alec-radius-lg); background: white; padding: 1.25rem; }
.publish-card .btn { width: 100%; margin-top: .6rem; }
.publish-row { display: flex; justify-content: space-between; gap: 1rem; padding: .65rem 0; border-bottom: 1px solid var(--alec-slate-200); font-size: .82rem; }
.publish-row span { color: var(--alec-slate-600); }

.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.admin-toolbar .admin-search { width: min(420px, 50vw); }
.row-title { font-weight: 800; }
.row-subtitle { display: block; color: var(--alec-slate-600); font-size: .76rem; margin-top: .18rem; }
.row-actions { display: inline-flex; gap: .35rem; }
.icon-button { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--alec-slate-200); border-radius: 9px; background: white; color: var(--alec-slate-700); cursor: pointer; }

.detail-header { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--alec-slate-200); }
.detail-stack { display: grid; gap: 1rem; }
.message-card { border-left: 3px solid var(--alec-sky-400); border-radius: 0 var(--alec-radius-md) var(--alec-radius-md) 0; background: var(--alec-slate-50); padding: 1.2rem; }
.timeline { display: grid; gap: 1rem; }
.timeline-item { position: relative; padding-left: 1.8rem; }
.timeline-item::before { position: absolute; left: 0; top: .28rem; width: 10px; height: 10px; border: 3px solid var(--alec-sky-200); border-radius: 50%; background: var(--alec-sky-600); content: ""; }
.timeline-item:not(:last-child)::after { position: absolute; left: 4px; top: 1rem; bottom: -1.25rem; width: 2px; background: var(--alec-slate-200); content: ""; }
.timeline-item strong { display: block; font-size: .86rem; }
.timeline-item small { color: var(--alec-slate-600); }

.media-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.media-card { overflow: hidden; border: 1px solid var(--alec-slate-200); border-radius: var(--alec-radius-md); background: white; }
.media-thumb { position: relative; overflow: hidden; aspect-ratio: 4/3; background: linear-gradient(145deg, var(--alec-sky-100), var(--alec-slate-100)); color: var(--alec-sky-700); font-size: 2rem; }
.media-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-card:nth-child(3n) .media-thumb { background: linear-gradient(145deg, var(--alec-gold-100), var(--alec-slate-50)); color: var(--alec-gold-700); }
.media-meta { padding: .75rem; }
.media-meta strong { display: block; font-size: .78rem; }
.media-meta small { color: var(--alec-slate-600); }

/* min-height: 100vh, not the prototype's 132px-offset value — see the
   .public-header comment above for why. */
.auth-screen { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; background: var(--alec-navy-950); color: white; padding: clamp(2rem, 6vw, 5rem); }
.auth-brand::after { position: absolute; width: 520px; height: 520px; right: -250px; bottom: -280px; border: 1px solid rgba(86,194,243,.24); border-radius: 50%; content: ""; }
.auth-quote { position: relative; z-index: 1; max-width: 500px; }
.auth-quote h1 { font-size: var(--alec-text-3xl); }
.auth-quote p { color: rgba(255,255,255,.65); }
.auth-form-side { display: grid; place-items: center; padding: 2rem; }
.auth-card { width: min(100%, 430px); }
.auth-card h2 { font-size: 2rem; }
.auth-card > p { color: var(--alec-slate-600); }
.auth-card form { display: grid; gap: 1rem; margin-top: 2rem; }
.auth-card .btn { width: 100%; }
.auth-links { display: flex; justify-content: space-between; color: var(--alec-sky-700); font-size: .82rem; font-weight: 800; }

/* Flows */
.flows-hero { padding: 5rem 0 3rem; background: var(--alec-navy-950); color: white; }
.flows-hero h1 { font-size: var(--alec-text-3xl); }
.flows-hero p { max-width: 760px; color: rgba(255,255,255,.65); font-size: var(--alec-text-lg); }
.flow-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 3rem 0 6rem; }
.flow-card { overflow: hidden; }
.flow-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.5rem; border-bottom: 1px solid var(--alec-slate-200); }
.flow-card-head h2 { font-size: 1.15rem; margin-bottom: .35rem; }
.flow-card-head p { color: var(--alec-slate-600); font-size: .82rem; margin-bottom: 0; }
.flow-number { color: var(--alec-sky-700); font: 800 .75rem var(--alec-font-mono); }
.flow-body { padding: 1.5rem; }
.flow-track { display: flex; align-items: stretch; gap: .45rem; overflow-x: auto; padding-bottom: .4rem; }
.flow-node { display: grid; place-items: center; flex: 1 0 115px; min-height: 74px; border: 1px solid var(--alec-slate-200); border-radius: 12px; background: var(--alec-slate-50); color: var(--alec-navy-800); font-size: .75rem; font-weight: 800; padding: .7rem; text-align: center; }
.flow-node.start { border-color: var(--alec-sky-200); background: var(--alec-sky-50); color: var(--alec-sky-800); }
.flow-node.end { border-color: var(--alec-gold-200); background: var(--alec-gold-50); color: var(--alec-gold-700); }
.flow-arrow { display: grid; place-items: center; color: var(--alec-slate-400); font-weight: 900; }
.flow-notes { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.flow-notes span { border-radius: var(--alec-radius-pill); background: var(--alec-slate-100); color: var(--alec-slate-600); font-size: .68rem; font-weight: 800; padding: .3rem .55rem; }

.toast-viewport { position: fixed; right: 1.2rem; top: 1.2rem; z-index: 300; display: flex; flex-direction: column-reverse; gap: .6rem; max-width: 360px; width: calc(100% - 2.4rem); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: .75rem; border: 1px solid var(--alec-slate-200); border-radius: var(--alec-radius-md); background: white; box-shadow: var(--alec-shadow-lg); padding: .9rem 1rem; animation: toast-in .3s var(--alec-ease) both; }
.toast.toast-exit { animation: toast-out .18s var(--alec-ease) both; }
.toast-mark { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--alec-success-bg); color: var(--alec-success); font-weight: 900; }
.toast-success .toast-mark { background: var(--alec-success-bg); color: var(--alec-success); }
.toast-error .toast-mark { background: var(--alec-danger-bg); color: var(--alec-danger); }
.toast-warning .toast-mark { background: var(--alec-warning-bg); color: var(--alec-warning); }
.toast-info .toast-mark { background: var(--alec-info-bg); color: var(--alec-info); }
.toast-body { flex: 1; font-size: var(--alec-text-sm); }
.toast-body strong { display: block; margin-bottom: .1rem; }
.toast-close { flex-shrink: 0; border: 0; background: none; cursor: pointer; color: var(--alec-slate-400); font-size: 1rem; line-height: 1; padding: .1rem .2rem; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 1050px) {
  .portal-status { display: none; }
  .public-hero-grid,
  .story-grid,
  .detail-grid,
  .contact-grid { grid-template-columns: 1fr; }
  .impact-orbit { min-height: 410px; }
  .impact-orbit::before { width: 380px; height: 380px; }
  .impact-orbit::after { width: 290px; height: 290px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .media-grid { grid-template-columns: repeat(3, 1fr); }
  .value-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .portal-header { padding-inline: 1rem; }
  .mobile-nav-button { display: inline-grid; place-items: center; }
  .portal-nav { position: fixed; left: 1rem; right: 1rem; top: 68px; display: none; flex-direction: column; align-items: stretch; border: 1px solid rgba(255,255,255,.12); border-radius: var(--alec-radius-lg); background: var(--alec-navy-950); box-shadow: var(--alec-shadow-lg); padding: .7rem; }
  .portal-nav.open { display: flex; }
  .portal-nav a { text-align: center; }
  .ds-hero-grid,
  .section-heading { grid-template-columns: 1fr; }
  .principle-grid,
  .token-grid,
  .inventory-grid,
  .service-grid,
  .product-grid,
  .career-grid { grid-template-columns: repeat(2, 1fr); }
  .swatches { grid-template-columns: repeat(3, 1fr); }
  .state-grid { grid-template-columns: repeat(2, 1fr); }
  .public-nav { min-height: 72px; }
  .public-nav-links { display: none; position: absolute; left: 20px; right: 20px; top: 70px; flex-direction: column; align-items: stretch; border: 1px solid var(--alec-slate-200); border-radius: var(--alec-radius-lg); background: white; box-shadow: var(--alec-shadow-lg); padding: .75rem; }
  .public-nav-links.open { display: flex; }
  .public-nav-links button,
  .public-nav-links a { text-align: left; }
  .public-nav-links a.btn,
  .public-nav-links a.btn:hover { transform: none; box-shadow: none; background: transparent; color: var(--alec-slate-700); border-color: transparent; border-radius: var(--alec-radius-pill); font-size: var(--alec-text-sm); padding: 0.6rem 0.8rem; margin-top: 0.25rem; border-top: 1px solid var(--alec-slate-200); border-top-left-radius: 0; border-top-right-radius: 0; }
  .public-nav-links a.btn:hover { background: var(--alec-sky-50); color: var(--alec-sky-800); }
  .public-menu-button { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--alec-slate-200); border-radius: 12px; background: white; color: var(--alec-navy-950); }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--alec-slate-200); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .editor-layout,
  .admin-grid { grid-template-columns: 1fr; }
  .publish-card { position: static; }
  .flow-grid { grid-template-columns: 1fr; }
  .auth-screen { grid-template-columns: 1fr; }
  .auth-brand { min-height: 310px; }
}

@media (max-width: 600px) {
  .portal-brand small { display: none; }
  .ds-container,
  .public-container { width: min(calc(100% - 28px), var(--alec-container)); }
  .preview-toolbar { top: 76px; padding-inline: 14px; }
  .preview-toolbar > strong { display: none; }
  .principle-grid,
  .inventory-grid,
  .component-grid,
  .state-grid,
  .service-grid,
  .product-grid,
  .career-grid,
  .value-grid { grid-template-columns: 1fr; }
  .component-panel.wide { grid-column: auto; }
  .swatches { grid-template-columns: repeat(2, 1fr); }
  .type-specimen { grid-template-columns: 1fr; gap: .6rem; }
  .public-topline .public-container span:last-child { display: none; }
  .public-nav .brand-lockup strong { max-width: 185px; font-size: .82rem; }
  .public-nav .brand-lockup small { display: none; }
  .public-hero { padding-top: 3.5rem; }
  .impact-orbit { min-height: 350px; transform: scale(.86); margin-inline: -1.2rem; }
  .orbit-chip.one { left: -1.3rem; }
  .orbit-chip.two { right: -1.5rem; }
  .metric-strip { transform: translateY(-20px); }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
  .admin-user > div:not(.avatar) { display: none; }
  .admin-content { padding: 1rem; }
  .admin-titlebar { align-items: flex-start; flex-direction: column; }
  .stat-grid { grid-template-columns: 1fr; }
  .editor-fields.two { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-brand { min-height: 250px; }
  .auth-form-side { padding: 2rem 1.25rem; }
}

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

/* Locations directory (public): photo masthead, filters, responsive table */
.page-masthead.has-photo { padding: clamp(2.5rem, 5vw, 4rem) 0; background-color: var(--alec-navy-950); background-size: cover; background-position: center; isolation: isolate; }
.page-masthead.has-photo::before { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(7, 30, 51, 0.92) 0%, rgba(7, 30, 51, 0.72) 55%, rgba(7, 30, 51, 0.5) 100%); content: ""; }
.page-masthead.has-photo::after { display: none; }
.page-masthead.has-photo p { color: rgba(255, 255, 255, 0.88); }
.masthead-office { display: grid; gap: 0.35rem; justify-items: start; max-width: 560px; margin-top: 2rem; padding: 1.25rem 1.4rem; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: var(--alec-radius-lg); background: rgba(7, 30, 51, 0.55); backdrop-filter: blur(10px); }
.masthead-office .eyebrow { color: var(--alec-sky-300); }
.masthead-office strong { font-family: var(--alec-font-display); font-size: 1.4rem; line-height: 1.2; }
.masthead-office-address { color: rgba(255, 255, 255, 0.88); white-space: pre-line; }
.masthead-office .hero-actions { margin-top: 0.9rem; }
.loc-filters { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 1rem; align-items: end; margin-bottom: 1rem; }
.loc-filter-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.loc-count { color: var(--alec-slate-600); font-size: var(--alec-text-sm); margin: 0 0 0.75rem; }
.loc-table th, .loc-table td { white-space: normal; vertical-align: top; }
.loc-table td.loc-address { min-width: 14rem; white-space: pre-line; }
.loc-name { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
@media (max-width: 820px) {
  .loc-filters { grid-template-columns: 1fr 1fr; }
  .loc-filters .field:first-child { grid-column: 1 / -1; }
  .loc-filter-actions { grid-column: 1 / -1; }
  .loc-table-wrap { border: 0; overflow: visible; }
  .loc-table, .loc-table tbody, .loc-table tr, .loc-table td { display: block; width: 100%; }
  .loc-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .loc-table tr { border: 1px solid var(--alec-slate-200); border-radius: var(--alec-radius-lg); background: white; padding: 0.4rem 1rem; margin-bottom: 1rem; }
  .loc-table td { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.75rem; padding: 0.55rem 0; border-bottom: 1px solid var(--alec-slate-100, var(--alec-slate-200)); overflow-wrap: anywhere; }
  .loc-table td:last-child { border-bottom: 0; }
  .loc-table td::before { content: attr(data-label); color: var(--alec-slate-600); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding-top: 0.2rem; }
  .loc-table td[data-label="Directions"]::before { content: ""; }
}

/* Leadership profiles */
.leader-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem; }
.leader-card { text-align: center; border: 1px solid var(--alec-slate-200); border-radius: var(--alec-radius-lg); background: white; padding: 1.5rem 1.25rem; }
.leader-photo { display: block; width: 132px; height: 132px; margin: 0 auto 1rem; border-radius: 50%; object-fit: cover; border: 3px solid var(--alec-sky-50); }
.leader-initials { display: grid; place-items: center; background: var(--alec-navy-950); color: white; font-size: 2rem; font-weight: 800; letter-spacing: 0.04em; }
.leader-card h3 { margin: 0 0 0.25rem; }
.leader-role { color: var(--alec-sky-800); font-weight: 800; margin: 0 0 0.5rem; }
.leader-bio { color: var(--alec-slate-600); font-size: var(--alec-text-sm); margin: 0; }

/* Homepage hero slideshow: photos fade behind the headline under a dark overlay */
.public-hero.has-slides { background: var(--alec-navy-950); isolation: isolate; }
.public-hero.has-slides::before { display: none; }
.public-hero.has-slides .public-hero-grid { position: relative; z-index: 2; }
.public-hero.has-slides { padding-top: clamp(3rem, 6vw, 5rem); }
.hero-slides { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.hero-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s ease; }
.hero-slide.active { opacity: 1; }
.hero-slides-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7, 30, 51, 0.9) 0%, rgba(7, 30, 51, 0.68) 52%, rgba(7, 30, 51, 0.4) 100%); }
.public-hero.has-slides h1 { color: white; }
.public-hero.has-slides p { color: rgba(255, 255, 255, 0.9); }
.public-hero.has-slides .eyebrow { color: var(--alec-sky-300); }
.public-hero.has-slides .trust-row { color: rgba(255, 255, 255, 0.85); }
.public-hero.has-slides .trust-row span::before { color: var(--alec-gold-400); }
.public-hero.has-slides .btn-primary { background: var(--alec-gold-400); color: var(--alec-navy-950); }
.public-hero.has-slides .btn-primary:hover { background: var(--alec-gold-300, var(--alec-gold-400)); }
.hero-slide-controls { position: absolute; z-index: 3; left: 0; right: 0; bottom: 4rem; display: flex; justify-content: center; align-items: center; gap: 0.6rem; }
.hero-slide-dot { width: 12px; height: 12px; padding: 0; border: 2px solid rgba(255, 255, 255, 0.85); border-radius: 50%; background: transparent; cursor: pointer; }
.hero-slide-dot.active { background: white; }
.hero-slide-toggle { width: 28px; height: 28px; padding: 0; border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 50%; background: rgba(7, 30, 51, 0.5); color: white; font-size: 0.6rem; cursor: pointer; }
.hero-slide-dot:focus-visible, .hero-slide-toggle:focus-visible { outline: 3px solid var(--alec-gold-400); outline-offset: 2px; }
@media (max-width: 820px) {
  .hero-slides-overlay { background: linear-gradient(180deg, rgba(7, 30, 51, 0.82), rgba(7, 30, 51, 0.74)); }
}

/* Slideshow hero, tightened so the whole hero reads in one screen: smaller headline,
   and the Access/Opportunity/Impact chips become a compact glass stack in the corner
   instead of a large orbit that covers the photo. */
.public-hero.has-slides { padding: clamp(1.75rem, 3.2vw, 2.75rem) 0 clamp(4.75rem, 6.5vw, 5.75rem); }
.public-hero.has-slides .public-hero-grid { grid-template-columns: minmax(0, 1fr) auto; gap: clamp(1.5rem, 4vw, 3rem); align-items: end; }
.public-hero.has-slides h1 { max-width: 860px; font-size: clamp(2rem, 1.2rem + 2.6vw, 3.4rem); line-height: 1.08; margin-bottom: 0.9rem; }
.public-hero.has-slides p { max-width: 640px; font-size: clamp(1rem, 0.9rem + 0.35vw, 1.15rem); }
.public-hero.has-slides .hero-actions { margin-top: 1.4rem; }
.public-hero.has-slides .trust-row { margin-top: 1.4rem; }
.public-hero.has-slides .impact-orbit { min-height: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 0.55rem; }
.public-hero.has-slides .impact-orbit::before,
.public-hero.has-slides .impact-orbit::after,
.public-hero.has-slides .impact-core { display: none; }
.public-hero.has-slides .orbit-chip { position: static; max-width: 230px; width: 100%; padding: 0.55rem 0.85rem; border-color: rgba(255, 255, 255, 0.28); background: rgba(7, 30, 51, 0.55); color: white; box-shadow: none; }
.public-hero.has-slides .orbit-chip strong { font-size: 0.95rem; color: white; }
.public-hero.has-slides .orbit-chip small { color: rgba(255, 255, 255, 0.82); font-size: 0.8rem; line-height: 1.3; }
@media (max-width: 820px) {
  .public-hero.has-slides .public-hero-grid { grid-template-columns: 1fr; align-items: start; }
  /* The chips are decorative taglines; on phones they only add height and hide the photo. */
  .public-hero.has-slides .impact-orbit { display: none; }
  .public-hero.has-slides { padding-bottom: 5.5rem; }
  .public-hero.has-slides .hero-slides-overlay { background: linear-gradient(180deg, rgba(7, 30, 51, 0.8) 0%, rgba(7, 30, 51, 0.62) 100%); }
  .public-hero.has-slides .trust-row { margin-top: 1rem; gap: 0.4rem 1rem; }
}

/* Homepage on phones: less copy, so each screen says one thing. Full text stays on tablet/desktop. */
@media (max-width: 700px) {
  .public-hero.has-slides p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .public-hero.has-slides .trust-row { display: none; }
  .public-hero.has-slides .hero-actions { flex-wrap: nowrap; gap: 0.5rem; }
  .public-hero.has-slides .hero-actions .btn { flex: 1 1 0; justify-content: center; padding: 0.65rem 0.4rem; font-size: 0.84rem; text-align: center; white-space: nowrap; }
  .public-hero.has-slides { padding-bottom: 4.75rem; }
  .hero-slide-controls { bottom: 2.2rem; }
  .metric { padding: 1rem; }
  .metric span { display: none; }
  .metric strong { font-size: 1.2rem; }
  .service-card p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .home-purpose-copy, .home-cta-copy { display: none; }
}

/* Promotional pop-up (native <dialog>: focus trap, Esc to close, backdrop) */
.promo-dialog { width: min(92vw, 520px); max-height: 92vh; padding: 0; border: 0; border-radius: var(--alec-radius-xl); background: white; color: var(--alec-navy-950); box-shadow: var(--alec-shadow-lg); overflow: hidden; }
.promo-dialog::backdrop { background: rgba(7, 30, 51, 0.62); }
.promo-dialog[open] { animation: promo-in 0.28s ease both; }
@keyframes promo-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.promo-card { position: relative; display: flex; flex-direction: column; max-height: 92vh; overflow-y: auto; background: white; }
.promo-close { position: absolute; top: 0.6rem; right: 0.6rem; z-index: 2; width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(7, 30, 51, 0.72); color: white; font-size: 1rem; cursor: pointer; }
.promo-close:hover { background: var(--alec-navy-950); }
.promo-close:focus-visible, .promo-dialog .btn:focus-visible { outline: 3px solid var(--alec-gold-400); outline-offset: 2px; }
.promo-image { display: block; width: 100%; max-height: 60vh; object-fit: contain; background: var(--alec-slate-50); }
.promo-body { padding: 1.4rem 1.6rem 1.6rem; }
.promo-title { margin: 0 0 0.5rem; font-size: 1.5rem; line-height: 1.2; }
.promo-message { margin: 0; color: var(--alec-slate-700); }
.promo-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.1rem; }
.promo-preview { border: 1px solid var(--alec-slate-200); border-radius: var(--alec-radius-lg); overflow: hidden; }
.promo-preview .promo-card { max-height: none; }
@media (prefers-reduced-motion: reduce) { .promo-dialog[open] { animation: none; } }


/* Admin on phones and small tablets: slide-out menu, stacked tables, comfortable touch targets */
.admin-menu-button, .admin-drawer-close { display: none; }
.admin-backdrop { display: none; }
@media (max-width: 820px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 60; width: min(300px, 86vw); height: 100dvh; transform: translateX(-100%); visibility: hidden; transition: transform 0.25s ease, visibility 0s linear 0.25s; box-shadow: none; }
  .admin-sidebar.open { transform: none; visibility: visible; transition: transform 0.25s ease, visibility 0s; box-shadow: 8px 0 40px rgba(7, 30, 51, 0.4); }
  .admin-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(7, 30, 51, 0.55); opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
  .admin-backdrop.open { opacity: 1; pointer-events: auto; }
  .admin-menu-button { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; margin-right: 0.75rem; border: 1px solid var(--alec-slate-200); border-radius: 12px; background: white; color: var(--alec-navy-950); font-size: 1.15rem; cursor: pointer; }
  .admin-drawer-close { display: inline-grid; place-items: center; position: absolute; top: 0.75rem; right: 0.75rem; width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 12px; background: transparent; color: white; font-size: 1.05rem; cursor: pointer; }
  .admin-sidebar .brand-lockup { margin-right: 3.5rem; }
  .admin-nav button, .admin-nav a { min-height: 44px; font-size: 0.9rem; }
  .admin-topbar { padding-inline: 1rem; gap: 0.5rem; }
  .admin-topbar > .admin-search { display: none; }
  .admin-user { margin-left: auto; }
  .admin-content { padding: 1rem; }
  .admin-titlebar { align-items: flex-start; flex-direction: column; margin-bottom: 1.25rem; }
  .admin-titlebar > .btn { width: 100%; justify-content: center; }
  .admin-toolbar { flex-direction: column; align-items: stretch; }
  .admin-toolbar .admin-search { width: 100%; }
  .filter-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.25rem; -webkit-overflow-scrolling: touch; }
  .filter-chip { flex: none; }
  .icon-button { width: 44px; height: 44px; }
  .admin-content .btn { min-height: 44px; }
  .admin-content input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .admin-content select, .admin-content textarea { font-size: 16px; min-height: 44px; }
  .editor-fields.two { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .admin-content .table-wrap { overflow: visible; border: 0; }
  .admin-content .data-table, .admin-content .data-table tbody, .admin-content .data-table tr, .admin-content .data-table td { display: block; width: 100%; }
  .admin-content .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .admin-content .data-table tr { margin-bottom: 0.9rem; padding: 0.35rem 1rem; border: 1px solid var(--alec-slate-200); border-radius: var(--alec-radius-lg); background: white; }
  .admin-content .data-table td { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.75rem; align-items: start; padding: 0.7rem 0; border-bottom: 1px solid var(--alec-slate-100, var(--alec-slate-200)); white-space: normal; overflow-wrap: anywhere; }
  .admin-content .data-table td:last-child { border-bottom: 0; }
  .admin-content .data-table td::before { content: attr(data-label); color: var(--alec-slate-600); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding-top: 0.2rem; }
  .admin-content .data-table td[data-label=""]::before { content: ""; }
  .row-actions { flex-wrap: wrap; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .admin-sidebar, .admin-backdrop { transition: none; }
}

/* In-dashboard Help & guide */
.help-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 2rem; align-items: start; }
.help-toc { position: sticky; top: 1.5rem; display: grid; gap: 0.1rem; max-height: calc(100vh - 3rem); overflow-y: auto; }
.help-toc a { padding: 0.45rem 0.75rem; border-left: 2px solid var(--alec-slate-200); color: var(--alec-slate-600); font-size: 0.86rem; font-weight: 700; text-decoration: none; }
.help-toc a:hover { border-left-color: var(--alec-sky-400); color: var(--alec-navy-950); }
.help-body { display: grid; gap: 1.25rem; min-width: 0; }
.help-section { scroll-margin-top: 1.5rem; border: 1px solid var(--alec-slate-200); border-radius: var(--alec-radius-lg); background: white; padding: 1.5rem; }
.help-section-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.help-section-head h2 { margin: 0; font-size: 1.25rem; }
.help-section p { max-width: 70ch; }
.help-steps { margin: 0 0 1rem; padding: 0; list-style: none; counter-reset: help; display: grid; gap: 0.65rem; max-width: 70ch; }
.help-steps li { counter-increment: help; position: relative; padding-left: 2.4rem; }
.help-steps li::before { content: counter(help); position: absolute; left: 0; top: 0.1em; display: grid; place-items: center; width: 1.65rem; height: 1.65rem; border-radius: 50%; background: var(--alec-sky-100); color: var(--alec-sky-800); font-size: 0.82rem; font-weight: 800; }
.help-list { display: grid; gap: 0.5rem; margin: 0 0 1rem; padding-left: 1.2rem; max-width: 70ch; }
.help-tip { max-width: 70ch; margin: 0 0 1rem; padding: 0.75rem 1rem; border-radius: var(--alec-radius-md); background: var(--alec-sky-50); }
.help-code { padding: 0.1em 0.4em; border-radius: 4px; background: var(--alec-sky-50); color: var(--alec-navy-950); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.88em; overflow-wrap: anywhere; }
.help-table { margin-bottom: 1rem; }
.help-table td, .help-table th { white-space: normal; vertical-align: top; }
.help-table td:first-child { font-weight: 700; }
.help-summary { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.help-summary li { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.55rem 1rem; border: 1px solid var(--alec-slate-200); border-radius: var(--alec-radius-md); background: var(--alec-slate-50); }
.help-summary b { font: 800 1.4rem var(--alec-font-display); }
.help-summary span { color: var(--alec-slate-600); font-size: 0.88rem; }
.help-progress { margin: 0 0 0.9rem; color: var(--alec-slate-600); }
.help-checklist td:nth-child(1), .help-checklist th:nth-child(1) { width: 3rem; color: var(--alec-slate-600); }
.help-checklist td:nth-child(1) { font-weight: 800; }
.help-checklist td:nth-child(2) strong { display: block; }
.help-how { display: block; margin-top: 0.25rem; color: var(--alec-slate-600); font-size: 0.88rem; max-width: 60ch; }
.help-group-row th { background: var(--alec-slate-50); color: var(--alec-sky-800); font-size: 0.74rem; letter-spacing: 0.1em; padding: 0.5rem 1rem; }
.help-chip { display: inline-block; padding: 0.2rem 0.65rem; border-radius: 999px; font-size: 0.78rem; font-weight: 800; white-space: nowrap; }
.help-chip-ready, .help-chip-done { background: var(--alec-success-bg, #e1f4ec); color: var(--alec-success, #17785a); }
.help-chip-input { background: #fdf0d2; color: #8a5a00; }
.help-chip-confirm { background: #e8ebfa; color: #3a4f9e; }
.help-chip-pending { background: var(--alec-slate-100, #eceff3); color: var(--alec-slate-600); }
.help-tick { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 32px; font-size: 0.86rem; cursor: pointer; }
.help-tick input { width: 1.15rem; height: 1.15rem; }
tr.is-accepted { background: #f1faf6; }
@media (max-width: 960px) {
  .help-layout { grid-template-columns: minmax(0, 1fr); }
  .help-toc { position: static; display: flex; flex-wrap: nowrap; gap: 0.4rem; max-height: none; overflow-x: auto; padding-bottom: 0.35rem; }
  .help-toc a { flex: none; border: 1px solid var(--alec-slate-200); border-radius: 999px; padding: 0.4rem 0.85rem; white-space: nowrap; }
}
@media (max-width: 700px) {
  .help-section { padding: 1.1rem; }
  .help-group-row, .help-group-row th { display: block; }
  .help-group-row th { background: transparent; padding: 0.75rem 0 0.25rem; }
  .help-checklist tr.is-accepted { background: #f1faf6; }
}
