:root {
  --ink: #171916;
  --muted: #6f726b;
  --faint: #9b9c94;
  --paper: #f4f1e9;
  --surface: #fffcf4;
  --surface-strong: #f8f4eb;
  --line: #ddd7ca;
  --line-strong: #c7c0b3;
  --charcoal: #20231f;
  --green: #536545;
  --green-soft: #e6eadc;
  --blue: #4f6d7c;
  --red: #a75442;
  --yellow: #c3a642;
  --shadow: 0 18px 50px rgba(32, 35, 31, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.app-shell {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 252, 244, 0.82), rgba(244, 241, 233, 0.94)),
    radial-gradient(circle at top left, rgba(195, 166, 66, 0.16), transparent 34rem);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  gap: 1rem;
  padding: 1rem;
  background:
    linear-gradient(180deg, rgba(255, 252, 244, 0.9), rgba(244, 241, 233, 0.96)),
    radial-gradient(circle at top left, rgba(83, 101, 69, 0.14), transparent 32rem);
}

.auth-brand-panel,
.auth-form-panel {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: rgba(255, 252, 244, 0.78);
}

.auth-brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  min-height: 23rem;
  padding: 1rem;
  color: var(--ink);
}

.auth-brand-copy {
  display: grid;
  gap: 0.85rem;
}

.auth-brand-copy h1 {
  max-width: 10ch;
}

.auth-brand-copy p {
  max-width: 31rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.auth-proof-grid {
  display: grid;
  gap: 0.65rem;
}

.auth-proof-grid div {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem;
  border-radius: 0.5rem;
  background: var(--surface-strong);
}

.auth-proof-grid strong,
.auth-form-head strong,
.auth-fallback strong {
  font-weight: 500;
}

.auth-proof-grid span,
.auth-form-head span,
.auth-fallback span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.auth-form-panel {
  overflow: hidden;
}

.auth-form-head {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.auth-form-head div:first-child {
  display: grid;
  gap: 0.15rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
}

.auth-tabs button {
  min-height: 2.15rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}

.auth-tabs button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 4px 16px rgba(32, 35, 31, 0.08);
}

.clerk-auth-mount {
  min-height: 20rem;
  padding: 1rem;
}

.auth-fallback {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: 0.5rem;
  background: var(--surface-strong);
}

.auth-preview-form {
  display: grid;
  gap: 0.85rem;
}

.auth-preview-form label {
  display: grid;
  gap: 0.35rem;
}

.auth-preview-form label span {
  color: var(--muted);
  font-size: 0.74rem;
}

.auth-preview-form input {
  width: 100%;
  min-height: 3rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0 0.85rem;
  background: var(--surface);
  color: var(--ink);
}

.auth-preview-form .primary-button {
  width: 100%;
}

.auth-preview-form p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.foundriq-clerk-root,
.foundriq-clerk-card {
  width: 100%;
}

.desktop-rail {
  display: none;
}

.mobile-frame {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem 0.7rem;
  background: rgba(244, 241, 233, 0.88);
  border-bottom: 1px solid rgba(221, 215, 202, 0.75);
  backdrop-filter: blur(16px);
}

.brand-lockup,
.workspace-switcher,
.user-chip,
.module-icon {
  display: inline-flex;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.7rem;
  background: var(--green);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
}

.brand-copy {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
}

.brand-copy strong,
.section-title strong,
.product-copy strong,
.task-copy strong,
.module-card strong,
.shop-domain strong,
.chat-head strong,
.insight strong,
.asset-copy strong,
.order-row strong {
  font-weight: 500;
}

.brand-copy span,
.workspace-switcher span,
.section-title span,
.product-copy span,
.task-copy span,
.module-card span,
.shop-domain span,
.chat-head span,
.insight span,
.asset-copy span,
.order-row span {
  color: var(--muted);
}

.brand-lockup {
  gap: 0.65rem;
  min-width: 0;
}

.brand-copy strong {
  font-size: 0.88rem;
  line-height: 1.1;
}

.brand-copy span {
  font-size: 0.72rem;
  line-height: 1.2;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.icon-button,
.nav-button,
.tool-button,
.format-button,
.chip-button {
  border: 0;
  color: var(--ink);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 252, 244, 0.82);
}

.workspace-switcher {
  gap: 0.35rem;
  max-width: 8rem;
  height: 2.25rem;
  padding: 0 0.72rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 252, 244, 0.82);
  color: var(--ink);
  font-size: 0.78rem;
  white-space: nowrap;
}

.demo-user-switcher select {
  max-width: 8.9rem;
  height: 2.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 1.8rem 0 0.75rem;
  background: rgba(255, 252, 244, 0.82);
  color: var(--ink);
  font-size: 0.78rem;
}

