/* Church Security — Components
   Every style reads from tokens.css (load that first). Theme: class "dark" on <html>. */

/* ---------- Base ---------- */

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

html { background-color: var(--page-bg); }

body {
  background: transparent;
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: var(--text-body);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* Ambient light the glass refracts */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38% 32% at 8% 12%, var(--ambient-ice) 0%, transparent 72%),
    radial-gradient(30% 28% at 92% 22%, var(--ambient-copper) 0%, transparent 72%),
    radial-gradient(42% 36% at 78% 88%, var(--ambient-ice-2) 0%, transparent 72%),
    radial-gradient(28% 26% at 16% 80%, var(--ambient-copper) 0%, transparent 74%);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

.font-display { font-family: var(--font-display); }

.hidden { display: none !important; }

button:focus-visible,
input:focus-visible,
a:focus-visible,
select:focus-visible,
textarea:focus-visible,
.demo-focus {
  outline: 3px solid var(--copper);
  outline-offset: 2px;
}

.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;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.skip {
  position: absolute;
  left: var(--space-4);
  top: -80px;
  z-index: 200;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  background: var(--selected-bg);
  color: var(--selected-ink);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus { top: 12px; }

/* ---------- Brand marks ---------- */

.brand-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 8px;
  border-radius: 12px;
  background: linear-gradient(180deg, #2A3641 0%, #161D23 100%);
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.35),
    0 2px 6px rgba(0, 0, 0, 0.16);
  color: #FFFFFF;
}

.white-icon-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 7px;
  border-radius: 10px;
  background: #FFFFFF;
  box-shadow: var(--glass-pill-shadow);
  color: var(--slate);
}

.brand-avatar svg,
.white-icon-tile svg {
  width: 100%;
  height: 100%;
}

/* ---------- Floating glass header ---------- */

.kit-header {
  position: sticky;
  top: 12px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: calc(100% - 32px);
  max-width: 1200px;
  margin: 12px auto 0;
  padding: 8px 8px 8px 10px;
  border-radius: var(--radius-pill);
  background: var(--glass-pill);
  -webkit-backdrop-filter: blur(36px) saturate(200%);
  backdrop-filter: blur(36px) saturate(200%);
  box-shadow: var(--glass-vessel-shadow);
}

.kit-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border-radius: var(--radius-pill);
  color: var(--text-main);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.kit-brand > span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kit-header .brand-avatar {
  width: 36px;
  height: 36px;
  padding: 7px;
  border-radius: 10px;
}

.kit-brand .sub {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-muted);
}

.header-tools {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* ---------- Layout ---------- */

.kit-layout {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  max-width: 1232px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) 56px;
}

.kit-nav {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
  padding: 12px 10px;
  border-radius: 22px;
  background: var(--glass-sidebar);
  -webkit-backdrop-filter: blur(44px) saturate(185%);
  backdrop-filter: blur(44px) saturate(185%);
  box-shadow: var(--glass-vessel-shadow);
}

.nav-section-label {
  padding: 4px 12px 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.kit-nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-field);
  color: var(--text-main);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 140ms var(--ease), color 140ms var(--ease);
}

@media (hover: hover) {
  .kit-nav a:hover { background-color: var(--neutral-tint); }
}

.kit-nav a[aria-current="true"] {
  background-color: var(--selected-bg);
  color: var(--selected-ink);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(28, 36, 43, 0.18);
}

.kit-nav .back-link {
  position: relative;
  margin-top: 9px;
  color: var(--text-muted);
}

.kit-nav .back-link::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 12px;
  right: 12px;
  height: 1px;
  background: var(--divider);
}

#library {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.kit-intro { padding: 20px 4px 8px; }

