:root {
  color-scheme: dark;
  font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #090a12;
  --panel: #121521;
  --panel-2: #181c2b;
  --line: #2a3044;
  --text: #f5f5f7;
  --muted: #aeb4c5;
  --accent: #f18136;
  --accent-hover: #ff9854;
  --violet: #7567ff;
  --success: #75d99f;
  --warning: #ffc46b;
  --danger: #ff9189;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 80% 0%, rgba(97, 74, 234, .22), transparent 34rem),
    radial-gradient(circle at 8% 35%, rgba(241, 129, 54, .08), transparent 28rem),
    var(--bg);
  color: var(--text);
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 10;
  padding: .75rem 1rem;
  border-radius: .6rem;
  background: var(--text);
  color: var(--bg);
}
.skip-link:focus { top: 1rem; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  padding: 1rem clamp(1.25rem, 5vw, 5rem);
  border-bottom: 1px solid rgba(117, 103, 255, .45);
  background: rgba(9, 10, 18, .78);
  backdrop-filter: blur(18px);
}
header > div { display: grid; gap: .1rem; }
.brand, .eyebrow {
  color: var(--accent);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .18em;
}
header strong { font-size: 1.05rem; }

main {
  width: min(1160px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2rem, 7vw, 6rem) 0;
}

.hero {
  width: min(780px, 100%);
  padding: clamp(2rem, 6vw, 5rem);
  border: 1px solid var(--line);
  border-radius: 1.6rem;
  background: linear-gradient(145deg, rgba(24, 28, 43, .96), rgba(14, 18, 28, .96));
  box-shadow: 0 30px 90px rgba(0, 0, 0, .34);
}
h1, h2, p { margin-top: 0; }
h1 {
  max-width: 14ch;
  margin-bottom: 1rem;
  font-size: clamp(2.6rem, 8vw, 5.8rem);
  line-height: .98;
  letter-spacing: -.055em;
}
h2 { line-height: 1.15; letter-spacing: -.025em; }
p { color: var(--muted); }
.lede { max-width: 620px; font-size: 1.18rem; }
.meta { margin-top: 1rem; font-size: .9rem; }

button, a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: .75rem 1.1rem;
  border: 0;
  border-radius: .7rem;
  background: var(--accent);
  color: #140b05;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
button:hover:not(:disabled), a.button:hover { background: var(--accent-hover); }
button:disabled { cursor: not-allowed; opacity: .45; }
button.quiet {
  min-height: 40px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}