.user-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.35rem;
  max-width: 10.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.65rem 0.25rem 0.25rem;
  background: rgba(255, 252, 244, 0.82);
  color: var(--ink);
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  background: var(--charcoal);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 500;
}

.user-meta {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
  text-align: left;
}

.user-meta strong,
.user-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta strong {
  font-size: 0.76rem;
  font-weight: 500;
}

.user-meta small {
  color: var(--muted);
  font-size: 0.66rem;
}

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

.page {
  width: 100%;
  flex: 1;
  padding: 1rem 1rem 6.8rem;
}

.view {
  display: none;
  animation: enter 180ms ease-out;
}

.view.active {
  display: block;
}

@keyframes enter {
  from {
    transform: translateY(5px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.hero {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 13ch;
  color: var(--ink);
  font-size: clamp(2rem, 9vw, 3.1rem);
  line-height: 0.96;
  font-weight: 500;
}

.hero p {
  max-width: 34rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.hero-actions,
.inline-actions,
.section-title,
.panel-title,
.chat-head,
.shop-actions,
.cofounder-input {
  display: flex;
  align-items: center;
}

.hero-actions,
.inline-actions,
.shop-actions {
  gap: 0.55rem;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  border-radius: 0.9rem;
  padding: 0 0.95rem;
  font-weight: 500;
  font-size: 0.88rem;
}

.primary-button {
  border: 0;
  background: var(--charcoal);
  color: #fff;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.text-button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.metric,
.panel,
.module-card,
.studio-composer,
.shop-preview,
.cofounder-card,
.prompt-panel {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(255, 252, 244, 0.78);
}

.metric {
  display: grid;
  gap: 0.35rem;
  min-height: 6.2rem;
  padding: 0.8rem;
}

.metric span {
  color: var(--muted);
  font-size: 0.74rem;
}

.metric strong {
  align-self: end;
  font-size: 1.45rem;
  line-height: 1;
  font-weight: 500;
}

.metric small,
.module-status {
  color: var(--green);
  font-size: 0.72rem;
}

.content-stack {
  display: grid;
  gap: 1rem;
}

.panel {
  overflow: hidden;
}

.panel-title,
.section-title {
  justify-content: space-between;
  gap: 1rem;
}

.panel-title {
  padding: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.section-title {
  margin: 1.25rem 0 0.6rem;
}

.section-title div,
.panel-title div {
  display: grid;
  gap: 0.15rem;
}

.section-title strong,
.panel-title strong {
  font-size: 0.9rem;
  line-height: 1.2;
}

.section-title span,
.panel-title span {
  font-size: 0.74rem;
  line-height: 1.25;
}

.product-list,
.task-list,
.asset-list,
.order-list {
  display: grid;
}

.shop-product-row {
  display: grid;
  border-top: 1px solid var(--line);
}

.shop-product-row:first-child {
  border-top: 0;
}

.shop-product-row .product-row {
  border-top: 0;
}

.shop-product-row .primary-button {
  justify-self: stretch;
  margin: 0 0.8rem 0.8rem;
}

.product-row,
.task-row,
.asset-row,
.order-row,
.library-row,
.publish-row {
  display: grid;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem;
  border-top: 1px solid var(--line);
}

.product-row:first-child,
.task-row:first-child,
.asset-row:first-child,
.order-row:first-child,
.publish-row:first-child {
  border-top: 0;
}

.product-row {
  grid-template-columns: 3rem 1fr auto;
}

.task-row {
  grid-template-columns: 2rem 1fr auto;
}

.library-row {
  grid-template-columns: 2rem minmax(0, 1fr) auto;
}

.asset-row {
  grid-template-columns: 2.8rem 1fr auto;
}

.order-row {
  grid-template-columns: 1fr auto;
}

.publish-row {
  grid-template-columns: minmax(0, 1fr) auto;
  padding-top: 0;
}

.publish-row span {
  color: var(--muted);
  font-size: 0.74rem;
}

.product-thumb,
.asset-thumb,
.task-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.product-thumb,
.asset-thumb {
  width: 3rem;
  height: 3rem;
  border-radius: 0.5rem;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(32, 35, 31, 0.88), rgba(83, 101, 69, 0.82)),
    var(--green);
}

.product-thumb.blue,
.asset-thumb.blue {
  background:
    linear-gradient(135deg, rgba(79, 109, 124, 0.92), rgba(167, 84, 66, 0.74)),
    var(--blue);
}

.task-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
}

.product-copy,
.task-copy,
.asset-copy,
.order-row div {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.product-copy strong,
.task-copy strong,
.asset-copy strong,
.order-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
  line-height: 1.2;
}

.product-copy span,
.task-copy span,
.asset-copy span,
.order-row span {
  font-size: 0.73rem;
  line-height: 1.25;
}

.price,
.task-time,
.order-value {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.prompt-grid {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.module-card {
  display: grid;
  gap: 0.8rem;
  min-height: 8.4rem;
  padding: 0.85rem;
}

.module-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.5rem;
}

.module-icon {
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.6rem;
  color: #fff;
  background: var(--charcoal);
}

.module-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.future-module {
  border-style: dashed;
  background: rgba(255, 252, 244, 0.42);
}

.prompt-panel {
  overflow: hidden;
}

.prompt-editor {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
}

.prompt-textarea {
  width: 100%;
  min-height: 7.5rem;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.8rem;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.42;
}

.prompt-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.primary-button.compact,
.secondary-button.compact {
  min-height: 2.35rem;
  border-radius: 0.72rem;
  padding: 0 0.75rem;
  font-size: 0.78rem;
}

.studio-composer {
  display: grid;
  gap: 0.8rem;
  padding: 0.85rem;
}

.studio-prompt {
  width: 100%;
  min-height: 8.7rem;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.9rem;
  background: var(--surface);
  color: var(--ink);
  line-height: 1.45;
}

.studio-prompt::placeholder {
  color: var(--faint);
}

.format-grid,
.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.format-button,
.tool-button {
  min-height: 4.5rem;
  display: grid;
  place-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 500;
}

.format-button.active {
  border-color: var(--charcoal);
  background: var(--charcoal);
  color: #fff;
}

.generation-progress {
  display: grid;
  gap: 0.55rem;
}

.job-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.6rem;
  padding: 0 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface-strong);
}

.job-status-row span {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: capitalize;
}

.job-status-row strong {
  font-size: 0.82rem;
  font-weight: 500;
}

.progress-track {
  height: 0.55rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-strong);
}

.progress-bar {
  width: 72%;
  height: 100%;
  background: var(--green);
}

.shop-preview {
  overflow: hidden;
}

.shop-cover {
  min-height: 10.75rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.65rem;
  padding: 1rem;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(32, 35, 31, 0.12), rgba(32, 35, 31, 0.86)),
    linear-gradient(135deg, #536545, #20231f 58%, #a75442);
}

.shop-cover h2 {
  max-width: 11ch;
  margin: 0;
  font-size: 2.35rem;
  line-height: 0.96;
  font-weight: 500;
}

.shop-cover p {
  max-width: 17rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.84rem;
  line-height: 1.35;
}

.shop-body {
  display: grid;
  gap: 0.85rem;
  padding: 0.85rem;
}

.shop-domain {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.status-pill,
.chip-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 1.7rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.72rem;
  white-space: nowrap;
}

.status-pill.live {
  border-color: rgba(83, 101, 69, 0.26);
  background: var(--green-soft);
  color: var(--green);
}

.theme-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.85rem;
  border-top: 1px solid var(--line);
}

.theme-row:first-child {
  border-top: 0;
}

.theme-row strong {
  font-weight: 500;
  font-size: 0.86rem;
}

.theme-row span {
  color: var(--muted);
  font-size: 0.74rem;
}

.swatches {
  display: flex;
  gap: 0.3rem;
}

.swatches i {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  border: 1px solid rgba(32, 35, 31, 0.14);
}

.swatches i:nth-child(1) {
  background: var(--charcoal);
}

.swatches i:nth-child(2) {
  background: var(--green);
}

.swatches i:nth-child(3) {
  background: var(--yellow);
}

.cofounder-layout {
  display: grid;
  gap: 1rem;
}

.cofounder-card {
  padding: 0.85rem;
}

.chat-head {
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.85rem;
}

.chat-head div {
  display: grid;
  gap: 0.15rem;
}

.chat-feed {
  display: grid;
  gap: 0.75rem;
}

.message {
  max-width: 88%;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.4;
}

.message.me {
  justify-self: end;
  border-color: transparent;
  background: var(--green);
  color: #fff;
}

.context-grid {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: var(--surface-strong);
}

.insight {
  display: grid;
  grid-template-columns: 1.2rem 1fr auto;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.74rem;
}

.insight svg {
  color: var(--green);
}

.cofounder-input {
  gap: 0.55rem;
  margin-top: 0.85rem;
  padding: 0.45rem 0.45rem 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.cofounder-input input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.send-button {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: var(--charcoal);
  color: #fff;
}

.bottom-nav {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(3.2rem, 1fr));
  gap: 0.2rem;
  min-height: 4.15rem;
  padding: 0.36rem;
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  background: rgba(255, 252, 244, 0.93);
  box-shadow: 0 10px 30px rgba(32, 35, 31, 0.12);
  backdrop-filter: blur(18px);
}

.nav-button {
  display: grid;
  place-items: center;
  gap: 0.2rem;
  border-radius: 1rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1;
}

.nav-button.active {
  background: var(--surface-strong);
  color: var(--ink);
}

.tablet-columns {
  display: grid;
  gap: 1rem;
}

.permission-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.infrastructure-panel {
  margin-bottom: 1rem;
}

.backend-grid {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem;
}

.backend-item {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  min-height: 4rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
}

.backend-item i,
.backend-item svg {
  color: var(--green);
}

.backend-item div {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.backend-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
  font-weight: 500;
}

.backend-item span {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

.permission-list {
  display: grid;
  gap: 1rem;
}

.permission-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(255, 252, 244, 0.78);
}

.permission-user {
  display: grid;
  grid-template-columns: 2.7rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.avatar-mark {
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 999px;
  background: var(--charcoal);
  color: #fff;
  font-weight: 500;
}

.permission-user div {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.permission-user strong,
.permission-section-title strong,
.feature-group-title strong {
  font-weight: 500;
}

.permission-user span,
.permission-section-title span,
.permission-toggle small {
  color: var(--muted);
}

.permission-user div span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.74rem;
}

.permission-section {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.permission-section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.permission-section-title span {
  text-align: right;
  font-size: 0.72rem;
}

.permission-grid {
  display: grid;
  gap: 0.5rem;
}

.permission-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  min-height: 3.65rem;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
}

.permission-toggle input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--green);
}

