/* ------------------------------------------------------------------ tokens */

:root {
  --bg: #faf9f5;
  --bg-sidebar: #f0eee6;
  --bg-elevated: #ffffff;
  --bg-user: #f0eee6;
  --bg-hover: rgba(20, 20, 19, 0.055);
  --bg-active: rgba(20, 20, 19, 0.085);
  --bg-code: #f5f4ef;

  --text: #1f1e1d;
  --text-muted: #73726c;
  --text-faint: #9c9a92;

  --border: #e5e3da;
  --border-strong: #d6d3c8;

  --accent: #d97757;
  --accent-hover: #c2603f;
  --accent-soft: rgba(217, 119, 87, 0.12);

  --danger: #b4483a;
  --ok: #4f7a52;

  --font-sans: ui-sans-serif, -apple-system, "Segoe UI Variable Text", "Segoe UI",
    system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Georgia,
    "Times New Roman", serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;

  --sidebar-w: 272px;
  --col: 46rem;
  --radius: 12px;

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #262624;
  --bg-sidebar: #1f1e1d;
  --bg-elevated: #30302e;
  --bg-user: #3a3a36;
  --bg-hover: rgba(245, 244, 238, 0.06);
  --bg-active: rgba(245, 244, 238, 0.1);
  --bg-code: #212120;

  --text: #f3f2ec;
  --text-muted: #a5a39b;
  --text-faint: #7d7b74;

  --border: #3c3c38;
  --border-strong: #4a4a45;

  --accent: #d97757;
  --accent-hover: #e08a6d;
  --accent-soft: rgba(217, 119, 87, 0.16);

  --danger: #e08579;
  --ok: #8fbf93;

  color-scheme: dark;
}

/* -------------------------------------------------------------------- base */

* {
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

input,
textarea,
select {
  font: inherit;
  color: inherit;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-faint);
  background-clip: content-box;
}
::-webkit-scrollbar-track {
  background: transparent;
}

[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------------- login */

.login {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.login-mark {
  width: 44px;
  height: 44px;
  color: var(--accent);
}

.login-card h1 {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 400;
  margin: 2px 0 0;
  letter-spacing: -0.01em;
}

.login-sub {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 14px;
}

.login-card input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  outline: none;
}

.login-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.login-card button {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 500;
}

.login-card button:hover {
  background: var(--accent-hover);
}

.login-card button:disabled {
  opacity: 0.6;
  cursor: default;
}

.login-error {
  margin: 0;
  color: var(--danger);
  font-size: 13.5px;
}

/* --------------------------------------------------------------- app shell */

.app {
  display: flex;
  height: 100%;
}

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 10px 10px 8px;
  gap: 8px;
  transition: margin-left 0.22s ease;
}

.app.collapsed .sidebar {
  margin-left: calc(-1 * var(--sidebar-w));
}

.sidebar-top {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 2px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  padding: 4px 6px;
  border-radius: 8px;
}

.brand-mark {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 19px;
  letter-spacing: -0.01em;
}

.icon-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--text-muted);
  flex: none;
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

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

.new-chat {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--accent);
  font-weight: 500;
  font-size: 14.5px;
}

.new-chat svg {
  width: 17px;
  height: 17px;
}

.new-chat:hover {
  background: var(--bg-hover);
}

.project-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin: 2px 0 4px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  font-size: 13.5px;
  text-align: left;
}

.project-pill:hover {
  border-color: var(--text-faint);
}

.project-pill svg {
  width: 17px;
  height: 17px;
  flex: none;
  color: var(--text-muted);
}

.project-pill .chev {
  width: 15px;
  height: 15px;
  margin-left: auto;
}

.project-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recents {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-top: 2px;
}

.recents-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  padding: 8px 10px 4px;
}

.recents-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.recents-list li {
  position: relative;
}

