@font-face {
  font-family: Geist;
  src: url('../v2-home/fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('../v2-home/fonts/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: Newsreader;
  src: url('fonts/Newsreader-Variable.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}

/* Monochrome light: white ground, graphite ink. Sage is the one optional accent, used only for state. */
:root {
  --ground: #ffffff;
  --ground-soft: #fafaf9;
  --rail: #f9f9f8;
  --surface-2: #f4f4f2;
  --selected: #ececea;
  --line: #e5e5e2;
  --line-strong: #d4d4d0;
  --ink: #161616;
  --ink-2: #5c5c58;
  --ink-3: #7b7b76;
  --press: rgba(22, 22, 22, 0.05);
  --shadow-pop: 0 1px 2px rgba(22, 22, 22, 0.05), 0 16px 40px -16px rgba(22, 22, 22, 0.22);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --font: Geist, system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  --display: Newsreader, 'Iowan Old Style', Georgia, serif;
  color-scheme: light;
}
[data-accent='graphite'] {
  --accent: #161616;
  --accent-soft: #f1f1ef;
  --accent-line: #dcdcd8;
}
[data-accent='sage'] {
  --accent: #4f7564;
  --accent-soft: #e9f0eb;
  --accent-line: #c9dacf;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--ground); }
body {
  margin: 0;
  font: 400 14px/1.45 var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code { font: 500 0.92em/1 var(--mono); padding: 2px 5px; border-radius: 5px; background: var(--surface-2); }
.sprite { position: absolute; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mark { width: 20px; height: 20px; fill: currentColor; flex: none; }
.spacer { flex: 1; }
.grow { flex: 1; min-width: 0; display: grid; gap: 2px; }
.muted { color: var(--ink-2); font-size: 12.5px; }
.empty { margin-top: 18px; color: var(--ink-2); font-size: 13px; }

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

.app {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}
.app[data-sidebar='collapsed'] { grid-template-columns: 0 minmax(0, 1fr); }
.app[data-sidebar='collapsed'] .sidebar { visibility: hidden; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 10px 8px 10px;
  background: var(--rail);
  border-right: 1px solid var(--line);
  overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 4px; height: 44px; padding: 0 2px 0 6px; }
.wordmark {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  font: 500 25px/1 var(--display);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand-orb, .banner-orb {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff 0%, #d9dcdf 22%, #6f747b 62%, #23262a 100%);
  box-shadow: 0 0 0 1px rgba(22, 22, 22, 0.12), 0 3px 9px rgba(22, 22, 22, 0.22);
}
[data-accent='sage'] :is(.brand-orb, .banner-orb) { background: radial-gradient(circle at 34% 28%, #fff 0%, #d5e4db 22%, #5f8a76 62%, #233a30 100%); }
.square {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--ink-2);
  transition: background-color 150ms ease, transform 120ms var(--ease-out);
}
.square:active { transform: scale(0.96); }
.square[aria-pressed='true'], .square[data-active] { background: var(--selected); color: var(--ink); }

.nav { display: grid; gap: 2px; margin-top: 14px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13.5px;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 150ms ease;
}
.nav a .icon { color: var(--ink-2); }
.nav a[aria-current='page'] { background: var(--selected); border-color: var(--line-strong); font-weight: 500; }
.nav a[aria-current='page'] .icon { color: var(--ink); }
.nav-count {
  margin-left: auto;
  font: 500 11.5px/1 var(--mono);
  color: var(--ink-3);
}

.chats { margin-top: 26px; min-height: 0; display: flex; flex-direction: column; }
.chats-head { display: flex; align-items: center; height: 28px; padding: 0 10px; }
.chats-head h2 { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.chats-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  margin: 6px 4px 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--ground);
  color: var(--ink-3);
}
.chats-filter input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 13px; color: var(--ink); }
.chats-day { padding: 14px 10px 4px; font-size: 11.5px; color: var(--ink-3); }
.chat-list { overflow-y: auto; }
.chat-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  padding: 7px 10px;
  border-radius: 9px;
  text-decoration: none;
}
.chat-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.chat-time { grid-column: 1; font-size: 11.5px; color: var(--ink-3); }
.chat-unread { grid-column: 2; grid-row: 1 / 3; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.workspace {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 8px 8px;
  border-radius: 10px;
  text-align: left;
  transition: background-color 150ms ease;
}
.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: var(--selected);
  font-size: 13px;
  font-weight: 500;
}
.avatar.big { width: 44px; height: 44px; font-size: 17px; }
.workspace-text { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
.workspace-text strong { font-size: 14px; font-weight: 500; }
.workspace-text span { font-size: 12px; color: var(--ink-3); }
.workspace .icon { color: var(--ink-3); }

@media (hover: hover) and (pointer: fine) {
  .square:hover, .nav a:not([aria-current]):hover, .chat-list a:hover, .workspace:hover { background: var(--press); }
}

.main { position: relative; min-width: 0; }
[data-current-view='plugins'] .main, [data-current-view='socials'] .main { background: var(--ground-soft); }
.topbar {
  position: absolute;
  top: 14px;
  right: 18px;
  z-index: 5;
  display: flex;
  gap: 8px;
}
.round-tool {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  min-width: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--ground);
  font-size: 13px;
  transition: transform 120ms var(--ease-out), background-color 150ms ease;
}
.round-tool:active { transform: scale(0.96); }
.pill-tool { padding: 0 13px 0 11px; }
.round-tool .dot {
  position: absolute;
  top: 5px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--ground);
  background: var(--accent);
}
.sidebar-open { position: absolute; top: 14px; left: 14px; z-index: 5; }

/* ---- agent home ---- */

.agent {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 32px 80px;
}
.agent-hero { display: grid; justify-items: center; text-align: center; }
.agent-orb { margin-bottom: 18px; }
.display {
  font: 500 76px/1 var(--display);
  letter-spacing: -0.025em;
  font-variation-settings: 'opsz' 72;
}
.agent-line { margin-top: 14px; font-size: 17px; color: var(--ink-2); letter-spacing: -0.005em; }

.composer-stack { width: min(768px, 100%); margin-top: 34px; display: grid; justify-items: center; }
.composer-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  width: calc(100% - 32px);
  height: 32px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: var(--ground-soft);
}
.composer-tabs > button, .composer-tabs > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--ink-2);
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease;
}
.composer-tabs .icon { width: 14px; height: 14px; }
.composer {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 16px 14px 12px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--ground);
  box-shadow: 0 1px 2px rgba(22, 22, 22, 0.04), 0 10px 28px -14px rgba(22, 22, 22, 0.16);
  transition: border-color 150ms ease, box-shadow 200ms ease;
}
.composer:focus-within { border-color: #a9a9a4; }
.composer textarea {
  display: block;
  width: 100%;
  min-height: 52px;
  border: 0;
  outline: 0;
  resize: none;
  background: none;
  font-size: 15.5px;
  line-height: 1.5;
}
.composer textarea::placeholder { color: var(--ink-3); }
.composer-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ghost-round {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--ink-2);
  transition: background-color 150ms ease, transform 120ms var(--ease-out), color 150ms ease;
}
.ghost-round .icon { width: 18px; height: 18px; }
.ghost-round:active, .model-button:active, .tier:active, .send:active { transform: scale(0.96); }
.ghost-round[aria-pressed='true'] { background: var(--accent-soft); color: var(--accent); }
.picker { position: relative; }
.model-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px 0 12px;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: background-color 150ms ease, transform 120ms var(--ease-out);
}
.model-button .icon { color: var(--ink-2); }
.model-dot, .status-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--line-strong); }
.model-dot[data-state='ready'], .status-dot.ok { background: var(--accent); }
.model-dot[data-state='signed-out'], .model-dot[data-state='off'], .status-dot.warn { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.tier {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 11px 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease, transform 120ms var(--ease-out);
}
.tier .icon { width: 13px; height: 13px; }
.tier[aria-pressed='true'] { color: var(--ink); border-color: var(--line-strong); background: var(--surface-2); }
.send {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-left: 2px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  transition: background-color 150ms ease, transform 120ms var(--ease-out);
}
.send .icon { width: 18px; height: 18px; stroke-width: 1.9; }
.send:disabled { background: var(--line-strong); }

.model-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: -60px;
  z-index: 20;
  width: 300px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--ground);
  box-shadow: var(--shadow-pop);
  transform-origin: 70% top;
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
}
@starting-style {
  .model-menu { opacity: 0; transform: scale(0.97) translateY(-4px); }
}
.model-option {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) 16px;
  align-items: center;
  column-gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 9px;
  text-align: left;
}
.model-option strong { font-size: 13.5px; font-weight: 500; }
.model-option span:not(.model-dot) { grid-column: 2; font-size: 12px; color: var(--ink-3); }
.model-option .icon { grid-column: 3; grid-row: 1; visibility: hidden; }
.model-option[aria-selected='true'] .icon { visibility: visible; }
.model-option:focus-visible { outline-offset: -2px; }
.menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding: 10px 10px 6px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
  text-decoration: none;
}

