:root {
  color-scheme: dark;
  --bg: #050505;
  --surface: #151513;
  --surface-strong: #22211e;
  --surface-soft: #2b2925;
  --line: #37342e;
  --line-strong: #555044;
  --text: #f5f1e8;
  --muted: #aaa79d;
  --mint: #7bd8b0;
  --amber: #f0b75a;
  --coral: #ff766e;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

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

body {
  background: linear-gradient(180deg, #050505 0%, #080807 48%, #11100e 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  min-height: 100svh;
}

.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 16px 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 5, 5, 0.92);
}

.rail-logo,
.profile-button,
.icon-button,
.send-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.rail-logo {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  text-decoration: none;
  background: linear-gradient(135deg, rgba(123, 216, 176, 0.2), rgba(240, 183, 90, 0.18));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  font-size: 13px;
  font-weight: 800;
}

.rail-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.icon-button svg,
.send-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon-button:hover,
.icon-button:focus-visible,
.icon-button.is-active {
  border-color: var(--line);
  background: var(--surface-strong);
  color: var(--text);
}

.icon-button:focus-visible,
.send-button:focus-visible,
.ghost-button:focus-visible,
.template-card:focus-visible,
.profile-button:focus-visible,
.send-text-button:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}

.icon-button.compact {
  width: 38px;
  height: 38px;
}

.profile-button {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(123, 216, 176, 0.45);
  border-radius: 50%;
  background: rgba(123, 216, 176, 0.14);
  color: var(--mint);
  font-size: 12px;
  font-weight: 800;
}

.profile-link {
  text-decoration: none;
}

.stage {
  display: flex;
  min-width: 0;
  min-height: 100svh;
  flex-direction: column;
  padding: 18px 28px 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  gap: 16px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--mint);
  border-radius: 5px;
  box-shadow: 9px 6px 0 -5px var(--amber), -6px 8px 0 -5px var(--coral);
}

.top-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.top-actions form {
  margin: 0;
}

.ghost-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 15px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.primary-link {
  border-color: rgba(123, 216, 176, 0.45);
  background: rgba(123, 216, 176, 0.12);
  color: var(--mint);
}

.ghost-button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
}

.builder {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  width: min(1060px, 100%);
  margin: 0 auto;
  padding: 36px 0 12px;
}

.builder-core {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  border: 1px solid rgba(123, 216, 176, 0.32);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--mint);
  background: rgba(123, 216, 176, 0.08);
  font-size: 13px;
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
}

h1 {
  margin: 18px 0 28px;
  text-align: center;
  color: var(--text);
  font-size: 34px;
  font-weight: 760;
  line-height: 1.12;
}

.chat-log {
  display: grid;
  width: min(820px, 100%);
  min-height: 74px;
  max-height: 210px;
  gap: 12px;
  margin-bottom: 14px;
  overflow: auto;
}

.chat-log:not(.has-messages) {
  display: none;
}

.message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(240, 183, 90, 0.16);
  color: var(--amber);
  font-size: 11px;
  font-weight: 850;
}

.message p {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.user-message {
  grid-template-columns: minmax(0, 1fr) 34px;
}

.user-message .avatar {
  grid-column: 2;
  grid-row: 1;
  background: rgba(123, 216, 176, 0.16);
  color: var(--mint);
}

.user-message p {
  grid-column: 1;
  grid-row: 1;
  background: rgba(123, 216, 176, 0.08);
  color: var(--text);
}

.composer {
  width: min(960px, 100%);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.input-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px 4px;
}

textarea {
  width: 100%;
  min-height: 48px;
  max-height: 180px;
  resize: none;
  border: 0;
  outline: 0;
  padding: 11px 2px;
  background: transparent;
  color: var(--text);
  line-height: 1.45;
}

textarea::placeholder {
  color: #8d8b84;
}

.composer-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 10px 10px;
}

.send-button {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--text);
  color: #11100e;
  transition: transform 150ms ease, background 150ms ease;
}

