@font-face {
  font-family: "Metropolis";
  src: url("/assets/fonts/metropolis/Metropolis-Thin.otf") format("opentype");
  font-style: normal;
  font-weight: 100;
  font-display: swap;
}

@font-face {
  font-family: "Metropolis";
  src: url("/assets/fonts/metropolis/Metropolis-ThinItalic.otf") format("opentype");
  font-style: italic;
  font-weight: 100;
  font-display: swap;
}

@font-face {
  font-family: "Metropolis";
  src: url("/assets/fonts/metropolis/Metropolis-ExtraLight.otf") format("opentype");
  font-style: normal;
  font-weight: 200;
  font-display: swap;
}

@font-face {
  font-family: "Metropolis";
  src: url("/assets/fonts/metropolis/Metropolis-ExtraLightItalic.otf") format("opentype");
  font-style: italic;
  font-weight: 200;
  font-display: swap;
}

@font-face {
  font-family: "Metropolis";
  src: url("/assets/fonts/metropolis/Metropolis-Light.otf") format("opentype");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Metropolis";
  src: url("/assets/fonts/metropolis/Metropolis-LightItalic.otf") format("opentype");
  font-style: italic;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Metropolis";
  src: url("/assets/fonts/metropolis/Metropolis-Regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Metropolis";
  src: url("/assets/fonts/metropolis/Metropolis-RegularItalic.otf") format("opentype");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Metropolis";
  src: url("/assets/fonts/metropolis/Metropolis-Medium.otf") format("opentype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Metropolis";
  src: url("/assets/fonts/metropolis/Metropolis-MediumItalic.otf") format("opentype");
  font-style: italic;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Metropolis";
  src: url("/assets/fonts/metropolis/Metropolis-SemiBold.otf") format("opentype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Metropolis";
  src: url("/assets/fonts/metropolis/Metropolis-SemiBoldItalic.otf") format("opentype");
  font-style: italic;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Metropolis";
  src: url("/assets/fonts/metropolis/Metropolis-Bold.otf") format("opentype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Metropolis";
  src: url("/assets/fonts/metropolis/Metropolis-BoldItalic.otf") format("opentype");
  font-style: italic;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Metropolis";
  src: url("/assets/fonts/metropolis/Metropolis-ExtraBold.otf") format("opentype");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "Metropolis";
  src: url("/assets/fonts/metropolis/Metropolis-ExtraBoldItalic.otf") format("opentype");
  font-style: italic;
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "Metropolis";
  src: url("/assets/fonts/metropolis/Metropolis-Black.otf") format("opentype");
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

@font-face {
  font-family: "Metropolis";
  src: url("/assets/fonts/metropolis/Metropolis-BlackItalic.otf") format("opentype");
  font-style: italic;
  font-weight: 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --font-ui: "Metropolis", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #dedbd2;
  --surface: #f1efe7;
  --surface-2: #d8d5cc;
  --text: #1c2021;
  --muted: #5c605d;
  --border: #1c2021;
  --accent: #ff4b1f;
  --accent-dark: #111314;
  --signal: #b8f128;
  --danger: #ba2d1d;
  --grid: rgba(28, 32, 33, 0.09);
  --soft-border: rgba(28, 32, 33, 0.28);
  --shadow: 6px 6px 0 rgba(28, 32, 33, 0.92);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12px 12px, rgba(28, 32, 33, 0.08) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    var(--bg);
  background-size: 18px 18px, 32px 32px, 32px 32px, auto;
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.35;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.workspace {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 0;
  box-shadow: var(--shadow);
  padding: 24px;
  position: relative;
}

.legal-page {
  display: grid;
  gap: 12px;
  max-width: 860px;
}

.legal-page h1,
.legal-page h2,
.legal-page p {
  margin-bottom: 0;
}

.legal-page h2 {
  margin-top: 10px;
}

.legal-page p {
  color: var(--muted);
  line-height: 1.6;
}

.waitlist-shell {
  width: min(440px, calc(100% - 32px));
  min-height: 100vh;
  display: grid;
  align-items: center;
}

.landing-shell {
  width: min(560px, calc(100% - 32px));
  min-height: 100vh;
  display: grid;
  align-items: center;
}

.beta-landing-window {
  display: grid;
  gap: 18px;
  padding: 30px;
}

.beta-copy {
  display: grid;
  gap: 14px;
}

.beta-copy h1 {
  font-size: clamp(2.4rem, 10vw, 4.4rem);
  font-weight: 900;
  line-height: 0.9;
}

.beta-copy p {
  margin-bottom: 0;
  color: var(--text);
  font-size: 1.04rem;
  font-weight: 800;
  line-height: 1.55;
}

.beta-copy a {
  color: var(--text);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
}

.beta-copy a:hover {
  background: var(--signal);
}

.beta-admin-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.beta-message {
  margin: 0;
}

.waitlist-page {
  display: grid;
  gap: 14px;
  padding: 44px 24px 30px;
  text-align: center;
}

.waitlist-page::before,
.waitlist-page::after {
  content: none;
}

.waitlist-page h1 {
  font-size: clamp(2.6rem, 12vw, 4.6rem);
  font-weight: 900;
  line-height: 0.9;
}

.waitlist-subtitle {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
  text-transform: lowercase;
}

.waitlist-form {
  display: grid;
  gap: 8px;
}

.waitlist-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0;
}

.waitlist-row input {
  border-right: 0;
}

.waitlist-admin-panel {
  overflow: hidden;
}

.waitlist-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 2px solid var(--border);
  padding: 14px 16px;
}

.waitlist-table-wrap {
  overflow: auto;
}

.waitlist-table {
  width: 100%;
  border-collapse: collapse;
}

.waitlist-table th,
.waitlist-table td {
  border-top: 2px solid var(--border);
  padding: 12px 16px;
  text-align: left;
}

.waitlist-table th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 2.4rem, 2.4rem);
  font-weight: 900;
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.status-pill {
  min-width: 160px;
  border: 2px solid var(--border);
  border-radius: 0;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

.status-pill.connected {
  border-color: var(--border);
  background: var(--signal);
  color: var(--text);
}

.status-pill.error {
  border-color: var(--border);
  background: #ffd9cf;
  color: var(--danger);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 0;
}

.hidden {
  display: none !important;
}

.app-shell {
  padding-top: 18px;
}

.app-shell,
.auth-gate {
  position: relative;
}

.app-nav {
  display: flex;
  gap: 0;
  border: 2px solid var(--border);
  margin-bottom: 16px;
  background: var(--surface-2);
}

.nav-tab {
  min-height: 42px;
  border: 0;
  border-right: 2px solid var(--border);
  padding: 0 16px;
  background: transparent;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.nav-tab:last-child {
  border-right: 0;
}

.nav-tab.active {
  background: var(--border);
  color: var(--surface);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  border-radius: 0;
  padding: 0 14px;
  color: var(--text);
  background: var(--surface);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.button:hover {
  transform: translate(-1px, -1px);
}

.button.primary {
  background: var(--accent);
  color: var(--text);
}

.button.primary:hover {
  background: var(--signal);
}

.button.subtle {
  background: var(--surface-2);
}

.button.danger {
  color: var(--danger);
}

.button.danger:hover {
  background: #ffd9cf;
}

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

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

.panel-form,
.panel-block,
.send-card,
.summary-panel {
  border: 2px solid var(--border);
  border-radius: 0;
  padding: 16px;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    var(--surface);
  background-size: 24px 24px;
}

.auth-gate,
.panel-block,
.send-card,
.summary-panel {
  margin-bottom: 14px;
}

.auth-screen,
.onboarding-screen {
  display: none;
}

.auth-screen.active,
.onboarding-screen.active {
  display: block;
  animation: liftIn 220ms ease both;
}

.auth-screen.active {
  border: 2px solid var(--border);
  border-radius: 0;
  padding: 22px;
  background: var(--surface);
}

.auth-copy {
  margin-bottom: 18px;
}

.auth-copy h2 {
  margin-bottom: 8px;
  font-size: 1.55rem;
}

.auth-copy p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 700;
}

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

.onboarding-screen {
  border: 2px solid var(--border);
  border-radius: 0;
  padding: 22px;
  background: var(--surface);
}

.onboarding-progress {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.progress-dot {
  width: 38px;
  height: 5px;
  border-radius: 0;
  background: var(--surface-2);
}

.progress-dot.active {
  background: var(--accent);
}

.onboarding-step {
  display: none;
}

.onboarding-step.active {
  display: block;
  animation: slideIn 220ms ease both;
}

.onboarding-step h2 {
  margin-bottom: 16px;
  font-size: 1.45rem;
}

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

.step-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.inline-auth-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  border: 2px solid var(--border);
  border-radius: 0;
  padding: 10px;
  background: #ffd9cf;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 800;
}

.connection-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.connection-cards article,
.connection-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 2px solid var(--border);
  border-radius: 0;
  padding: 16px;
  background: var(--surface);
}

.connection-cards h3,
.connection-panel h2 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.connection-cards p,
.connection-panel p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.panel-form .panel-header,
.panel-block .panel-header,
.send-card .panel-header {
  border-bottom: 0;
  padding: 0 0 12px;
}

.send-card label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

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

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  gap: 16px;
}

.connections-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.summary-panel {
  background: var(--surface);
}

.brief-preview {
  display: grid;
  gap: 0;
  padding: 18px 0;
}

.brief-preview section {
  border: 2px solid var(--border);
  border-bottom: 0;
  border-radius: 0;
  padding: 16px;
  background: rgba(241, 239, 231, 0.86);
}

.brief-preview section:last-child {
  border-bottom: 2px solid var(--border);
}

.brief-preview h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0;
}

.brief-preview section:first-child h3 {
  color: var(--accent);
}

.brief-preview p {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.55;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 2px solid var(--border);
  border-left: 2px solid var(--border);
  padding-top: 14px;
}

.metric-row div {
  display: grid;
  gap: 2px;
  border-right: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
  border-radius: 0;
  padding: 10px;
  background: var(--surface-2);
}

.metric-row strong {
  font-size: 1.45rem;
  font-weight: 900;
}

.metric-row span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

.full-button {
  width: 100%;
  margin-top: 10px;
}

.canvas-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto auto;
  gap: 10px;
}

.auth-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(150px, 1fr) auto auto auto;
  gap: 10px;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 120px minmax(180px, 1fr) auto auto;
  gap: 10px;
}