.composer-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  margin-top: -18px;
  padding: 26px 0 7px;
  border-radius: 0 0 18px 18px;
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--ink-2);
  text-decoration: none;
}
.composer-foot .icon { width: 12px; height: 12px; }
.composer-cost {
  width: calc(100% - 32px);
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: var(--ground-soft);
  font-size: 12.5px;
  font-style: italic;
  color: var(--ink-3);
}
.composer-hint { min-height: 20px; margin-top: 10px; font-size: 12.5px; color: var(--ink-2); }

.reply {
  width: min(736px, 100%);
  margin-top: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--ground-soft);
  font-size: 14px;
  line-height: 1.55;
}
.reply:not([hidden]) { transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); }
@starting-style {
  .reply:not([hidden]) { opacity: 0; transform: translateY(6px); }
}
.reply-orb { margin-bottom: 6px; font-size: 12px; font-weight: 500; color: var(--ink-2); }

.modes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: min(700px, 100%);
  margin-top: 30px;
}
.mode {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--ground);
  font-size: 13.5px;
  transition: background-color 150ms ease, border-color 150ms ease, transform 120ms var(--ease-out);
}
.mode:active { transform: scale(0.97); }
.mode .icon { color: var(--ink-2); }
.mode[aria-pressed='true'] { background: var(--selected); border-color: #bdbdb8; }
[data-accent='sage'] .mode[aria-pressed='true'] { background: var(--accent-soft); border-color: var(--accent-line); }
[data-accent='sage'] .mode[aria-pressed='true'] .icon { color: var(--accent); }

.suggestions { display: grid; width: min(640px, 100%); margin-top: 34px; }
.suggestion {
  display: flex;
  gap: 12px;
  width: 100%;
  padding: 9px 0;
  text-align: left;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-2);
  transition: color 150ms ease;
}
.suggestion .icon { width: 14px; height: 14px; margin-top: 4px; color: var(--ink-3); }