.kicker {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.kit-intro h1 {
  margin: 0 0 var(--space-4);
  font-size: clamp(36px, 5.4vw, 60px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.review-tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--glass-pill);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  backdrop-filter: blur(28px) saturate(190%);
  box-shadow: var(--glass-pill-shadow);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

/* ---------- Glass section vessels ---------- */

.kit-section {
  position: relative;
  scroll-margin-top: 92px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5);
  border-radius: var(--radius-vessel);
  background: var(--glass-vessel);
  -webkit-backdrop-filter: blur(36px) saturate(200%);
  backdrop-filter: blur(36px) saturate(200%);
  box-shadow: var(--glass-vessel-shadow);
}

/* backdrop-filter makes each section its own layer; lift the one with the menu */
#overlays { z-index: 3; }

.section-heading {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.section-heading span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--copper-tint);
  color: var(--copper-ink);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sample-label {
  display: block;
  color: var(--text-muted);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.spec-note {
  color: var(--text-muted);
  font-size: var(--text-caption);
  font-variant-numeric: tabular-nums;
}

.specimen {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 18px;
  border-radius: var(--radius-group);
  background: var(--surface);
  box-shadow: var(--surface-edge);
}

.specimen > .sample-label:not(:first-child) { margin-top: var(--space-2); }

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.demo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* ---------- 01 Foundations ---------- */

.identity-stage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: 28px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--surface-edge);
}

.identity-lockup {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
  color: var(--mark-ink);
}

