.topbar {
  /* Shell chrome — see topbar-dashboard.css */
}

.topbar__start,
.topbar__actions,
.topbar__nav {
  /* Layout primitives — extended in topbar-dashboard.css */
}

.theme-toggle__icon {
  display: none;
  align-items: center;
  justify-content: center;
}

.theme-toggle__icon svg {
  width: 1.125em;
  height: 1.125em;
  display: block;
}

[data-theme="light"] .theme-toggle__icon--moon,
html:not([data-theme]) .theme-toggle__icon--moon {
  display: inline-flex;
}

[data-theme="dark"] .theme-toggle__icon--sun {
  display: inline-flex;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  min-height: calc(100dvh - var(--topbar-height) - env(safe-area-inset-top, 0px));
  background: var(--shell-frame-bg);
}

/* Avoid FOUC while deferred kit CSS is still loading on index */
.app-shell.kit-styles-pending #main-panel,
.app-shell.kit-styles-pending .kit-nav-bar,
.app-shell.kit-styles-pending .kit-page-masthead {
  visibility: hidden;
}

.main-panel {
  padding: var(--shell-gutter);
  background: var(--shell-frame-bg);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.main-panel__content {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition:
    opacity 140ms ease-out,
    transform 140ms ease-out;
}

.main-panel__content.panel-swap-exit {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

.main-panel__content.panel-swap-enter {
  animation: panelSwapIn 220ms ease-out;
}

.home-page {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.home-header {
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: var(--border-hairline);
  text-align: center;
}

.home-tool {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.home-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.home-benefits {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.hero {
  margin-bottom: 0;
}

.hero__title {
  font-size: var(--text-xl);
  font-weight: var(--font-medium);
  color: var(--color-black);
  line-height: 1.2;
  margin-bottom: var(--space-3);
  max-width: none;
}

.hero__title-main,
.hero__title-sub {
  display: block;
}

.hero__title-sub {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  font-weight: var(--font-medium);
  color: var(--color-body);
  margin-top: var(--space-2);
  line-height: 1.35;
}

.hero__subtitle {
  color: var(--color-body);
  max-width: 56ch;
  margin-left: auto;
  margin-right: auto;
  font-size: var(--text-md);
  line-height: 1.5;
}

.trust-line {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  margin-bottom: var(--space-3);
}

.trust-line--center {
  text-align: center;
}

.features-list {
  list-style: none;
  padding: 0;
  margin: var(--space-3) 0;
  display: grid;
  gap: var(--space-3);
}

.features-list li::before {
  content: "— ";
  color: var(--color-black);
}

.features-list--numbered {
  list-style: none;
}

.features-list--numbered li::before {
  content: none;
}

.features-list--numbered li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.feature-num {
  flex: 0 0 1.5rem;
  text-align: right;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  line-height: 1.5;
  color: var(--color-muted);
}

.feature-text {
  flex: 1;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--color-body);
}

.privacy-line {
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.home-benefits .privacy-line {
  text-align: center;
  margin-top: var(--space-4);
  font-family: var(--font-body);
  font-size: clamp(var(--text-xs), 1.1vw, var(--text-sm));
  line-height: 1.4;
}

@media (max-width: 960px) {
  .home-benefits {
    order: 2;
  }
}

@media (max-width: 768px) {
  .main-panel {
    padding: var(--space-3);
  }
}

@media (max-width: 640px) {
  /* Homepage — edge-to-edge (same idea as kit reader) */
  .app-shell.state-sample .main-panel {
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
    padding-left: max(0.25rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.25rem, env(safe-area-inset-right, 0px));
  }

  /* Kit reader — edge-to-edge; override shell gutters (desktop kit chrome stays inset) */
  .app-shell:not(.state-sample) .main-panel:has(#kit-nav-bar:not([hidden])) {
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
    padding-left: max(0.25rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.25rem, env(safe-area-inset-right, 0px));
  }
}

@media (max-width: 480px) {
  .main-panel {
    padding: var(--space-2) var(--space-3);
  }

  .app-shell.state-sample .main-panel {
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
    padding-left: max(0.25rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.25rem, env(safe-area-inset-right, 0px));
  }

  .app-shell:not(.state-sample) .main-panel:has(#kit-nav-bar:not([hidden])) {
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
    padding-left: max(0.25rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.25rem, env(safe-area-inset-right, 0px));
  }
}