.projects { width: min(768px, 100%); margin-top: 48px; }
.projects-head { display: flex; align-items: center; justify-content: space-between; }
.projects-head h2 { font-size: 13.5px; font-weight: 500; }
.projects-head a { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--ink-2); text-decoration: none; }
.projects-head .icon { width: 12px; height: 12px; }
.project-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 14px; }
.mini-folder {
  position: relative;
  display: block;
  height: 168px;
  border-radius: 16px;
  text-decoration: none;
  isolation: isolate;
}
.mini-clips { position: absolute; inset: 8px 18px auto; height: 96px; }
.mini-clips img {
  position: absolute;
  top: 0;
  width: 58%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 9px;
  box-shadow: 0 6px 16px -8px rgba(22, 22, 22, 0.4);
  filter: grayscale(1) contrast(1.05);
  transition: transform 260ms var(--ease-out);
}
.mini-clips img:first-child { left: 6%; transform: rotate(-6deg); }
.mini-clips img:last-child { right: 6%; transform: rotate(5deg) translateY(4px); }
.mini-front {
  position: absolute;
  inset: 52px 0 0;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(244, 244, 242, 0.82));
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 26px -16px rgba(22, 22, 22, 0.35), 0 0 0 1px var(--line);
}
.mini-name {
  position: absolute;
  left: 16px;
  bottom: 14px;
  display: grid;
  font-size: 13.5px;
  font-weight: 500;
}
.mini-name small { font-size: 12px; font-weight: 400; color: var(--ink-2); }