.identity-lockup svg {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.identity-lockup span {
  color: var(--text-main);
  font-size: clamp(20px, calc(3.4vw + 10px), 34px);
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.identity-variants {
  display: flex;
  gap: 10px;
}

.identity-variants .white-icon-tile,
.identity-variants .brand-avatar {
  width: 56px;
  height: 56px;
  padding: 10px;
  border-radius: 14px;
}

.palette {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.swatch {
  appearance: none;
  min-width: 0;
  padding: 6px 6px 10px;
  border: none;
  border-radius: var(--radius-tile);
  background: var(--surface);
  box-shadow: var(--surface-edge);
  color: var(--text-main);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform var(--dur-press) var(--ease);
}

.swatch:active { transform: scale(0.98); }

.swatch-color {
  display: block;
  height: 56px;
  margin-bottom: var(--space-2);
  border-radius: 11px;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.12);
}

:root.dark .swatch-color { box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.16); }

.swatch-name,
.swatch-hex {
  display: block;
  padding: 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.swatch-name { font-size: 13px; font-weight: 700; }

.swatch-hex {
  color: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.type-spec > div {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  padding: 20px;
  border-radius: var(--radius-group);
  background: var(--surface);
  box-shadow: var(--surface-edge);
}

.display-sample {
  margin: 0;
  font-size: var(--text-display);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.body-sample {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 400;
}

.token-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.token-row span {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--surface-edge);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.token-row b {
  color: var(--text-main);
  font-weight: 600;
}

/* ---------- 02 Logo ---------- */

.mark { color: var(--mark-ink); }

.lockup {
  --h: 48px;
  display: inline-flex;
  align-items: center;
  gap: calc(var(--h) / 4);
  color: var(--mark-ink);
}

.lockup .mark {
  width: var(--h);
  height: var(--h);
  flex-shrink: 0;
}

.lockup span {
  color: var(--text-main);
  font-family: var(--font-display);
  font-size: calc(var(--h) * 0.6);
  font-weight: 800;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.clearspace {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) 0;
}

.clearspace-box {
  padding: calc(48px / 2);
  border: 1.5px dashed var(--copper-ink);
  border-radius: 6px;
  background: var(--copper-tint);
}

.clearspace-core {
  display: flex;
  background: var(--surface);
}

.min-sizes {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-6);
  padding: var(--space-3) 0;
}

.min-sizes figure,
.logo-tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}

.min-sizes .mark {
  width: 20px;
  height: 20px;
}

.min-sizes .lockup { --h: 22px; }

.min-sizes figcaption,
.logo-tile figcaption {
  font-size: 13px;
  font-weight: 600;
}

.min-sizes figcaption { color: var(--text-muted); }

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

.plate {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 96px;
  overflow: hidden;
  border-radius: var(--radius-tile);
  background: #FFFFFF;
  box-shadow: inset 0 0 0 0.5px rgba(28, 36, 43, 0.10);
  color: var(--slate);
}

:root.dark .plate { box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.12); }

.plate .mark {
  width: 40px;
  height: 40px;
  color: inherit;
}

.plate.on-tint { background: var(--glass-tint); }
.plate.on-slate { background: var(--slate); color: #FFFFFF; }
.plate.on-alert { background: var(--alert); color: #FFFFFF; }

.logo-tile .do { color: var(--clear-ink); }
.logo-tile .dont { color: var(--alert-ink); }

.dont-stretch .mark { transform: scaleX(1.55); }
.dont-recolor .mark { color: var(--copper); }
.dont-rotate .mark { transform: rotate(-20deg); }
.dont-effects .mark { filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 10px rgba(200, 100, 50, 0.9)); }
.plate.dont-contrast { background: var(--copper); color: #D9895F; }

.dont-retype {
  gap: 5px;
  padding: 0 8px;
}

.dont-retype .mark {
  width: 22px;
  height: 22px;
}

.dont-retype span {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 13px;
  font-style: italic;
  white-space: nowrap;
}

/* ---------- 03 Buttons ---------- */

.liquid-btn,
.liquid-btn-primary,
.ghost,
.danger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--touch);
  padding: 0 18px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform var(--dur-press) var(--ease),
    filter 160ms var(--ease),
    background-color 160ms var(--ease),
    box-shadow 160ms var(--ease);
}

.liquid-btn {
  background: var(--glass-pill);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  backdrop-filter: blur(28px) saturate(190%);
  box-shadow: var(--glass-pill-shadow);
  color: var(--text-main);
}

.liquid-btn-primary {
  background: var(--primary-fill);
  box-shadow: var(--primary-shadow);
  color: #FFFFFF;
}

/* Hover only where there's a pointer, so it never sticks on phones */
@media (hover: hover) {
  .liquid-btn:hover { box-shadow: var(--glass-pill-shadow), 0 6px 16px rgba(28, 36, 43, 0.08); }
  .liquid-btn-primary:hover { filter: brightness(1.14); }
  .ghost:hover { background-color: var(--neutral-tint); }
  .danger:hover { background-color: var(--alert-tint-strong); }
  .action-menu button:hover { background-color: var(--neutral-tint); }
}

.liquid-btn-primary.demo-hover { filter: brightness(1.14); }

.liquid-btn:active,
.liquid-btn-primary:active,
.ghost:active,
.danger:active,
.demo-press { transform: scale(0.97); }

.liquid-btn-primary:active,
.liquid-btn-primary.demo-press { filter: brightness(0.9); }

.ghost {
  background: transparent;
  color: var(--text-main);
}

.danger {
  background-color: var(--alert-tint);
  color: var(--alert-ink);
}

.liquid-btn:disabled,
.liquid-btn-primary:disabled,
.ghost:disabled,
.danger:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.icon-button {
  width: var(--touch);
  padding: 0;
  font-size: 20px;
  font-weight: 500;
}

.compact {
  position: relative;
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

/* 44px touch area around the smaller pill */
.compact::after {
  content: "";
  position: absolute;
  inset: -4px 0;
}

.large {
  min-height: 52px;
  padding: 0 26px;
  font-size: 16px;
}

.is-loading:disabled {
  opacity: 1;
  cursor: progress;
}

.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

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

/* ---------- 04 Forms & selection ---------- */

.field {
  width: 100%;
  min-height: var(--touch);
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-field);
  background-color: var(--field-bg);
  box-shadow: var(--field-edge);
  color: var(--text-main);
  font: inherit;
  font-size: var(--text-input);
  line-height: 1.35;
}

.field::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

textarea.field {
  min-height: 92px;
  resize: vertical;
}

select.field {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238E8E93' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}

.field:user-invalid { box-shadow: inset 0 0 0 1.5px var(--alert-ink); }

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

.field-error {
  min-height: 18px;
  margin-top: -4px;
  color: var(--alert-ink);
  font-size: 13px;
  font-weight: 600;
}

#sample-form .liquid-btn-primary {
  align-self: flex-start;
  margin-top: var(--space-2);
}

#form-result {
  min-height: 20px;
  color: var(--clear-ink);
  font-size: 14px;
  font-weight: 600;
}

.selection {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.glass-chip {
  appearance: none;
  min-height: var(--touch);
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--glass-pill);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  backdrop-filter: blur(28px) saturate(190%);
  box-shadow: var(--glass-pill-shadow);
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--dur-press) var(--ease), background-color 160ms var(--ease);
}

.glass-chip:active { transform: scale(0.97); }

.glass-chip.selected {
  background: var(--selected-bg);
  color: var(--selected-ink);
  box-shadow: 0 2px 6px rgba(28, 36, 43, 0.2);
}