.send-button:hover {
  background: var(--mint);
  transform: translateY(-1px);
}

.template-dock {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: min(900px, 100%);
  margin: 34px auto 0;
}

.template-card {
  display: grid;
  min-height: 104px;
  align-content: start;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-align: left;
}

.template-card:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.065);
}

.template-card.is-selected {
  border-color: rgba(123, 216, 176, 0.82);
  background: rgba(123, 216, 176, 0.1);
}

.template-card span {
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.template-card strong {
  font-size: 16px;
  line-height: 1.2;
}

.template-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.flash-stack {
  display: grid;
  gap: 8px;
  width: min(900px, 100%);
  margin: 8px auto 0;
}

.flash-message {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
}

.flash-message.success {
  border-color: rgba(123, 216, 176, 0.36);
  color: var(--mint);
}

.flash-message.warning,
.form-error {
  border-color: rgba(240, 183, 90, 0.42);
  color: var(--amber);
}

.auth-panel,
.workspace-panel,
.project-detail {
  width: min(900px, 100%);
  margin: 46px auto 0;
}

.chat-project-detail {
  display: grid;
  align-content: start;
  width: min(960px, 100%);
  min-height: calc(100svh - 120px);
  margin-top: 26px;
  padding-bottom: 28px;
}

.chat-project-title {
  display: grid;
  gap: 8px;
  margin: 42px 0 34px;
}

.chat-project-title span {
  color: var(--muted);
  font-size: 13px;
}

.chat-project-title h1 {
  width: min(720px, 100%);
  margin: 0;
  color: var(--text);
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.05;
}

.chat-session {
  display: grid;
  gap: 18px;
  width: min(960px, 100%);
}

.chat-job-list {
  gap: 28px;
}

.chat-empty-state {
  width: min(560px, 100%);
}

.auth-panel {
  display: grid;
  gap: 18px;
}

.auth-panel h1,
.project-hero h1 {
  margin: 0;
  text-align: left;
}

.auth-panel p,
.auth-switch,
.project-copy,
.project-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.metadata-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.metadata-list div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.metadata-list dt {
  margin: 0 0 6px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.metadata-list dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.muted-inline {
  color: var(--muted);
}

.codex-thread {
  display: grid;
  gap: 5px;
}

.codex-thread a,
.codex-thread code {
  color: var(--mint);
  font-family: inherit;
  font-weight: 800;
}

.codex-thread small {
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 14px;
  width: min(430px, 100%);
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-form input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: var(--surface);
  color: var(--text);
}

.auth-form input:focus {
  border-color: rgba(123, 216, 176, 0.72);
  outline: 0;
}

.send-text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: var(--text);
  color: #11100e;
  font-weight: 800;
  text-decoration: none;
}

.preview-button {
  justify-self: start;
}

.job-form {
  display: grid;
  gap: 12px;
}

.job-form textarea {
  min-height: 108px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.job-form textarea:focus {
  border-color: rgba(123, 216, 176, 0.72);
}

.job-form .send-text-button {
  justify-self: start;
}

.job-list {
  display: grid;
  gap: 10px;
}

.job-row {
  display: grid;
  gap: 14px;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.chat-job-list .job-row + .job-row {
  padding-top: 8px;
}

.job-mini-meta {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.job-mini-meta > span:not(.status-badge),
.job-row small {
  color: var(--muted);
  line-height: 1.35;
}

.user-prompt-bubble {
  justify-self: end;
  max-width: min(520px, 82%);
  border-radius: 999px;
  padding: 13px 19px;
  background: var(--text);
  color: #11100e;
}

.user-prompt-bubble span {
  display: block;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.job-row p {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--mint) !important;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.live-indicator::before {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--mint);
  box-shadow: 0 0 0 0 rgba(123, 216, 176, 0.45);
  content: "";
  animation: live-pulse 1400ms ease-out infinite;
}

@keyframes live-pulse {
  70% {
    box-shadow: 0 0 0 8px rgba(123, 216, 176, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(123, 216, 176, 0);
  }
}

.build-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 2px solid rgba(123, 216, 176, 0.22);
  border-top-color: var(--mint);
  border-radius: 999px;
  animation: build-spin 900ms linear infinite;
}

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

.job-error {
  color: var(--coral);
}

.job-result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: min(720px, 100%);
  margin-left: 44px;
}

.job-result strong {
  flex: 1 1 260px;
  color: var(--text);
  line-height: 1.35;
  font-weight: 700;
}

.job-result .ghost-button {
  min-height: 38px;
  padding: 0 16px;
  font-size: 13px;
}

.job-result-preparing {
  color: var(--muted);
}

.job-chat-output {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  margin-top: 4px;
  width: min(760px, 100%);
}

.job-chat-output.is-building .job-chat-avatar {
  box-shadow: 0 0 0 0 rgba(123, 216, 176, 0.34);
  animation: build-avatar-pulse 1500ms ease-out infinite;
}

@keyframes build-avatar-pulse {
  70% {
    box-shadow: 0 0 0 10px rgba(123, 216, 176, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(123, 216, 176, 0);
  }
}

.job-chat-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(123, 216, 176, 0.34);
  border-radius: 999px;
  background: rgba(123, 216, 176, 0.1);
  color: var(--mint);
  font-size: 11px;
  font-weight: 900;
}

.job-chat-bubble {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 2px 0 0;
}

.job-chat-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.job-chat-meta span {
  color: var(--mint);
  font-size: 12px;
  font-weight: 800;
}

.job-chat-meta .live-indicator {
  font-size: 10px;
}

.build-timer {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.build-timer.is-complete {
  color: rgba(245, 241, 232, 0.72);
}

.job-chat-meta code {
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.job-chat-bubble p {
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
}

.job-advanced-details {
  width: 100%;
  margin: 0;
  border: 0;
  padding-top: 0;
}

.job-advanced-details summary {
  width: fit-content;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.job-advanced-details[open] summary {
  color: var(--mint);
}

.job-advanced-body {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.technical-job-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.technical-job-list h2 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.older-job-details {
  width: min(760px, 100%);
}

.older-job-details summary {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

.older-job-details[open] {
  display: grid;
  gap: 12px;
}

.followup-composer {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 42px;
  align-items: end;
  gap: 8px;
  width: min(720px, 100%);
  margin: min(10vh, 80px) auto 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 10px;
  background: #232321;
  box-shadow: var(--shadow);
}

.followup-composer textarea {
  max-height: 150px;
  min-height: 38px;
  border: 0;
  padding: 8px 2px;
  resize: none;
  background: transparent;
  color: var(--text);
  outline: 0;
}

.followup-composer textarea::placeholder {
  color: var(--muted);
}

.composer-plus,
.composer-send {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  font-size: 24px;
}

.composer-plus {
  background: transparent;
  color: var(--text);
}

.composer-send {
  background: var(--text);
  color: #11100e;
  font-size: 22px;
}

.project-advanced-details {
  width: min(760px, 100%);
  margin: 18px auto 0;
}

.project-advanced-details summary {
  width: fit-content;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.project-advanced-body {
  display: grid;
  gap: 16px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.codex-bridge-details {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.codex-bridge-details h3,
.codex-turns-details h3 {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.codex-bridge-list {
  display: grid;
  gap: 7px;
  margin: 0;
}

.codex-bridge-list div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
}

.codex-bridge-list dt,
.codex-bridge-list dd {
  margin: 0;
  min-width: 0;
}

.codex-bridge-list dt {
  color: var(--amber);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.codex-bridge-list dd,
.codex-bridge-list code {
  color: var(--text);
  overflow-wrap: anywhere;
}

.codex-turns-details {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.16);
}

.codex-empty {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.codex-turn-list {
  display: grid;
  max-height: 720px;
  margin: 10px 0 0;
  padding: 0;
  gap: 8px;
  overflow: auto;
  list-style: none;
}

.codex-turn-event {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.codex-turn-event.assistant {
  border-color: rgba(123, 216, 176, 0.24);
  background: rgba(123, 216, 176, 0.06);
}

.codex-turn-event.command,
.codex-turn-event.command-started {
  border-color: rgba(240, 183, 90, 0.2);
}

.codex-turn-event.file-change {
  border-color: rgba(112, 162, 255, 0.24);
}

.codex-turn-event.stderr,
.codex-turn-event.failed {
  border-color: rgba(255, 118, 110, 0.28);
  background: rgba(255, 118, 110, 0.045);
}

.codex-event-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.codex-event-head span {
  color: var(--mint);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.codex-event-head small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.codex-turn-event pre {
  max-height: 420px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 9px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.status-badge.pending {
  border-color: rgba(240, 183, 90, 0.42);
  color: var(--amber);
}

.status-badge.running {
  border-color: rgba(123, 216, 176, 0.42);
  color: var(--mint);
}

.status-badge.succeeded {
  border-color: rgba(123, 216, 176, 0.58);
  background: rgba(123, 216, 176, 0.09);
  color: var(--mint);
}

.status-badge.failed,
.status-badge.cancelled {
  border-color: rgba(255, 118, 110, 0.48);
  color: var(--coral);
}

.auth-switch a,
.back-link {
  color: var(--mint);
}

.dashboard-builder {
  flex: 0 0 auto;
  justify-content: start;
  padding-top: 42px;
}

.workspace-panel {
  display: grid;
  gap: 16px;
  margin-top: 34px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: 20px;
}

.section-heading span {
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.empty-state p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.project-card {
  display: grid;
  min-height: 118px;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-decoration: none;
}

.project-card:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.065);
}

.project-card span {
  color: var(--amber);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.project-card strong {
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.project-card small {
  color: var(--muted);
  line-height: 1.35;
}

.project-detail {
  display: grid;
  gap: 22px;
}

.project-hero {
  display: grid;
  gap: 12px;
}

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

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) 66px;
  }

  .rail {
    grid-row: 2;
    flex-direction: row;
    justify-content: space-between;
    padding: 8px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 0;
  }

  .rail-nav {
    flex: 0 1 auto;
    flex-direction: row;
  }

  .stage {
    min-height: calc(100svh - 66px);
    padding: 14px 14px 18px;
  }

  .topbar {
    min-height: 46px;
  }

  .brand-lockup {
    font-size: 13px;
  }

  .top-actions .ghost-button {
    min-height: 36px;
    padding: 0 12px;
  }

  .builder {
    justify-content: start;
    padding-top: 32px;
  }

  h1 {
    margin-bottom: 20px;
    font-size: 27px;
  }

  .chat-log {
    max-height: 190px;
  }

  .composer {
    border-radius: 24px;
  }

  .chat-project-detail {
    min-height: calc(100svh - 112px);
    margin-top: 12px;
  }

  .chat-project-title {
    margin: 22px 0 20px;
  }

  .chat-project-title h1 {
    font-size: 30px;
  }

  .user-prompt-bubble {
    max-width: 94%;
    border-radius: 24px;
  }

  .job-chat-output {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .job-result {
    margin-left: 40px;
  }

  .job-chat-avatar {
    width: 30px;
    height: 30px;
  }

  .followup-composer {
    grid-template-columns: 34px minmax(0, 1fr) 38px;
    margin-top: 34px;
    border-radius: 24px;
    padding: 8px;
  }

  .composer-plus,
  .composer-send {
    width: 34px;
    height: 34px;
  }

  .template-dock {
    grid-template-columns: 1fr;
    margin-top: 24px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .metadata-list {
    grid-template-columns: 1fr;
  }

  .codex-bridge-list div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

@media (max-width: 460px) {
  .rail-logo,
  .profile-button {
    width: 36px;
    height: 36px;
  }

  .rail-nav {
    gap: 4px;
  }

  .icon-button {
    width: 39px;
    height: 39px;
  }

  .input-row {
    gap: 6px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .send-button {
    align-self: flex-end;
  }
}

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