@media (hover: hover) and (pointer: fine) {
  .composer-tabs > button:hover, .composer-tabs > a:hover { background: var(--press); color: var(--ink); }
  .ghost-round:hover { background: var(--press); color: var(--ink); }
  .model-button:hover { background: var(--selected); }
  .model-option:hover { background: var(--press); }
  .mode:not([aria-pressed='true']):hover { background: var(--ground-soft); }
  .suggestion:hover { color: var(--ink); }
  .round-tool:hover { background: var(--ground-soft); }
  .mini-folder:hover .mini-clips img:first-child { transform: rotate(-9deg) translateY(-8px); }
  .mini-folder:hover .mini-clips img:last-child { transform: rotate(8deg) translateY(-6px); }
}

/* ---- plugins and socials ---- */

.plugins { width: min(1152px, 100% - 96px); margin: 0 auto; padding: 86px 0 72px; }
.plugins h1 { font-size: 22px; font-weight: 500; letter-spacing: -0.012em; }
.plugins-line { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); }
.field-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  margin-top: 34px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--ground);
  color: var(--ink-2);
}
.field-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 14px; color: var(--ink); }
.field-search input::placeholder { color: var(--ink-2); }
.field-search:focus-within { border-color: #a9a9a4; }
.plugins-rule { margin-top: 18px; font-size: 13.5px; color: var(--ink-2); }
.plugin-group { margin-top: 30px; }
.plugin-group h2 { font-size: 14.5px; font-weight: 500; }
.plugin-group > p { margin-top: 3px; font-size: 12.5px; color: var(--ink-2); }
.plugin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.plugin {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  height: 78px;
  padding: 0 22px 0 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ground);
  text-align: left;
  transition: border-color 150ms ease, box-shadow 200ms ease, transform 120ms var(--ease-out);
}
.plugin:not(:disabled):active { transform: scale(0.99); }
.plugin-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  background: var(--surface-2);
}
.plugin-name { font-size: 14.5px; font-weight: 500; }
.plugin-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--ink-2); }
.plugin-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.plugin-state .icon { width: 15px; height: 15px; }
.plugin[aria-pressed='true'] { border-color: var(--line-strong); }
.plugin[aria-pressed='true'] .plugin-state {
  height: 26px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 500;
}
.plugin[aria-pressed='true'] .plugin-state .icon { color: var(--accent); stroke-width: 2; }
.plugin:disabled .plugin-mark, .plugin:disabled .plugin-name { opacity: 0.55; }
.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-3);
}
.tag.ok { border-color: var(--accent-line); background: var(--accent-soft); color: var(--ink); }

@media (hover: hover) and (pointer: fine) {
  .plugin:not(:disabled):hover { border-color: var(--line-strong); box-shadow: 0 6px 18px -14px rgba(22, 22, 22, 0.3); }
}

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

.settings {
  width: min(1152px, 100vw - 48px);
  height: min(840px, 100dvh - 48px);
  max-width: none;
  max-height: none;
  padding: 0;
  border: 1px solid rgba(22, 22, 22, 0.08);
  border-radius: 16px;
  background: var(--ground);
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(22, 22, 22, 0.06), 0 40px 90px -30px rgba(22, 22, 22, 0.45);
  overflow: hidden;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out), overlay 150ms allow-discrete, display 150ms allow-discrete;
}
.settings[open] {
  opacity: 1;
  transform: none;
  transition-duration: 220ms;
}
@starting-style {
  .settings[open] { opacity: 0; transform: scale(0.97); }
}
.settings::backdrop {
  background: rgba(30, 30, 28, 0);
  backdrop-filter: blur(0);
  transition: background-color 220ms ease, backdrop-filter 220ms ease, overlay 220ms allow-discrete, display 220ms allow-discrete;
}
.settings[open]::backdrop {
  background: rgba(30, 30, 28, 0.32);
  backdrop-filter: blur(8px) saturate(0.9);
}
@starting-style {
  .settings[open]::backdrop { background: rgba(30, 30, 28, 0); backdrop-filter: blur(0); }
}

