:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #edf1f2;
  color: #152126;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
}

.app {
  background:
    radial-gradient(circle at 8% 8%, rgba(23, 92, 76, 0.16), transparent 30%),
    radial-gradient(circle at 92% 12%, rgba(190, 145, 73, 0.14), transparent 28%),
    #edf1f2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.topbar,
#workspace,
.notice {
  width: min(1380px, 100%);
  margin: 0 auto;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(190, 199, 204, 0.8);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 10px 28px rgba(20, 35, 42, 0.08);
  display: flex;
  flex: 0 0 auto;
  gap: 16px;
  justify-content: space-between;
  padding: 14px 20px;
}

.brand-block h1,
h1,
h2,
p {
  margin: 0;
}

.brand-block h1 {
  font-size: 22px;
  font-weight: 750;
  letter-spacing: 0;
}

#state {
  color: #607079;
  font-size: 13px;
  margin-top: 2px;
}

nav {
  align-items: center;
  display: flex;
  gap: 10px;
}

.language-control {
  align-items: center;
  color: #52616b;
  display: flex;
  font-size: 13px;
  gap: 8px;
}

select,
textarea {
  background: #fff;
  border: 1px solid #b8c4ca;
  border-radius: 6px;
  color: #152126;
  font: inherit;
}

select {
  padding: 9px 10px;
}

a,
button {
  background: #175c4c;
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  padding: 10px 14px;
  text-decoration: none;
}

button:hover,
a:hover {
  background: #124b3f;
}

.login-gate {
  align-items: center;
  background:
    linear-gradient(90deg, rgba(4, 11, 13, 0.92) 0%, rgba(4, 11, 13, 0.72) 42%, rgba(4, 11, 13, 0.18) 100%),
    url("/static/login-splash.png") center / cover no-repeat;
  display: flex;
  min-height: 100vh;
  padding: 32px;
}

.splash-copy {
  color: #f6fbfb;
  margin-left: clamp(0px, 7vw, 96px);
  max-width: 520px;
}

.splash-copy .eyebrow {
  color: #91d8cc;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.splash-copy h1 {
  font-size: clamp(36px, 5vw, 68px);
  line-height: 1;
  margin-bottom: 28px;
}

.splash-copy a {
  background: #f6fbfb;
  color: #0d2527;
  display: inline-block;
  font-weight: 700;
  padding: 13px 18px;
}

.notice {
  border-radius: 6px;
  margin-top: 18px;
  padding: 14px;
}

.danger {
  background: #ffe8e8;
  border: 1px solid #e5a1a1;
}

#workspace {
  display: grid;
  flex: 1 1 auto;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  min-height: 0;
  overflow: hidden;
  padding: 18px;
}

.chat-panel,
.tasks {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(190, 199, 204, 0.82);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(20, 35, 42, 0.08);
  min-height: 0;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.chat-toolbar {
  align-items: center;
  border-bottom: 1px solid #d8dee4;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 16px;
}

.chat-toolbar h2 {
  font-size: 18px;
  margin-bottom: 3px;
}

.chat-toolbar p {
  color: #66727a;
  font-size: 13px;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px;
  scroll-behavior: smooth;
}

.messages:empty::before {
  align-self: center;
  color: #74828a;
  content: "Start a conversation";
  margin: auto;
}

.message {
  border-radius: 8px;
  line-height: 1.5;
  max-width: min(820px, 86%);
  padding: 12px 14px;
  white-space: pre-wrap;
}

.user {
  align-self: flex-end;
  background: #dcece8;
  border: 1px solid #bddbd3;
  color: #102d27;
}

.assistant {
  align-self: flex-start;
  background: #f4f6f7;
  border: 1px solid #dfe5e8;
  color: #19282f;
}

.usage {
  align-self: flex-start;
  color: #66727a;
  font-size: 12px;
  margin-top: -8px;
  min-height: 16px;
}

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

#chatForm {
  background: #fff;
  border-top: 1px solid #d8dee4;
  padding: 14px;
}

textarea {
  min-height: 44px;
  min-width: 0;
  padding: 11px 12px;
  resize: vertical;
}

#chatForm textarea {
  max-height: 150px;
  resize: none;
}

.tasks {
  display: grid;
  gap: 14px;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  padding: 16px;
}

.panel-heading h2 {
  font-size: 18px;
  margin-bottom: 3px;
}

.panel-heading p {
  color: #66727a;
  font-size: 13px;
}

.tasks .composer {
  grid-template-columns: 1fr;
}

.tasks .composer button {
  justify-self: start;
}

#commands {
  overflow-y: auto;
}

.command {
  border-top: 1px solid #d8dee4;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px 0;
}

code,
pre {
  background: #11181f;
  border-radius: 6px;
  color: #eef6f6;
  overflow-x: auto;
  padding: 10px;
}

pre {
  min-height: 110px;
  margin: 0;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .app {
    min-height: 100vh;
  }

  .topbar {
    align-items: flex-start;
    border-radius: 0;
    flex-direction: column;
  }

  nav {
    flex-wrap: wrap;
  }

  #workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(58vh, 1fr) minmax(260px, auto);
    overflow: visible;
    padding: 12px;
  }

  .chat-panel {
    min-height: 58vh;
  }

  .tasks {
    max-height: none;
  }

  .composer,
  .command {
    grid-template-columns: 1fr;
  }

  .message {
    max-width: 94%;
  }

  .login-gate {
    background:
      linear-gradient(180deg, rgba(4, 11, 13, 0.92) 0%, rgba(4, 11, 13, 0.74) 58%, rgba(4, 11, 13, 0.34) 100%),
      url("/static/login-splash.png") center / cover no-repeat;
    padding: 24px;
  }

  .splash-copy {
    margin: 0;
  }
}
