:root {
  --bg: #0c1110;
  --bg-elevated: #111816;
  --panel: #151d1a;
  --panel-soft: #1a2420;
  --line: rgba(206, 239, 222, 0.11);
  --line-strong: rgba(206, 239, 222, 0.2);
  --text: #e8f0eb;
  --muted: #8c9c94;
  --faint: #617168;
  --accent: #a8ffcd;
  --accent-strong: #76e9ab;
  --accent-ink: #0c1a12;
  --danger: #ff9c96;
  --danger-soft: rgba(255, 111, 102, 0.12);
  --warning: #ffd28a;
  --warning-soft: rgba(255, 196, 92, 0.11);
  --blue: #a8cbff;
  --radius: 22px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
}

body {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 9% 3%, rgba(67, 134, 102, 0.13), transparent 29rem),
    radial-gradient(circle at 94% 90%, rgba(78, 108, 95, 0.1), transparent 31rem),
    var(--bg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
  touch-action: manipulation;
}

button,
select {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

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

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.19em;
}

.brand-mark {
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(168, 255, 205, 0.35);
  border-radius: 50%;
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.brand-mark::before {
  inset: 10px;
  background: var(--accent);
}

.brand-mark::after {
  inset: 18px;
  z-index: 2;
  background: var(--bg);
}

.brand-mark span:first-child {
  top: 50%;
  left: -5px;
  width: 54px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.brand-mark span:last-child {
  top: -5px;
  left: 50%;
  width: 1px;
  height: 54px;
  background: linear-gradient(transparent, var(--accent), transparent);
}

.brand-mark.small {
  width: 28px;
  height: 28px;
}

.brand-mark.small::before {
  inset: 7px;
}

.brand-mark.small::after {
  inset: 12px;
}

.brand-mark.small span:first-child {
  left: -3px;
  width: 34px;
}

.brand-mark.small span:last-child {
  top: -3px;
  height: 34px;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  background:
    linear-gradient(145deg, rgba(14, 22, 19, 0.92), rgba(8, 13, 11, 0.98)),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(168, 255, 205, 0.03) 40px);
}

.auth-orbit {
  position: fixed;
  border: 1px solid rgba(168, 255, 205, 0.07);
  border-radius: 50%;
  pointer-events: none;
}

.auth-orbit-a {
  top: -24vmax;
  right: -13vmax;
  width: 54vmax;
  height: 54vmax;
}

.auth-orbit-b {
  bottom: -34vmax;
  left: -24vmax;
  width: 66vmax;
  height: 66vmax;
}

.auth-card {
  position: relative;
  width: min(100%, 420px);
  padding: 2.25rem;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 30px;
  background: rgba(17, 24, 22, 0.9);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(24px);
}

.auth-card::after {
  position: absolute;
  right: -80px;
  bottom: -90px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(92, 240, 160, 0.12), transparent 69%);
  content: "";
  pointer-events: none;
}

.auth-card h1 {
  margin: 0.7rem 0 0.35rem;
  font-size: clamp(2.7rem, 8vw, 4.2rem);
  font-weight: 680;
  letter-spacing: -0.07em;
  line-height: 1;
}

.auth-card > .muted {
  margin: 0 0 2rem;
}

.auth-form {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.52rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  outline: none;
  background: rgba(7, 12, 10, 0.68);
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

input,
select {
  min-height: 49px;
  padding: 0 0.9rem;
  border-radius: 13px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(168, 255, 205, 0.46);
  background: rgba(7, 12, 10, 0.92);
  box-shadow: 0 0 0 3px rgba(168, 255, 205, 0.06);
}

select {
  appearance: none;
  padding-right: 2.4rem;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-repeat: no-repeat;
  background-size: 5px 5px;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  padding: 0 1.25rem;
  border-radius: 13px;
  font-weight: 700;
}

.primary-button {
  border: 1px solid var(--accent);
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 8px 30px rgba(113, 255, 180, 0.14);
}

.primary-button:hover {
  background: #baffd8;
}

.primary-button.compact {
  min-height: 42px;
  margin-top: 0.65rem;
  padding: 0 1.1rem;
}

.secondary-button {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--panel-soft);
}

.auth-form .primary-button {
  margin-top: 0.35rem;
}

.hint,
.auth-footnote,
.form-error {
  font-size: 0.74rem;
  line-height: 1.6;
}

.hint,
.auth-footnote {
  color: var(--faint);
}

.auth-footnote {
  position: relative;
  z-index: 1;
  margin: 1.7rem 0 0;
}