.check-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--touch);
  font-size: 15px;
  cursor: pointer;
}

.check-row input {
  width: 20px;
  height: 20px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--selected-bg);
  cursor: pointer;
}

fieldset {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: var(--space-2) 0 0;
  padding: 0;
  border: 0;
}

legend.sample-label {
  margin-bottom: 2px;
  padding: 0;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 52px;
  margin-top: var(--space-1);
  padding: 0 14px;
  border-radius: 14px;
  background-color: var(--field-bg);
  box-shadow: var(--field-edge);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex-shrink: 0;
  width: 51px;
  height: 31px;
  margin: 0;
  border-radius: var(--radius-pill);
  background-color: var(--switch-off);
  cursor: pointer;
  transition: background-color var(--dur) var(--ease);
}

.switch::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16);
  transition: transform var(--dur) var(--ease);
}

.switch:checked { background-color: var(--clear); }
.switch:checked::before { transform: translateX(20px); }

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

.date-choice {
  appearance: none;
  display: flex;
  flex: 0 1 68px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 56px;
  min-height: 80px;
  padding: var(--space-2) 0;
  border: none;
  border-radius: var(--radius-tile);
  background: var(--glass-pill);
  box-shadow: var(--glass-pill-shadow);
  color: var(--text-main);
  font: inherit;
  cursor: pointer;
  transition: transform var(--dur-press) var(--ease), background-color 160ms var(--ease);
}

.date-choice:active { transform: scale(0.97); }

.date-choice span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.date-choice b {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.date-choice.selected {
  background: var(--selected-bg);
  color: var(--selected-ink);
  box-shadow: 0 4px 12px rgba(28, 36, 43, 0.22);
}

.date-choice.selected span { color: rgba(255, 255, 255, 0.78); }

/* ---------- 05 Navigation ---------- */

.nav-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
  gap: var(--space-4);
  align-items: start;
}

.nav-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.segments {
  display: flex;
  gap: 4px;
  width: 100%;
  max-width: 480px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background-color: var(--field-bg);
  box-shadow: var(--field-edge);
}

.segments [role="tab"] {
  appearance: none;
  flex: 1 1 auto;
  min-height: var(--touch);
  padding: 0 12px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms var(--ease), color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.segments [role="tab"][aria-selected="true"] {
  background: var(--glass-pill);
  color: var(--text-main);
  box-shadow: var(--glass-pill-shadow);
}

.panel-label {
  padding: 4px 2px;
  font-size: 15px;
  font-weight: 600;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 200px);
  gap: 10px;
}

.search-row label {
  display: block;
  min-width: 0;
}

/* App shell: phone frame, large-title bar, floating glass tab bar */
.device {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 360px;
  height: 600px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-device);
  background:
    radial-gradient(70% 40% at 0% 0%, var(--ambient-ice) 0%, transparent 70%),
    radial-gradient(60% 35% at 100% 70%, var(--ambient-copper) 0%, transparent 70%),
    var(--page-bg);
  box-shadow: var(--window-shadow);
}

.device-scroll {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  height: 100%;
  overflow-y: auto;
  padding: var(--space-4) 14px 96px;
  scrollbar-width: none;
}

.device-scroll::-webkit-scrollbar { display: none; }

.app-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 4px 4px;
}