.permission-toggle span {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.permission-toggle strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 500;
}

.permission-toggle small {
  font-size: 0.7rem;
  line-height: 1.25;
}

.feature-matrix,
.feature-group {
  display: grid;
  gap: 0.7rem;
}

.feature-group {
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
}

.feature-group:first-child {
  padding-top: 0;
  border-top: 0;
}

.feature-group-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink);
  font-size: 0.84rem;
}

.feature-group-title svg {
  color: var(--green);
}

.feature-toggle {
  min-height: 4.05rem;
}

.permission-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  padding: 0.85rem;
}

@media (min-width: 720px) {
  .auth-page {
    grid-template-columns: minmax(0, 0.95fr) minmax(23rem, 0.7fr);
    align-items: center;
    padding: 1.2rem;
  }

  .auth-brand-panel,
  .auth-form-panel {
    min-height: calc(100vh - 2.4rem);
  }

  .auth-brand-panel {
    padding: 1.25rem;
  }

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

  .page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 1.2rem 1.2rem 7rem;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .hero p {
    max-width: 28rem;
  }

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

  .permission-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

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

  .tablet-columns {
    grid-template-columns: minmax(0, 1.15fr) minmax(19rem, 0.85fr);
    align-items: start;
  }

  .format-grid,
  .tool-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .cofounder-layout {
    grid-template-columns: minmax(0, 1fr) minmax(20rem, 0.7fr);
    align-items: start;
  }
}