.recents-list button.item {
  width: 100%;
  text-align: left;
  padding: 7px 30px 7px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.recents-list button.item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.recents-list li.active button.item {
  background: var(--bg-active);
  color: var(--text);
}

.recents-list .row-menu {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: none;
  place-items: center;
  color: var(--text-faint);
}

.recents-list li:hover .row-menu {
  display: grid;
}

.recents-list .row-menu:hover {
  background: var(--bg-active);
  color: var(--text);
}

.recents-list .row-menu svg {
  width: 15px;
  height: 15px;
}

.recents-empty {
  padding: 6px 10px;
  color: var(--text-faint);
  font-size: 13px;
}

.sidebar-bottom {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ------------------------------------------------------------ usage meter */

.usage-row {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 8px 8px;
  border-radius: 9px;
  margin-bottom: 2px;
}

.usage-row:hover {
  background: var(--bg-hover);
}

.usage-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-muted);
}

.usage-pct {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-size: 12px;
}

.usage-bar {
  height: 5px;
  border-radius: 99px;
  background: var(--bg-active);
  margin: 5px 0 4px;
  overflow: hidden;
}

.usage-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: var(--accent);
  transition: width 0.4s ease, background-color 0.2s ease;
}

.usage-fill.warn {
  background: #d19a4a;
}

.usage-fill.hot {
  background: var(--danger);
}

.usage-note {
  font-size: 11px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-card {
  max-width: 460px;
}

.usage-body {
  padding: 6px 16px 12px;
  overflow-y: auto;
  flex: 1;
}

.usage-window {
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.usage-window:last-child {
  border-bottom: none;
}

.usage-window-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.usage-window-name {
  font-size: 14px;
}

.usage-window-detail {
  color: var(--text-faint);
  font-size: 12px;
  margin-left: 6px;
}

.usage-window-pct {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  flex: none;
}

.usage-window .usage-bar {
  height: 7px;
  margin: 0 0 5px;
}

.usage-reset {
  font-size: 12px;
  color: var(--text-muted);
}

.usage-empty {
  padding: 18px 0;
  color: var(--text-muted);
  font-size: 13.5px;
}

.usage-foot {
  justify-content: space-between;
  align-items: center;
}

.usage-updated {
  font-size: 11.5px;
  color: var(--text-faint);
}

.mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.mini-select {
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 12.5px;
  max-width: 130px;
  cursor: pointer;
  outline: none;
}

.mini-select:focus {
  border-color: var(--accent);
}

.sidebar-actions {
  display: flex;
  gap: 4px;
}

.ghost-button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.ghost-button svg {
  width: 15px;
  height: 15px;
}

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

/* -------------------------------------------------------------------- main */

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 52px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-bottom: 1px solid transparent;
}

.topbar.scrolled {
  border-bottom-color: var(--border);
}

#open-sidebar {
  display: none;
}

.app.collapsed #open-sidebar {
  display: grid;
}

.topbar-title {
  font-size: 14px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cwd-chip {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
  background: var(--bg-hover);
  padding: 3px 8px;
  border-radius: 6px;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

.greeting {
  max-width: var(--col);
  margin: 0 auto;
  padding: 14vh 24px 8px;
  text-align: center;
}

.greeting-mark {
  width: 38px;
  height: 38px;
  color: var(--accent);
}

.greeting h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 30px;
  letter-spacing: -0.015em;
  margin: 14px 0 0;
}

.greeting-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin: 8px 0 0;
}