.check-control {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--border);
  border-radius: 0;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
}

.check-control input {
  width: auto;
  min-height: 0;
}

input {
  width: 100%;
  min-height: 42px;
  border: 2px solid var(--border);
  border-radius: 0;
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
}

input:focus {
  border-color: var(--accent);
  box-shadow: 3px 3px 0 var(--border);
  outline: none;
}

.message {
  min-height: 24px;
  margin: 14px 0;
  color: var(--muted);
  font-weight: 800;
}

.message.error {
  color: var(--danger);
}

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

.panel {
  min-width: 0;
  border: 2px solid var(--border);
  border-radius: 0;
  background: var(--surface);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2px solid var(--border);
  padding: 14px 16px;
}

.panel-header span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.summary-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.ai-status {
  border: 2px solid var(--border);
  border-radius: 0;
  padding: 4px 8px;
  background: var(--surface-2);
  color: var(--text);
}

.ai-status.active {
  border-color: var(--border);
  background: var(--signal);
  color: var(--text);
}

.ai-status.warning {
  border-color: var(--border);
  background: #ffd9cf;
  color: var(--danger);
}

.item-list {
  display: grid;
  gap: 0;
  max-height: 540px;
  overflow: auto;
}

.item {
  display: grid;
  gap: 5px;
  border-bottom: 2px solid var(--soft-border);
  padding: 14px 16px;
}