button.quiet:hover { border-color: #59627d; background: var(--panel-2); }
button:focus-visible, a:focus-visible, select:focus-visible,
input:focus-visible, textarea:focus-visible, audio:focus-visible {
  outline: 3px solid #a9a0ff;
  outline-offset: 3px;
}

.invitation {
  margin: 1.5rem 0;
  padding: 1.25rem;
  border: 1px solid rgba(117, 103, 255, .65);
  border-radius: 1rem;
  background: rgba(117, 103, 255, .09);
}
.invitation h2 { margin-bottom: .4rem; }

.login-options {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.login-options h2 { margin-bottom: .35rem; font-size: 1.35rem; }
.login-options p { margin-bottom: 0; }
.login-options button { width: fit-content; }
.login-alternative {
  max-width: 620px;
  font-size: .92rem;
}
.login-alternative strong { color: var(--text); }
.login-alternative span { color: #c4beff; font-weight: 750; }

.welcome {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: end;
  gap: 2rem;
  margin-bottom: 2rem;
}
.welcome h1 {
  max-width: none;
  margin-bottom: .75rem;
  font-size: clamp(2.5rem, 6vw, 4.8rem);
}
.welcome p:not(.eyebrow) { max-width: 680px; margin-bottom: 0; }
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
}
.steps span {
  display: grid;
  gap: .4rem;
  color: var(--muted);
  font-size: .82rem;
}
.steps b { color: inherit; font-weight: 650; }
.steps strong {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
}

.notice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .35rem 1rem;
  margin-bottom: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid #39425d;
  border-radius: .9rem;
  background: rgba(29, 34, 53, .9);
}
.notice strong { color: var(--text); }
.notice span { color: var(--muted); }
.notice.warning { border-color: rgba(255, 196, 107, .45); }
.profile-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(241, 129, 54, .38);
  border-radius: 1rem;
  background: linear-gradient(145deg, rgba(241, 129, 54, .11), rgba(24, 28, 43, .9));
  padding: 1rem 1.15rem;
}
.profile-symbol { display: grid; width: 2.8rem; height: 2.8rem; place-items: center; border-radius: .8rem; background: rgba(241, 129, 54, .14); color: var(--accent-hover); font-weight: 850; }
.profile-symbol svg { width: 1.45rem; height: 1.45rem; fill: currentColor; }
.profile-banner p { margin-bottom: .2rem; }
.profile-banner strong { display: block; margin-bottom: .15rem; }
.profile-banner > div > span { color: var(--muted); font-size: .88rem; }
.profile-badge { border-radius: 999px; background: rgba(117, 103, 255, .15); color: #c2bcff; padding: .35rem .65rem; font-size: .76rem; font-weight: 800; }

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

@media (max-width: 620px) {
  .profile-banner { grid-template-columns: auto minmax(0, 1fr); }
  .profile-badge { grid-column: 2; width: fit-content; }
}
.area-card {
  display: flex;
  min-height: 330px;
  flex-direction: column;
  padding: clamp(1.25rem, 3vw, 1.8rem);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background:
    linear-gradient(145deg, rgba(26, 30, 47, .97), rgba(16, 19, 30, .97));
  box-shadow: 0 18px 45px rgba(0, 0, 0, .17);
}
.area-card-top, .area-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.category {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.state {
  padding: .28rem .58rem;
  border-radius: 99px;
  background: #2a3041;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
}
.state.ready, .state.approved { background: rgba(117, 217, 159, .13); color: var(--success); }
.state.working { background: rgba(117, 103, 255, .16); color: #b7b0ff; }
.state.review { background: rgba(241, 129, 54, .14); color: #ffb47f; }
.state.attention { background: rgba(255, 145, 137, .12); color: var(--danger); }
.area-card h2 { margin: 2rem 0 .65rem; font-size: clamp(1.7rem, 3vw, 2.35rem); }
.area-card > p { max-width: 58ch; }
.state-detail { margin-top: auto; color: #d8dbe4; font-size: .92rem; }
.area-card-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.area-card-footer > span { color: var(--muted); font-size: .8rem; }
.area-card-footer button { flex: 0 0 auto; }
.area-card-footer .no-action {
  color: var(--success);
  font-size: .9rem;
  font-weight: 750;
}

.empty {
  grid-column: 1 / -1;
  padding: 3rem;
  border: 1px dashed #3b435d;
  border-radius: 1.2rem;
  text-align: center;
}
.empty h2 { margin-bottom: .5rem; }

.guide, .audition {
  margin-top: 1.25rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid rgba(117, 103, 255, .5);
  border-radius: 1.2rem;
  background: rgba(18, 21, 33, .94);
}

.managed-workspace {
  margin-top: 1.25rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid rgba(241, 129, 54, .5);
  border-radius: 1.2rem;
  background: rgba(18, 21, 33, .97);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .24);
}
.managed-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}
.managed-heading h2 { margin: .3rem 0 .5rem; font-size: clamp(1.7rem, 4vw, 2.6rem); }
.managed-heading p:last-child { max-width: 720px; }
.managed-conversation {
  display: grid;
  gap: .8rem;
  max-height: 440px;
  overflow-y: auto;
  margin: 1.25rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #0b0e17;
}
.assistant-message, .partner-message {
  width: min(78%, 720px);
  padding: .9rem 1rem;
  border-radius: .9rem;
  line-height: 1.5;
}
.assistant-message {
  justify-self: start;
  border: 1px solid #303850;
  background: #171c2b;
  color: #e4e6ee;
}
.assistant-message p { margin: .35rem 0 0; }
.assistant-message small { display: block; margin-top: .35rem; color: var(--muted); }
.partner-message {
  justify-self: end;
  background: rgba(241, 129, 54, .16);
  color: #fff3eb;
}
.managed-form { display: grid; gap: .65rem; }
.managed-form label { color: var(--text); font-weight: 750; }
.managed-form textarea { min-height: 120px; }
.managed-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.managed-actions .quiet { border: 1px solid var(--line); color: var(--text); }
.extension-card { border-color: rgba(117, 103, 255, .45); }
.guide {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2rem;
}
.guide h2 span { color: #b9b3ff; }
.guide ol {
  display: grid;
  gap: .75rem;
  margin: 0;
  padding-left: 1.35rem;
  color: var(--muted);
}
.connection-setup {
  grid-column: 1 / -1;
  display: grid;
  gap: .75rem;
  padding: 1.15rem;
  border: 1px solid rgba(145, 228, 176, .48);
  border-radius: 1rem;
  background: rgba(145, 228, 176, .08);
}
.connection-setup h3, .connection-setup p { margin: 0; }
.connection-setup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
.connection-setup-grid > div {
  display: grid;
  gap: .4rem;
  padding: .9rem;
  border-radius: .85rem;
  background: rgba(255, 255, 255, .04);
}
.connection-setup-grid strong { color: var(--text); }
.connection-setup code {
  color: var(--success);
  font: inherit;
  font-weight: 800;
}
.codex-handoff {
  grid-column: 1 / -1;
  display: grid;
  gap: .65rem;
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #0b0e17;
}

.workspace-reopen-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 16px 18px;
  border: 1px solid rgba(167, 153, 255, 0.28);
  border-radius: 14px;
  background: rgba(104, 88, 196, 0.09);
  color: var(--muted);
  line-height: 1.55;
}

.workspace-reopen-note strong {
  color: var(--text);
}
.codex-handoff h3, .codex-handoff p { margin: 0; }
.codex-handoff label { color: var(--text); font-weight: 750; }
.codex-handoff textarea {
  min-height: 190px;
  padding: .9rem;
  border: 1px solid #303850;
  border-radius: .8rem;
  background: #111625;
  color: #f5f6fb;
  font: 500 .92rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  resize: vertical;
}
.codex-handoff-actions {
  display: flex;
  align-items: center;
  gap: .8rem;
}
.codex-handoff-actions span { color: var(--muted); }

.audition-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.audition-grid label, #feedback-form label {
  display: grid;
  gap: .45rem;
  color: var(--muted);
}
audio, select, input, textarea { width: 100%; }
#feedback-form {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
}
#feedback-form label:last-of-type { grid-column: 1 / -1; }
select, input, textarea {
  min-height: 44px;
  padding: .7rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: #0d101a;
  color: var(--text);
  font: inherit;
}
textarea { min-height: 96px; resize: vertical; }

#message { min-height: 1.5rem; margin: 1rem 0 0; }
.error { color: var(--danger); }
.success { color: var(--success); }
.hidden { display: none !important; }

@media (max-width: 800px) {
  .welcome, .guide { grid-template-columns: 1fr; }
  .connection-setup-grid { grid-template-columns: 1fr; }
  .area-grid { grid-template-columns: 1fr; }
  .area-card { min-height: 300px; }
}
@media (max-width: 560px) {
  header { min-height: 70px; padding-inline: 1rem; }
  main { width: min(100% - 1.25rem, 1160px); padding-top: 2rem; }
  .hero { padding: 1.5rem; }
  .steps { grid-template-columns: 1fr; }
  .steps span { grid-template-columns: 2rem 1fr; align-items: center; }
  .notice { grid-template-columns: 1fr; }
  .area-card-footer { align-items: stretch; flex-direction: column; }
  .area-card-footer button { width: 100%; }
  .audition-grid, #feedback-form { grid-template-columns: 1fr; }
  #feedback-form label:last-of-type { grid-column: auto; }
  .managed-heading, .managed-actions { align-items: stretch; flex-direction: column; }
  .managed-actions button { width: 100%; }
  .assistant-message, .partner-message { width: 92%; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