.app-bar-date {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.app-bar h3 {
  margin: 2px 0 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.tabbar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  padding: 6px;
  border-radius: var(--radius-pill);
  background: var(--glass-pill);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  backdrop-filter: blur(28px) saturate(190%);
  box-shadow: var(--glass-vessel-shadow);
}

.tab {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 52px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.tab:active { transform: scale(0.96); }

.tab[aria-current="page"] {
  background: var(--neutral-tint);
  color: var(--text-main);
}

/* ---------- 06 People & lists ---------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  min-height: 28px;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.status.confirmed { background-color: var(--clear-tint); color: var(--clear-ink); }
.status.pending { background-color: var(--copper-tint); color: var(--copper-ink); }
.status.urgent { background: var(--alert-fill); color: #FFFFFF; }
.status.declined { background-color: var(--neutral-tint); color: var(--text-main); }
.status.neutral { background-color: var(--neutral-tint); color: var(--text-muted); }

.status-examples { gap: var(--space-2); }

.roster,
.post-list {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-group);
  background: var(--surface);
  box-shadow: var(--surface-edge);
}

.person,
.post {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  min-height: 64px;
  padding: 10px var(--space-4);
}

.roster .person:not(.hidden) ~ .person:not(.hidden),
.post + .post { border-top: 1px solid var(--divider); }

.long-person {
  min-height: 0;
  padding: 0;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(180deg, #EEF3F9 0%, #E2E8F0 100%);
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.9), 0 0 0 0.5px rgba(28, 36, 43, 0.08);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 700;
}

/* Headshot when we have one; initials otherwise */
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

:root.dark .avatar {
  background: linear-gradient(180deg, #2C3540 0%, #222932 100%);
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.10), 0 0 0 0.5px rgba(255, 255, 255, 0.08);
}

.avatar.big {
  width: 64px;
  height: 64px;
  font-size: 22px;
}

.person-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.person-text b,
.person-text span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-text b { font-size: 15px; font-weight: 600; }
.person-text span { color: var(--text-muted); font-size: 13px; }

.empty-search {
  padding: var(--space-5) var(--space-4);
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
}

/* ---------- 07 Schedule ---------- */

.staffing {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: var(--space-3);
}

.stat-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 18px 20px;
  border-radius: var(--radius-group);
  background: var(--surface);
  box-shadow: var(--surface-edge);
}

.stat-hero .sample-label { color: var(--copper-ink); }

.stat-hero b {
  font-size: var(--text-display);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.mini-stats > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: var(--space-3) 6px;
  border-radius: var(--radius-tile);
  background: var(--surface);
  box-shadow: var(--surface-edge);
  text-align: center;
}

.mini-stats b {
  font-size: 20px;
  font-weight: 800;
}

.mini-stats span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.schedule-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: 0 4px;
}

.schedule-toolbar h3 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.schedule-toolbar .time {
  margin-left: 4px;
  color: var(--text-muted);
  font-weight: 700;
}

.post-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background-color: var(--field-bg);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.post .liquid-btn { flex-shrink: 0; }

.coverage {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4) 18px;
  border-radius: var(--radius-group);
  background: var(--surface);
  box-shadow: var(--surface-edge);
}

progress {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-pill);
  background-color: var(--field-bg);
}

progress::-webkit-progress-bar {
  border-radius: var(--radius-pill);
  background-color: var(--field-bg);
}

progress::-webkit-progress-value {
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #3D8B68 0%, var(--clear) 100%);
  transition: width 300ms var(--ease);
}

progress::-moz-progress-bar {
  border-radius: var(--radius-pill);
  background: var(--clear);
}

#coverage-label {
  font-size: 14px;
  font-weight: 600;
}

/* ---------- 08 Feedback & states ---------- */

.notice {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 14px var(--space-4);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--surface-edge);
}

.notice > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 800;
}

.notice > div {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.notice b { font-size: 15px; font-weight: 600; }
.notice div span { color: var(--text-muted); font-size: 13px; }

.notice.success > span { background-color: var(--clear-tint); color: var(--clear-ink); }
.notice.warning > span { background-color: var(--copper-tint); color: var(--copper-ink); }
.notice.error > span { background-color: var(--alert-tint); color: var(--alert-ink); }

/* Urgent: the one loud surface in the system */
.notice.urgent {
  background: var(--alert-fill);
  box-shadow:
    0 0 0 0.5px rgba(0, 0, 0, 0.2),
    inset 0 1px 0.5px rgba(255, 255, 255, 0.28),
    0 8px 24px rgba(180, 35, 24, 0.28);
  color: #FFFFFF;
}

.notice.urgent > span {
  background-color: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

.notice.urgent div span { color: rgba(255, 255, 255, 0.86); }

.notice.urgent .liquid-btn {
  background: #FFFFFF;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  color: var(--alert);
}

.notice > a {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  min-height: var(--touch);
  padding: 0 6px;
  border-radius: 10px;
  color: var(--copper-ink);
  font-weight: 600;
  text-decoration: none;
}

.notice > .liquid-btn { flex-shrink: 0; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 20px;
  border-radius: var(--radius-group);
  background: var(--surface);
  box-shadow: var(--surface-edge);
  text-align: center;
}

.empty-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-tile);
  background-color: var(--field-bg);
  color: var(--text-muted);
  font-size: 24px;
}