.thread {
  max-width: var(--col);
  margin: 0 auto;
  padding: 18px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.thread-tail {
  height: 36px;
}

/* ---------------------------------------------------------------- messages */

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

.msg.user .bubble {
  background: var(--bg-user);
  border-radius: 16px;
  padding: 10px 16px;
  max-width: 85%;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.msg.user .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.msg.assistant {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/*
 * Flex items default to min-width:auto, so a wide code block or table pushes
 * the whole column past the viewport instead of scrolling inside itself.
 */
.thread > *,
.msg.assistant > *,
.tool-sub > * {
  min-width: 0;
}

.turn-error {
  border-left: 3px solid var(--danger);
  padding: 6px 12px;
  color: var(--danger);
  font-size: 13.5px;
  background: var(--bg-elevated);
  border-radius: 0 8px 8px 0;
}

.notice {
  align-self: center;
  font-size: 12.5px;
  color: var(--text-faint);
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--bg-hover);
}

/* ------------------------------------------------------------------- prose */

.prose {
  word-wrap: break-word;
}

.prose > *:first-child {
  margin-top: 0;
}
.prose > *:last-child {
  margin-bottom: 0;
}

.prose p {
  margin: 0 0 1em;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  font-weight: 600;
  line-height: 1.3;
  margin: 1.6em 0 0.6em;
}

.prose h1 {
  font-size: 1.5em;
}
.prose h2 {
  font-size: 1.28em;
}
.prose h3 {
  font-size: 1.12em;
}

.prose ul,
.prose ol {
  margin: 0 0 1em;
  padding-left: 1.5em;
}

.prose li {
  margin: 0.3em 0;
}

.prose li > ul,
.prose li > ol {
  margin: 0.3em 0;
}

.prose a {
  color: var(--accent);
  text-underline-offset: 2px;
}

.prose blockquote {
  margin: 0 0 1em;
  padding: 0.1em 0 0.1em 1em;
  border-left: 2px solid var(--border-strong);
  color: var(--text-muted);
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.6em 0;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.1em 0.35em;
}

.prose pre {
  margin: 0 0 1em;
  max-width: 100%;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.prose pre code {
  display: block;
  padding: 12px 14px;
  overflow-x: auto;
  background: none;
  border: none;
  border-radius: 0;
  font-size: 12.8px;
  line-height: 1.6;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 6px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}

.copy-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: 6px;
  font-family: var(--font-sans);
  white-space: nowrap;
}

/* Without an explicit size an inline SVG expands and shoves the label out. */
.copy-button svg {
  width: 13px;
  height: 13px;
}

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

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1em;
  font-size: 0.94em;
  display: block;
  overflow-x: auto;
}

.prose th,
.prose td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
}

.prose th {
  background: var(--bg-hover);
  font-weight: 600;
}

.prose img {
  max-width: 100%;
  border-radius: 8px;
}

.caret::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--text-faint);
  border-radius: 1px;
  animation: blink 1.1s steps(2, start) infinite;
}

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

/* --------------------------------------------------------- thinking + tools */

.thinking {
  border-left: 2px solid var(--border-strong);
  padding-left: 12px;
}

.thinking-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 2px 0;
}

.thinking-head svg {
  width: 13px;
  height: 13px;
  transition: transform 0.15s ease;
}

.thinking.open .thinking-head svg {
  transform: rotate(90deg);
}

.thinking-body {
  display: none;
  color: var(--text-muted);
  font-size: 14px;
  white-space: pre-wrap;
  padding: 4px 0 2px;
}

.thinking.open .thinking-body {
  display: block;
}

.thinking-body.prose {
  white-space: normal;
}

.tool {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.tool-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 11px;
  font-size: 13px;
  text-align: left;
}

.tool-head:hover {
  background: var(--bg-hover);
}

.tool-icon {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--text-faint);
}

.tool-name {
  font-weight: 500;
  flex: none;
}

.tool-target {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-status {
  margin-left: auto;
  flex: none;
  font-size: 11.5px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 5px;
}

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

.spinner {
  width: 11px;
  height: 11px;
  border: 1.6px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.tool-body {
  display: none;
  border-top: 1px solid var(--border);
}

.tool.open .tool-body {
  display: block;
}

.tool-section {
  padding: 9px 12px;
}

.tool-section + .tool-section {
  border-top: 1px dashed var(--border);
}

.tool-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 5px;
}

.tool-pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.2px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 340px;
  overflow: auto;
  color: var(--text-muted);
}