.form-error {
  min-height: 1.2rem;
  margin: 0.8rem 0 0;
  color: var(--danger);
}

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

.sidebar {
  position: relative;
  z-index: 8;
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  padding: max(1.2rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  border-right: 1px solid var(--line);
  background: rgba(12, 17, 16, 0.82);
  backdrop-filter: blur(18px);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 0.45rem;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.68rem;
  font-size: 1.22rem;
  font-weight: 720;
  letter-spacing: -0.04em;
}

.new-chat-button {
  display: flex;
  min-height: 47px;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--panel);
  font-weight: 680;
}

.new-chat-button span {
  color: var(--accent);
  font-size: 1.2rem;
  font-weight: 400;
}

.new-chat-button:hover {
  border-color: rgba(168, 255, 205, 0.32);
  background: var(--panel-soft);
}

.sidebar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.55rem 0 0.6rem;
  padding: 0 0.6rem;
  color: var(--faint);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.thread-count {
  min-width: 20px;
  padding: 0.12rem 0.38rem;
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel);
  text-align: center;
  letter-spacing: 0;
}

.thread-list {
  display: grid;
  min-height: 0;
  gap: 0.25rem;
  overflow-y: auto;
}

.thread-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 0.6rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.thread-link:hover {
  background: rgba(255, 255, 255, 0.025);
}

.thread-link.active {
  border-color: var(--line);
  color: var(--text);
  background: var(--panel);
}

.thread-link-main {
  min-width: 0;
}

.thread-link-title {
  overflow: hidden;
  font-size: 0.87rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-link-sub {
  margin-top: 0.22rem;
  overflow: hidden;
  color: var(--faint);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-link-state {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
}

.thread-link-state.running {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(168, 255, 205, 0.08);
  animation: breathe 1.8s ease-in-out infinite;
}

.thread-link-state.waiting {
  background: var(--warning);
}

.thread-link-state.error {
  background: var(--danger);
}

.sidebar-foot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
  align-items: center;
  margin-top: auto;
  padding: 1rem 0.25rem 0;
  border-top: 1px solid var(--line);
}

.sidebar-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.danger-text {
  color: rgba(255, 156, 150, 0.7);
}

.connection-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.48rem;
  color: var(--muted);
  font-size: 0.7rem;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--warning);
}

.status-dot.online {
  background: var(--accent);
}

.status-dot.offline {
  background: var(--danger);
}

.text-button {
  padding: 0.3rem;
  border: 0;
  color: var(--faint);
  background: none;
  font-size: 0.68rem;
}

.text-button:hover {
  color: var(--text);
}

.conversation {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.conversation-head {
  position: relative;
  z-index: 4;
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 0.8rem;
  padding: max(0.8rem, env(safe-area-inset-top)) 1.2rem 0.8rem;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 17, 16, 0.72);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.conversation-title-wrap {
  min-width: 0;
  flex: 1;
}

.conversation-title-wrap h2 {
  margin: 0;
  overflow: hidden;
  font-size: 0.96rem;
  font-weight: 680;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.25rem;
  color: var(--faint);
  font-size: 0.67rem;
}

.history-button {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.62rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.7rem;
}

.history-button:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--panel);
}

.history-button.active {
  border-color: rgba(168, 255, 205, 0.28);
  color: var(--accent);
  background: rgba(168, 255, 205, 0.07);
}

.process-count {
  min-width: 16px;
  padding: 0.06rem 0.26rem;
  border-radius: 999px;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--mono);
  font-size: 0.56rem;
  text-align: center;
}

.history-button.active .process-count {
  color: var(--accent);
  background: rgba(168, 255, 205, 0.1);
}

.history-glyph {
  color: var(--accent);
  font-size: 0.9rem;
}

#project-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  flex: 0 0 auto;
  padding: 0.16rem 0.42rem;
  border: 1px solid rgba(168, 255, 205, 0.16);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(168, 255, 205, 0.06);
}

.status-pill.waiting {
  border-color: rgba(255, 210, 138, 0.2);
  color: var(--warning);
  background: var(--warning-soft);
}