.empty-state h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.loading-state {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 20px;
  border-radius: var(--radius-group);
  background: var(--surface);
  box-shadow: var(--surface-edge);
}

.skeleton {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--field-bg) 25%, var(--shimmer-hi) 50%, var(--field-bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton.short { width: 58%; }

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

/* ---------- 09 Menus & dialogs ---------- */

.menu-wrap { position: relative; }

/* Solid: a glass menu can only blur its own section, so text behind would bleed through */
.action-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 220px;
  padding: 6px;
  border-radius: 18px;
  background: var(--menu-bg);
  box-shadow: var(--window-shadow);
  transform-origin: top left;
  animation: pop 160ms var(--ease);
}

.action-menu button {
  appearance: none;
  min-height: var(--touch);
  padding: 0 var(--space-3);
  border: none;
  border-radius: var(--radius-field);
  background: transparent;
  color: var(--text-main);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.action-menu button:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: -2px;
  background-color: var(--neutral-tint);
}

dialog {
  width: min(420px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 26px;
  background: var(--surface);
  color: var(--text-main);
  box-shadow: var(--window-shadow);
}

dialog::backdrop {
  background: rgba(13, 16, 20, 0.32);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

dialog[open] { animation: pop 200ms var(--ease); }

dialog form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
}

dialog h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: 800;
  letter-spacing: -0.02em;
}

dialog p {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}

dialog .demo-row {
  justify-content: flex-end;
  margin-top: var(--space-2);
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.details-sheet .rules {
  padding: 0 var(--space-4);
  background-color: var(--field-bg);
  box-shadow: none;
}

.details-sheet .liquid-btn-primary { margin-top: 4px; }

@keyframes pop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes sheet-up {
  from { opacity: 0; transform: translateY(32px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 10 Material & motion ---------- */

.material-samples {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: var(--space-4);
}

.material-stage {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 184px;
  padding: 18px;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(60% 80% at 14% 22%, rgba(200, 100, 50, 0.55) 0%, transparent 70%),
    radial-gradient(60% 80% at 86% 80%, rgba(80, 130, 190, 0.55) 0%, transparent 70%),
    linear-gradient(135deg, #E9EEF5 0%, #F7F1EC 100%);
}

.material-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: repeating-linear-gradient(-55deg, transparent 0 34px, rgba(28, 36, 43, 0.10) 34px 36px);
}

:root.dark .material-stage {
  background:
    radial-gradient(60% 80% at 14% 22%, rgba(200, 100, 50, 0.45) 0%, transparent 70%),
    radial-gradient(60% 80% at 86% 80%, rgba(70, 120, 180, 0.45) 0%, transparent 70%),
    linear-gradient(135deg, #1B222B 0%, #241C18 100%);
}

:root.dark .material-stage::before {
  background: repeating-linear-gradient(-55deg, transparent 0 34px, rgba(255, 255, 255, 0.08) 34px 36px);
}

.material-stage .sample-label { color: var(--text-main); }

.glass-vessel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: auto;
  padding: 10px 10px 10px 18px;
  border-radius: var(--radius-vessel);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.30) 100%);
  -webkit-backdrop-filter: blur(14px) saturate(190%);
  backdrop-filter: blur(14px) saturate(190%);
  box-shadow:
    0 0 0 0.5px rgba(255, 255, 255, 0.6),
    inset 0 1.5px 0.5px rgba(255, 255, 255, 0.9),
    inset 0 -1px 1px rgba(0, 0, 0, 0.04),
    0 10px 30px rgba(28, 36, 43, 0.12);
  font-size: 16px;
  font-weight: 700;
}

:root.dark .glass-vessel {
  background: linear-gradient(180deg, rgba(48, 56, 68, 0.55) 0%, rgba(30, 36, 44, 0.40) 100%);
  box-shadow:
    0 0 0 0.5px rgba(255, 255, 255, 0.14),
    inset 0 1px 0.5px rgba(255, 255, 255, 0.18),
    0 10px 30px rgba(0, 0, 0, 0.35);
}

.solid-sample {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--surface-edge);
}

.solid-sample b {
  margin-top: 4px;
  font-size: var(--text-headline);
  font-weight: 700;
}

.solid-sample > span:not(.sample-label):not(.status) {
  color: var(--text-muted);
  font-size: 14px;
}

.solid-sample .status {
  align-self: flex-start;
  margin-top: auto;
}

.rules {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0 18px;
  border-radius: var(--radius-group);
  background: var(--surface);
  box-shadow: var(--surface-edge);
}

.rules > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 14px 0;
}