.item:last-child {
  border-bottom: 0;
}

.item-title {
  margin: 0;
  font-weight: 800;
  line-height: 1.3;
}

.item-meta,
.item-snippet {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.empty {
  padding: 18px 16px;
  color: var(--muted);
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(28, 32, 33, 0.62);
  backdrop-filter: grayscale(1) brightness(0.7);
  animation: fadeIn 160ms ease both;
}

.modal-card {
  width: min(840px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  border: 2px solid var(--border);
  border-radius: 0;
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: liftIn 180ms ease both;
}

.modal-fields {
  display: grid;
  gap: 10px;
}

.modal-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.45;
}

.canvas-howto {
  margin-top: 16px;
  border-top: 2px solid var(--border);
  padding-top: 16px;
}

.canvas-howto h3 {
  margin: 0 0 10px;
  font-size: 0.92rem;
}

.howto-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
  gap: 12px;
}

.howto-grid figure {
  min-width: 0;
  margin: 0;
}

.howto-grid img {
  display: block;
  width: 100%;
  height: auto;
  border: 2px solid var(--border);
  border-radius: 0;
  background: #ffffff;
  filter: grayscale(1) contrast(1.06);
}

.howto-grid figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.35;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 2px solid var(--border);
  border-radius: 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding: 10px 0;
  }

  .workspace {
    padding: 16px;
    box-shadow: 4px 4px 0 rgba(28, 32, 33, 0.92);
  }

  .topbar,
  .send-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .status-pill {
    width: 100%;
  }

  .send-row,
  .waitlist-row,
  .dashboard-grid,
  .connections-grid,
  .settings-grid,
  .connection-cards,
  .step-row,
  .canvas-row,
  .auth-row,
  .settings-row,
  .step-actions,
  .howto-grid,
  .preview-grid {
    grid-template-columns: 1fr;
  }

  .step-actions,
  .inline-auth-cta {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .waitlist-shell {
    align-items: start;
    width: min(100% - 20px, 440px);
  }

  .landing-shell {
    align-items: start;
    width: min(100% - 20px, 560px);
  }

  .beta-admin-form {
    grid-template-columns: 1fr;
  }

  .waitlist-row input {
    border-right: 2px solid var(--border);
    border-bottom: 0;
  }

  .connection-cards article,
  .connection-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .app-nav {
    overflow-x: auto;
  }

  .nav-tab {
    min-width: max-content;
  }
}