.status-pill.done {
  border-color: var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

.status-pill.error {
  border-color: rgba(255, 156, 150, 0.2);
  color: var(--danger);
  background: var(--danger-soft);
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  font-size: 1.15rem;
}

.icon-button:hover {
  border-color: var(--line);
  color: var(--text);
  background: var(--panel);
}

.messages {
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: var(--line-strong) transparent;
}

.empty-state {
  display: flex;
  width: min(100%, 620px);
  min-height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  text-align: center;
}

.empty-state h2 {
  margin: 0.75rem 0 0.7rem;
  font-size: clamp(1.65rem, 4vw, 2.5rem);
  font-weight: 650;
  letter-spacing: -0.045em;
}

.empty-state > p:not(.eyebrow) {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.75;
}

.empty-symbol {
  position: relative;
  width: 74px;
  height: 74px;
  margin-bottom: 1.25rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.empty-symbol::before,
.empty-symbol::after,
.empty-symbol span {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.empty-symbol::before {
  inset: 15px;
  border: 1px solid rgba(168, 255, 205, 0.28);
}

.empty-symbol::after {
  inset: 30px;
  background: var(--accent);
}

.empty-symbol span:first-child {
  top: 36px;
  left: -14px;
  width: 102px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.empty-symbol span:nth-child(2) {
  top: -14px;
  left: 36px;
  width: 1px;
  height: 102px;
  background: linear-gradient(transparent, var(--accent), transparent);
}

.empty-symbol span:last-child {
  inset: 7px;
  border: 1px dashed rgba(168, 255, 205, 0.11);
  animation: rotate 20s linear infinite;
}

.message-stream {
  width: min(100%, 820px);
  min-width: 0;
  margin: 0 auto;
  padding: 2.1rem 1.2rem 4rem;
}

.event {
  position: relative;
  min-width: 0;
  max-width: 100%;
  margin-bottom: 1.15rem;
  animation: rise-in 220ms ease both;
}

.event-user {
  display: flex;
  justify-content: flex-end;
}

.user-bubble {
  min-width: 0;
  max-width: min(84%, 630px);
  overflow-wrap: anywhere;
  padding: 0.92rem 1.05rem;
  border: 1px solid rgba(168, 255, 205, 0.13);
  border-radius: 19px 19px 5px 19px;
  background: linear-gradient(145deg, #25342d, #1a2821);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  font-size: 0.91rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.user-time,
.assistant-time {
  display: block;
  margin-top: 0.4rem;
  color: var(--faint);
  font-size: 0.61rem;
  line-height: 1;
  text-align: right;
}

.assistant-time {
  margin-top: 0.45rem;
  text-align: left;
}

.assistant-line {
  display: grid;
  min-width: 0;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 0.75rem;
}

.assistant-avatar {
  position: relative;
  width: 25px;
  height: 25px;
  margin-top: 0.05rem;
  border: 1px solid rgba(168, 255, 205, 0.32);
  border-radius: 50%;
}

.assistant-avatar::before {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.assistant-avatar::after {
  position: absolute;
  inset: 21px 9px;
  height: 1px;
  background: var(--accent);
  content: "";
  opacity: 0.55;
}

.assistant-body {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding-top: 0.05rem;
  color: #dce8e1;
  font-size: 0.91rem;
  line-height: 1.74;
  white-space: normal;
  word-break: break-word;
}

.assistant-body.streaming {
  white-space: pre-wrap;
}

.rich-paragraph {
  margin: 0.35rem 0;
  white-space: pre-wrap;
}

.rich-paragraph:first-child {
  margin-top: 0;
}

.rich-heading {
  margin: 0.9rem 0 0.35rem;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 720;
  letter-spacing: -0.015em;
}

.assistant-body ul,
.assistant-body ol {
  margin: 0.45rem 0;
  padding-left: 1.3rem;
}

.assistant-body li {
  margin: 0.2rem 0;
  padding-left: 0.12rem;
}

.assistant-body code {
  padding: 0.08rem 0.28rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--accent);
  background: rgba(4, 8, 6, 0.55);
  font-family: var(--mono);
  font-size: 0.82em;
}

.assistant-code {
  position: relative;
  margin: 0.75rem 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4, 8, 6, 0.68);
}

.assistant-code pre {
  max-height: 320px;
  margin: 0;
  padding: 0.85rem;
  overflow: auto;
  white-space: pre;
}

.assistant-code code {
  padding: 0;
  border: 0;
  color: #c9dbd0;
  background: transparent;
  font-size: 0.74rem;
  line-height: 1.6;
}

.assistant-code-language {
  display: block;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: lowercase;
}

.assistant-table-wrap {
  margin: 0.75rem 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.assistant-body table {
  width: 100%;
  min-width: 440px;
  border-collapse: collapse;
  font-size: 0.74rem;
  line-height: 1.5;
}

.assistant-body th,
.assistant-body td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.assistant-body th {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.assistant-body tr:last-child td {
  border-bottom: 0;
}

.assistant-body.streaming::after {
  display: inline-block;
  width: 5px;
  height: 1.02em;
  margin-left: 0.23rem;
  vertical-align: -0.13em;
  border-radius: 2px;
  background: var(--accent);
  content: "";
  animation: blink 0.9s steps(2, end) infinite;
}

.event-card {
  min-width: 0;
  max-width: calc(100% - 2rem);
  margin-left: 2rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(19, 27, 24, 0.74);
}

.event-card summary {
  cursor: pointer;
  list-style: none;
}

.event-card summary::-webkit-details-marker {
  display: none;
}

.event-card-head {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  padding: 0.74rem 0.88rem;
  color: var(--muted);
  font-size: 0.73rem;
}

.event-card-head strong {
  color: var(--text);
  font-size: 0.77rem;
  font-weight: 650;
}

.event-card-head code {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-icon {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  color: var(--accent);
  background: rgba(168, 255, 205, 0.07);
  font-family: var(--mono);
  font-size: 0.68rem;
}

.event-card pre {
  max-height: 300px;
  margin: 0;
  padding: 0.84rem 0.9rem;
  overflow: auto;
  border-top: 1px solid var(--line);
  color: #bdcec4;
  background: rgba(4, 8, 6, 0.56);
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.58;
  white-space: pre-wrap;
  word-break: break-word;
}

.event-card-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 0.75rem 0.72rem;
  border-top: 1px solid var(--line);
  background: rgba(4, 8, 6, 0.56);
}

.copy-output-button {
  padding: 0.42rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 0.68rem;
}

.copy-output-button:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.event-card pre:empty {
  display: none;
}

.event-status {
  margin-left: auto;
  padding: 0.16rem 0.42rem;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.62rem;
}

.event-status.completed {
  color: var(--accent);
}

.event-status.failed,
.event-status.declined {
  color: var(--danger);
}

.file-change {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approval-card {
  margin-left: 2rem;
  padding: 1rem;
  border: 1px solid rgba(255, 210, 138, 0.24);
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(255, 198, 102, 0.08), rgba(19, 27, 24, 0.8));
}

.approval-label {
  color: var(--warning);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.1em;
}

.approval-card h3 {
  margin: 0.5rem 0 0.35rem;
  font-size: 0.88rem;
}

.approval-detail {
  margin: 0;
  padding: 0.65rem 0.7rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #c7d4cc;
  background: rgba(4, 8, 6, 0.48);
  font-family: var(--mono);
  font-size: 0.69rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.approval-reason {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.approval-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.approval-actions button {
  min-height: 39px;
  border-radius: 10px;
  font-size: 0.77rem;
  font-weight: 680;
}

.approve-button {
  border: 1px solid var(--accent);
  color: var(--accent-ink);
  background: var(--accent);
}

.decline-button {
  border: 1px solid rgba(255, 156, 150, 0.22);
  color: var(--danger);
  background: var(--danger-soft);
}

.approval-resolved {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.73rem;
}

.event-note {
  margin-left: 2rem;
  color: var(--faint);
  font-size: 0.72rem;
  line-height: 1.6;
}

.diagnostic-card {
  margin-left: 2rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.018);
  font-size: 0.68rem;
}

.diagnostic-card summary {
  padding: 0.55rem 0.72rem;
  cursor: pointer;
  list-style: none;
}

.diagnostic-card summary::-webkit-details-marker {
  display: none;
}

.diagnostic-card pre {
  max-height: 180px;
  margin: 0;
  padding: 0.62rem 0.72rem;
  overflow: auto;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.64rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

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

.plan-card {
  margin-left: 2rem;
  padding: 0.85rem 0.95rem;
  border-left: 2px solid rgba(168, 255, 205, 0.3);
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.composer-wrap {
  position: relative;
  z-index: 4;
  padding: 0.7rem 1.2rem max(0.8rem, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 24%);
}

.composer {
  display: grid;
  width: min(100%, 820px);
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin: 0 auto;
  padding: 0.45rem;
  border: 1px solid var(--line-strong);
  border-radius: 19px;
  background: rgba(20, 29, 25, 0.94);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(18px);
}

.composer:focus-within {
  border-color: rgba(168, 255, 205, 0.3);
}

.composer textarea {
  max-height: 180px;
  min-height: 43px;
  resize: none;
  padding: 0.72rem 0.75rem 0.58rem;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 16px;
  line-height: 1.5;
}

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

.send-button,
.stop-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 13px;
}

.send-button {
  color: var(--accent-ink);
  background: var(--accent);
}

.send-button:disabled {
  cursor: default;
  opacity: 0.35;
}

.send-arrow {
  font-size: 1.28rem;
  font-weight: 800;
  line-height: 1;
}

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

.composer-hint {
  margin: 0.42rem auto 0;
  color: var(--faint);
  font-size: 0.62rem;
  text-align: center;
}

.approval-banner {
  display: flex;
  width: min(100%, 820px);
  align-items: center;
  justify-content: space-between;
  margin: 0 auto 0.5rem;
  padding: 0.55rem 0.7rem 0.55rem 0.85rem;
  border: 1px solid rgba(255, 210, 138, 0.2);
  border-radius: 12px;
  color: var(--warning);
  background: rgba(53, 41, 22, 0.76);
  font-size: 0.72rem;
}

.approval-banner button {
  padding: 0.27rem 0.6rem;
  border: 1px solid rgba(255, 210, 138, 0.22);
  border-radius: 8px;
  color: var(--warning);
  background: transparent;
  font-size: 0.68rem;
}

.sheet {
  width: min(calc(100% - 2rem), 460px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  color: var(--text);
  background: #141d19;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.62);
}

.sheet::backdrop {
  background: rgba(3, 7, 5, 0.72);
  backdrop-filter: blur(7px);
}

.sheet form {
  display: grid;
  gap: 1rem;
  padding: 1.35rem;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.sheet-head h2 {
  margin: 0.35rem 0 0.4rem;
  font-size: 1.35rem;
  letter-spacing: -0.035em;
}

.sheet-note {
  margin: 0;
  color: var(--faint);
  font-size: 0.73rem;
  line-height: 1.65;
}

.info-list {
  display: grid;
  gap: 0.65rem;
  margin: 0;
}

.info-list div {
  display: grid;
  gap: 0.27rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(5, 10, 8, 0.42);
}

.info-list dt {
  color: var(--faint);
  font-size: 0.65rem;
}

.info-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 50;
  max-width: min(360px, calc(100vw - 2rem));
  padding: 0.72rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--text);
  background: #1c2822;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  font-size: 0.76rem;
  animation: rise-in 180ms ease both;
}

.sidebar-scrim,
.mobile-only {
  display: none;
}

@keyframes rise-in {
  from {
    transform: translateY(7px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes breathe {
  50% {
    box-shadow: 0 0 0 7px rgba(168, 255, 205, 0.02);
    opacity: 0.72;
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

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

@media (max-width: 760px) {
  html,
  body {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  .mobile-only {
    display: grid;
  }

  .app-shell {
    position: fixed;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(86vw, 310px);
    transform: translateX(-104%);
    box-shadow: 24px 0 80px rgba(0, 0, 0, 0.42);
    transition: transform 210ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 7;
    background: rgba(2, 5, 4, 0.58);
    backdrop-filter: blur(2px);
  }

  .sidebar-scrim.open {
    display: block;
  }

  .conversation {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .conversation-head {
    min-height: 62px;
    padding-right: 0.75rem;
    padding-left: 0.65rem;
  }

  .conversation-head .icon-button {
    width: 35px;
    height: 35px;
  }

  .history-button {
    width: 36px;
    min-height: 36px;
    justify-content: center;
    padding: 0;
    border-color: transparent;
    background: transparent;
  }

  .history-text {
    display: none;
  }

  .message-stream {
    padding: 1.3rem 0.9rem 2.2rem;
  }

  .messages {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .user-bubble {
    max-width: 90%;
    font-size: 0.88rem;
  }

  .assistant-body {
    font-size: 0.87rem;
    line-height: 1.68;
  }

  .event-card,
  .approval-card,
  .plan-card,
  .event-note {
    margin-left: 1.8rem;
  }

  .event-card {
    max-width: calc(100% - 1.8rem);
  }

  .composer-wrap {
    padding-right: 0.65rem;
    padding-left: 0.65rem;
  }

  .composer {
    border-radius: 17px;
  }

  .composer-hint {
    display: none;
  }

  .empty-state {
    padding: 2rem 1.25rem 3rem;
  }

  .empty-symbol {
    width: 64px;
    height: 64px;
  }

  .empty-symbol::before {
    inset: 13px;
  }

  .empty-symbol::after {
    inset: 26px;
  }

  .empty-symbol span:first-child {
    top: 31px;
    left: -12px;
    width: 88px;
  }

  .empty-symbol span:nth-child(2) {
    top: -12px;
    left: 31px;
    height: 88px;
  }

  .toast {
    right: 50%;
    bottom: max(5rem, calc(env(safe-area-inset-bottom) + 4.5rem));
    transform: translateX(50%);
    animation: none;
  }
}

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