.rules > div + div { border-top: 1px solid var(--divider); }

.rules dt {
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 600;
}

.rules dd {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  text-align: right;
}

footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 4px 0;
  color: var(--text-muted);
  font-size: 13px;
}

footer a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  color: var(--text-main);
  font-weight: 600;
  text-decoration: none;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 100;
  max-width: calc(100vw - 32px);
  padding: 12px 20px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: rgba(28, 36, 43, 0.86);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    0 0 0 0.5px rgba(255, 255, 255, 0.12),
    inset 0 1px 0.5px rgba(255, 255, 255, 0.18),
    0 12px 32px rgba(0, 0, 0, 0.25);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  transform: translateX(-50%);
}

:root.dark .toast { background: rgba(58, 66, 78, 0.9); }

.toast.show { animation: toast-in 220ms var(--ease); }

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- Reduced transparency: drop the blur too ---------- */

@media (prefers-reduced-transparency: reduce) {
  .kit-header,
  .kit-nav,
  .kit-section,
  .review-tag,
  .liquid-btn,
  .glass-chip,
  .tabbar,
  .glass-vessel,
  .toast {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  body::before { opacity: 0; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Tablet & phone ---------- */

@media (max-width: 1100px) {
  .nav-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .kit-header {
    top: 10px;
    width: calc(100% - 24px);
    margin-top: 10px;
  }

  .kit-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
    padding: 14px 12px 40px;
  }

  .kit-nav {
    position: static;
    flex-direction: row;
    gap: 4px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px;
    border-radius: var(--radius-pill);
    scrollbar-width: none;
  }

  .kit-nav::-webkit-scrollbar { display: none; }

  .kit-nav .nav-section-label { display: none; }

  .kit-nav a {
    flex-shrink: 0;
    padding: 0 14px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
  }

  .kit-nav .back-link { margin-top: 0; }
  .kit-nav .back-link::before { display: none; }

  .kit-section { scroll-margin-top: 80px; }
}

@media (max-width: 640px) {
  .kit-brand { font-size: 14px; }
  .kit-brand .sub { display: none; }

  .header-tools .liquid-btn {
    padding: 0 14px;
    font-size: 13px;
  }

  .kit-intro { padding: 12px 4px 4px; }

  .kit-section {
    gap: 14px;
    padding: var(--space-4);
    border-radius: 24px;
  }

  .two-col,
  .material-samples,
  .search-row,
  .staffing { grid-template-columns: minmax(0, 1fr); }

  .palette { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .identity-stage { padding: 20px; }
  .specimen { padding: 14px; }

  .clearspace .lockup { --h: 36px; }
  .clearspace-box { padding: calc(36px / 2); }

  .segments [role="tab"] {
    padding: 0 8px;
    font-size: 13px;
  }

  .dates { gap: var(--space-2); }

  .rules > div {
    flex-direction: column;
    gap: 2px;
  }

  .rules dd { text-align: left; }

  .device { height: 560px; }

  .details-sheet {
    width: 100%;
    margin: auto 0 0;
    border-radius: 26px 26px 0 0;
  }

  .details-sheet form { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

  .details-sheet[open] { animation: sheet-up var(--dur-sheet) var(--ease); }
}

@media (max-width: 420px) {
  .identity-lockup { gap: var(--space-3); }

  .identity-lockup svg {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 360px) {
  .clearspace .lockup { --h: 28px; }
  .clearspace-box { padding: calc(28px / 2); }

  /* Equal-width tabs; long labels wrap instead of spilling out */
  .segments [role="tab"] {
    flex: 1 1 0;
    min-width: 0;
    padding: 4px 6px;
    line-height: 1.15;
    white-space: normal;
  }
}