.tool-sub {
  padding: 0 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* -------------------------------------------------------------- permission */

.permission {
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 12px 14px;
}

.permission h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
}

.permission p {
  margin: 0 0 8px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.permission pre {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}

.permission-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.permission-actions button {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
}

.permission-actions button:hover {
  border-color: var(--text-faint);
}

.permission-actions .allow {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.permission-actions .allow:hover {
  background: var(--accent-hover);
}

.permission.answered {
  opacity: 0.55;
}

.permission.answered .permission-actions {
  display: none;
}

/* ---------------------------------------------------------------- composer */

.composer-wrap {
  flex: none;
  padding: 0 24px 12px;
  background: linear-gradient(to top, var(--bg) 62%, transparent);
}

.composer {
  max-width: var(--col);
  margin: 0 auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 10px 12px 8px;
  box-shadow: 0 2px 10px rgba(20, 20, 19, 0.045);
  transition: border-color 0.15s ease;
}

.composer:focus-within {
  border-color: var(--text-faint);
}

.composer textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  background: none;
  padding: 4px 4px 2px;
  max-height: 260px;
  overflow-y: auto;
  line-height: 1.55;
}

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

.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 2px 8px;
}

.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12.5px;
  max-width: 260px;
}

.chip .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip .size {
  color: var(--text-faint);
  flex: none;
}

.chip button {
  display: grid;
  place-items: center;
  color: var(--text-faint);
  flex: none;
}

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

.chip svg {
  width: 13px;
  height: 13px;
}

.chip.uploading {
  opacity: 0.6;
}

.composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 2px;
}

.composer-left,
.composer-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.model-select,
.effort-select {
  border-color: transparent;
  background: none;
  color: var(--text-muted);
  max-width: 190px;
}

.model-select:hover,
.effort-select:hover {
  background: var(--bg-hover);
}

.effort-select {
  max-width: 140px;
}

.hint {
  font-size: 12px;
  color: var(--text-faint);
}

.send {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
}

.send svg {
  width: 17px;
  height: 17px;
}

.send:hover {
  background: var(--accent-hover);
}

.send:disabled {
  background: var(--border-strong);
  color: var(--bg-elevated);
  cursor: default;
}

.send.stop {
  background: var(--text);
  color: var(--bg);
}

.disclaimer {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-faint);
  margin: 7px 0 0;
}

/* ------------------------------------------------------------------- modal */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 19, 0.35);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 40;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: 72vh;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(20, 20, 19, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
}

.modal-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.modal-path {
  margin: 1px 0 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
}

.modal-head > div {
  flex: 1;
  min-width: 0;
}

.project-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  flex: 1;
}

.project-list button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  text-align: left;
  font-size: 14px;
}

.project-list button:hover {
  background: var(--bg-hover);
}

.project-list svg {
  width: 17px;
  height: 17px;
  flex: none;
  color: var(--text-faint);
}

.project-list .markers {
  margin-left: auto;
  display: flex;
  gap: 4px;
  flex: none;
}

.marker {
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}

.modal-foot {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
}

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

/* ------------------------------------------------------------ drop + toast */

.drop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(217, 119, 87, 0.08);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  z-index: 60;
  pointer-events: none;
}

.drop-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 40px;
  border: 2px dashed var(--accent);
  border-radius: 16px;
  background: var(--bg);
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
}

.drop-card svg {
  width: 28px;
  height: 28px;
}

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 13.5px;
  z-index: 80;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.18);
  }

  .app:not(.drawer-open) .sidebar {
    margin-left: calc(-1 * var(--sidebar-w));
  }

  #open-sidebar {
    display: grid;
  }

  .app.drawer-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 19, 0.35);
    z-index: 45;
  }

  .thread,
  .composer-wrap {
    padding-left: 14px;
    padding-right: 14px;
  }

  .greeting {
    padding-top: 10vh;
  }

  .cwd-chip {
    display: none;
  }
}