@media (min-width: 1040px) {
  .app-shell {
    display: grid;
    grid-template-columns: 16rem 1fr;
  }

  .desktop-rail {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100vh;
    padding: 1.1rem;
    border-right: 1px solid var(--line);
    background: rgba(255, 252, 244, 0.72);
  }

  .mobile-frame {
    min-width: 0;
  }

  .topbar {
    padding-inline: 1.3rem;
  }

  .page {
    padding-bottom: 2rem;
  }

  .bottom-nav {
    display: none;
  }

  .rail-nav {
    display: grid;
    gap: 0.35rem;
  }

  .rail-button {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 2.55rem;
    padding: 0 0.7rem;
    border: 0;
    border-radius: 0.8rem;
    background: transparent;
    color: var(--muted);
    text-align: left;
  }

  .rail-button.active {
    background: var(--surface-strong);
    color: var(--ink);
  }

  .rail-footer {
    margin-top: auto;
    display: grid;
    gap: 0.7rem;
    padding: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    background: var(--surface);
  }

  .rail-footer strong {
    font-size: 0.88rem;
    font-weight: 500;
  }

  .rail-footer span {
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.35;
  }
}

@media (max-width: 380px) {
  .page {
    padding-inline: 0.75rem;
  }

  .topbar {
    padding-inline: 0.75rem;
  }

  .workspace-switcher {
    display: none;
  }

  .demo-user-switcher select {
    max-width: 6.6rem;
  }

  .snapshot-grid,
  .module-grid,
  .prompt-actions,
  .permission-summary,
  .permission-actions {
    grid-template-columns: 1fr;
  }

  .permission-user {
    grid-template-columns: 2.7rem minmax(0, 1fr);
  }

  .permission-user .status-pill {
    grid-column: 2;
    justify-self: start;
  }
}