.settings-panel { display: grid; grid-template-columns: 240px minmax(0, 1fr); height: 100%; }
.settings-nav {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 12px;
  background: var(--rail);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.settings-nav > * { flex-shrink: 0; }
.org {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 57px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ground);
  text-align: left;
}
.org-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 12.5px;
  font-weight: 600;
}
.org-text { display: grid; flex: 1; line-height: 1.3; }
.org-text span { font-size: 11px; color: var(--ink-2); }
.org-text strong { font-size: 13.5px; font-weight: 600; }
.org .icon { color: var(--ink-2); }
.settings-search {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  margin-top: 12px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ground);
  color: var(--ink-2);
}
.settings-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 13.5px; color: var(--ink); }
.settings-search input::placeholder { color: var(--ink-2); }
.settings-search:focus-within, .chats-filter:focus-within { border-color: #a9a9a4; }
.settings-group h4 { margin: 22px 0 5px; padding: 0 8px; font-size: 12.5px; font-weight: 400; color: var(--ink-2); }
.settings-group ul { display: grid; gap: 1px; }
.section-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 13.5px;
  text-align: left;
  transition: background-color 150ms ease;
}
.section-link .icon { color: var(--ink-2); }
.section-link .external { width: 13px; height: 13px; margin-left: auto; }
.section-link[aria-current='true'] { background: var(--selected); font-weight: 500; }
.section-link[aria-current='true'] .icon:first-child { color: var(--ink); }
.logout {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 16px 8px 6px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  text-align: left;
}
.logout .icon { color: var(--ink-2); }
.settings-groups { padding-bottom: 18px; }

.settings-content { position: relative; min-height: 0; overflow-y: auto; padding: 60px 48px 56px; }
.close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--ink-2);
  transition: background-color 150ms ease, transform 120ms var(--ease-out);
}
.close .icon { width: 18px; height: 18px; }
.close:active { transform: scale(0.95); }
.pane { max-width: 812px; margin: 0 auto; }
.pane-title { font-size: 20px; font-weight: 600; letter-spacing: -0.012em; margin-bottom: 18px; }
.pane-lead { margin: -8px 0 18px; font-size: 13.5px; color: var(--ink-2); }
.note { margin-top: 14px; font-size: 12.5px; color: var(--ink-3); }
.card { border: 1px solid var(--line); border-radius: 12px; background: var(--ground); }
.card + .card { margin-top: 12px; }
.row-card, .setting-row { display: flex; align-items: center; gap: 14px; padding: 16px 20px; }
.row-card strong, .setting-row strong { font-size: 14px; font-weight: 500; }
.setting-row > .icon { width: 18px; height: 18px; color: var(--ink-2); }
.fields { display: grid; gap: 14px; padding: 18px 20px; }
.field { display: grid; gap: 6px; }
.field span { font-size: 12.5px; color: var(--ink-2); }
.field input, .add-row input, .key-row input {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--ground);
  outline: 0;
  font-size: 13.5px;
}
.field input:focus, .add-row input:focus, .key-row input:focus { border-color: #a9a9a4; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: transform 120ms var(--ease-out), background-color 150ms ease, opacity 150ms ease;
}
.button:active:not(:disabled) { transform: scale(0.97); }
.button:disabled { opacity: 0.45; }
.button.outline { background: var(--ground); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.button.small { height: 32px; padding: 0 12px; font-size: 12.5px; }
.button.wide { width: 100%; }
.pane > .button { margin-top: 14px; }
.button[data-busy] .icon { animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.list li { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.list li + li { border-top: 1px solid var(--line); }
.list strong { font-size: 13.5px; font-weight: 500; }
.list > li > .icon { width: 18px; height: 18px; color: var(--ink-2); }
.list .tick { color: var(--accent); }
.icon-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--ink-3);
}
.add-row { display: flex; gap: 8px; margin-top: 12px; }
.add-row input { flex: 1; height: 38px; }

.switch {
  position: relative;
  width: 36px;
  height: 22px;
  flex: none;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background-color 160ms ease;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(22, 22, 22, 0.25);
  transition: transform 160ms var(--ease-out);
}
.switch[aria-checked='true'] { background: var(--accent); }
.switch[aria-checked='true']::after { transform: translateX(14px); }
.switch:disabled { opacity: 0.45; }

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ground);
}
.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--ink-2);
  transition: background-color 150ms ease, color 150ms ease;
}
.segmented button[aria-pressed='true'] { background: var(--ink); color: #fff; font-weight: 500; }
.badge {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
[aria-pressed='true'] > .badge { background: rgba(255, 255, 255, 0.18); }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tiles .card + .card { margin-top: 0; }
.tile { display: grid; gap: 8px; padding: 18px 20px; }
.tile strong { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.tile strong.small { font-size: 15px; font-weight: 500; letter-spacing: 0; }

/* subscriptions: the reference's plans, as the programs Kairos runs on */
.banner { display: flex; align-items: center; gap: 14px; padding: 15px 18px; }
.banner strong { font-size: 14.5px; font-weight: 500; }
.banner-orb { width: 26px; height: 26px; }
.eyebrow { margin: 26px 0 12px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.order {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-radius: 14px;
  background: var(--ground-soft);
}
.order-text strong { font-size: 13.5px; font-weight: 600; }
.order-line { margin: 6px 0 4px; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.order-line span { color: var(--ink-3); font-weight: 400; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px 22px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--ground);
}
.plan[data-first] { background: var(--surface-2); border-color: var(--line-strong); }
[data-accent='sage'] .plan[data-first] { background: var(--accent-soft); border-color: var(--accent-line); }
.plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  translate: -50% 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan h4 { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
.plan-desc { margin-top: 8px; min-height: 40px; font-size: 13.5px; color: var(--ink-2); }
.plan-state { margin-top: 14px; font-size: 30px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; }
.plan-meta { margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.callout {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--accent-line);
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: 12.5px;
  line-height: 1.45;
}
.callout .icon { width: 14px; height: 14px; margin-top: 2px; }
.callout code { white-space: nowrap; }
.plan .button { margin-top: 16px; }
.plan-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.plan-foot label { display: flex; align-items: center; gap: 8px; }
.text-button { font-size: 12.5px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.text-button:disabled { text-decoration: none; color: var(--ink-3); }
.local { padding: 18px 20px; }
.local-head { display: flex; gap: 14px; align-items: center; }
.local-head > .icon { width: 20px; height: 20px; color: var(--ink-2); }
.local-head strong { font-size: 14px; font-weight: 500; }
.speech { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.speech-option {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
  transition: border-color 150ms ease, background-color 150ms ease;
}
.speech-option strong { font-size: 13.5px; font-weight: 500; }
.speech-option span { font-size: 12px; color: var(--ink-2); }
.speech-option[aria-checked='true'] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
[data-accent='sage'] .speech-option[aria-checked='true'] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }

.key-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; align-items: center; gap: 12px; }
.key-row .grow small { font-size: 12px; color: var(--ink-3); }
.key-row small[data-problem] { color: var(--ink); }

@media (hover: hover) and (pointer: fine) {
  .section-link:not([aria-current='true']):hover, .logout:hover, .close:hover, .icon-button:hover { background: var(--press); }
  .org:hover { border-color: var(--line-strong); }
  .button:not(.outline):not(:disabled):hover { background: #2d2d2b; }
  .button.outline:not(:disabled):hover { background: var(--ground-soft); }
  .segmented button:not([aria-pressed='true']):hover { color: var(--ink); background: var(--press); }
  .speech-option:not([aria-checked='true']):hover { border-color: var(--line-strong); }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  translate: -50% 0;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-pop);
}
.toast:not([hidden]) { transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out); }
@starting-style {
  .toast:not([hidden]) { opacity: 0; transform: translateY(8px); }
}

/* ---- smaller windows ---- */

@media (max-width: 1100px) {
  .plans { grid-template-columns: 1fr; }
  .plan-desc { min-height: 0; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .plugin-grid, .project-row, .tiles, .speech { grid-template-columns: 1fr; }
  .plugins { width: calc(100% - 40px); }
  .display { font-size: 56px; }
  .settings-panel { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .settings-nav { max-height: 34vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .settings-content { padding: 56px 20px 40px; }
  .order, .key-row { display: grid; grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .settings, .settings[open], .model-menu, .reply, .toast { transform: none !important; }
  .mini-clips img { transition: none; }
  .button[data-busy] .icon { animation: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .settings[open]::backdrop { backdrop-filter: none; background: rgba(30, 30, 28, 0.45); }
  .mini-front { backdrop-filter: none; background: #f4f4f2; }
}
