@import url("./activity.css");
:root {
  /* Landing contract (witharosa.ai): pure-monochrome OKLCH ramp.
     Neutrals carry chroma 0; color lives in the answer, not the frame. */
  --mono-050: oklch(0.985 0 0);
  --mono-100: oklch(0.96 0 0);
  --mono-200: oklch(0.925 0 0);
  --mono-300: oklch(0.87 0 0);
  --mono-400: oklch(0.708 0 0);
  --mono-500: oklch(0.556 0 0);
  --mono-600: oklch(0.439 0 0);
  --mono-700: oklch(0.371 0 0);
  --mono-800: oklch(0.269 0 0);
  --mono-900: oklch(0.205 0 0);
  --mono-950: oklch(0.145 0 0);

  --bg: oklch(0.978 0 0);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.962 0 0);
  --surface-3: oklch(0.94 0 0);
  --ink: oklch(0.17 0 0);
  --ink-muted: oklch(0.42 0 0);
  --ink-faint: oklch(0.515 0 0);
  --line: oklch(0.895 0 0);
  --line-strong: oklch(0.82 0 0);
  --accent: var(--mono-900);
  --on-accent: oklch(0.97 0 0);
  --success: oklch(0.47 0.13 155);
  --warning: oklch(0.53 0.1 100);
  --danger: oklch(0.554 0.192 28);
  --info: oklch(0.5 0.11 255);

  /* Legacy app token names, now landing values (do not add new users). */
  --paper: var(--bg);
  --side: var(--surface-2);
  --white: var(--surface);
  --muted: var(--ink-muted);
  --green: var(--accent);
  --green-soft: var(--surface-2);
  --user: var(--surface-2);

  --r-2xs: 4px;
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-xl: 14px;
  --r-2xl: 16px;
  --r-3xl: 20px;
  --r-pill: 999px;
  --dur-1: 0.12s;
  --dur-2: 0.16s;
  --dur-3: 0.22s;
  --dur-4: 0.32s;
  --shadow-1: 0 1px 3px rgb(0 0 0 / 0.05), 0 2px 8px rgb(0 0 0 / 0.04);
  --shadow-2: 0 4px 16px rgb(0 0 0 / 0.07), 0 12px 36px rgb(0 0 0 / 0.06);
  --shadow-dialog: 0 16px 50px rgb(0 0 0 / 0.12), 0 24px 80px rgb(0 0 0 / 0.1);
  --shadow-toast: 0 6px 20px rgb(0 0 0 / 0.14);
  --sans: "Geist", system-ui, sans-serif;
  --serif: "Geist", system-ui, sans-serif;
  --nav-width: 240px;
  --content-width: 760px;
  --radius: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
  /* Checkboxes, radios and ranges stay monochrome in both themes. */
  accent-color: var(--ink);
}
html.dark {
  --shadow-1: 0 1px 3px rgb(0 0 0 / 0.35), 0 2px 10px rgb(0 0 0 / 0.3);
  --shadow-2: 0 4px 18px rgb(0 0 0 / 0.42), 0 14px 40px rgb(0 0 0 / 0.36);
  --shadow-dialog: 0 16px 50px rgb(0 0 0 / 0.5), 0 24px 80px rgb(0 0 0 / 0.44);
  --shadow-toast: 0 6px 20px rgb(0 0 0 / 0.5);
  --bg: oklch(0.145 0 0);
  --surface: oklch(0.185 0 0);
  --surface-2: oklch(0.225 0 0);
  --surface-3: oklch(0.275 0 0);
  --ink: oklch(0.96 0 0);
  --ink-muted: oklch(0.73 0 0);
  --ink-faint: oklch(0.66 0 0);
  --line: oklch(0.285 0 0);
  --line-strong: oklch(0.36 0 0);
  --accent: var(--mono-100);
  --on-accent: oklch(0.16 0 0);
  --success: oklch(0.78 0.15 155);
  --warning: oklch(0.84 0.1 95);
  --danger: oklch(0.68 0.16 28);
  --info: oklch(0.76 0.11 255);
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  height: 100dvh;
  display: flex;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.5 var(--sans);
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: transparent;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  background: var(--surface-2);
}
a {
  color: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
textarea:focus-visible {
  outline: none;
}
::placeholder {
  color: var(--ink-faint);
  opacity: 1;
}
::selection {
  background: color-mix(in oklch, var(--ink) 20%, var(--surface));
}
input,
textarea {
  caret-color: var(--ink);
}
input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  box-shadow: inset 0 0 0 100px var(--surface);
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: color-mix(in oklch, var(--ink) 22%, transparent);
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: var(--r-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: color-mix(in oklch, var(--ink) 38%, transparent);
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}
svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.symbols {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* Workspace shell */
.sidebar {
  width: var(--nav-width);
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--side);
  padding: 24px 12px 14px;
  border-right: 1px solid var(--line);
  overflow: hidden;
  transition:
    width 0.22s var(--ease),
    padding 0.22s var(--ease);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 500 21px/1 var(--sans);
  letter-spacing: -0.02em;
  margin: 0 12px 28px;
}
.brand-mark {
  display: block;
  width: 26px;
  height: 26px;
  flex: none;
}
.new-chat,
.nav-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  text-align: left;
  white-space: nowrap;
  font-weight: 500;
}
.new-chat {
  background: var(--green-soft);
  color: var(--green);
  margin-bottom: 6px;
}
.new-chat:hover {
  background: var(--surface-3);
}
.nav-search:hover,
.nav-item:hover,
.history-item:hover {
  background: var(--surface-2);
}
.new-chat span,
.nav-search span {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
}
.workspace-tools {
  display: flex;
  gap: 4px;
  margin: 16px 0 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 12px;
  min-width: 0;
}
.nav-item svg {
  width: 15px;
  height: 15px;
}
.count {
  color: var(--muted);
  font-size: 10px;
}
.nav-section {
  font-size: 11px;
  color: var(--muted);
  padding: 20px 12px 8px;
}
.sidebar #history {
  min-height: 0;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in oklch, var(--ink) 22%, transparent) transparent;
}
.history-item {
  display: block;
  width: 100%;
  border-radius: var(--r-sm);
  padding: 10px 12px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
  font-size: 13px;
}
.history-item[aria-current="true"] {
  background: var(--surface-3);
  color: var(--ink);
  font-weight: 500;
}
.history-item.is-opening {
  opacity: 0.55;
}
.sign-out.is-pending {
  opacity: 0.65;
  pointer-events: none;
}
.history-empty {
  margin: 8px 12px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.sidebar-bottom {
  padding-top: 16px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
}
.workspace-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
}
.workspace-logo {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--green);
  font-size: 12px;
}
.workspace-card strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
}
.workspace-card small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.status-dot {
  display: none;
}
.sidebar-footer {
  padding: 10px 10px 0;
  font-size: 10px;
  color: var(--muted);
}
.shell {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}
.topbar {
  height: 60px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  background: var(--paper);
  z-index: 2;
}
.breadcrumb {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.breadcrumb strong {
  font-size: 14px;
  font-weight: 550;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 36px;
  min-height: 36px;
  border-radius: var(--r-sm);
  color: var(--muted);
}
.icon-button:hover {
  background: var(--side);
  color: var(--ink);
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
}
.theme-toggle svg[hidden] {
  display: none;
}
.top-actions .context-toggle {
  padding: 0 10px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
}
.sidebar-close {
  display: none;
}
body.sidebar-collapsed .sidebar {
  width: 0;
  padding-left: 0;
  padding-right: 0;
  border: 0;
}
body.sidebar-collapsed .sidebar > * {
  visibility: hidden;
}
#main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in oklch, var(--ink) 18%, transparent) transparent;
}
/* Empty state */
.welcome {
  max-width: calc(var(--content-width) + 48px);
  margin: 0 auto;
  padding: clamp(56px, 14vh, 140px) 24px 40px;
  text-align: center;
}
.welcome-mark {
  width: 42px;
  height: 42px;
  margin: 0 auto 24px;
  display: block;
}
.welcome h1 {
  text-wrap: balance;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.8px;
  font-weight: 550;
  margin: 0 0 12px;
}
.intro {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 32px;
}
.welcome-input-target {
  width: 100%;
}
.suggestion-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 16px;
}
.suggestion-grid button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--r-3xl);
  background: var(--paper);
  padding: 8px 14px;
  font-size: 12px;
}
.suggestion-grid button:hover {
  background: var(--side);
  border-color: color-mix(in oklch, var(--ink) 25%, transparent);
}
.suggestion-grid svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}
.example-link {
  font-size: 12px;
  color: var(--muted);
  padding: 8px;
}
.example-link:hover {
  color: var(--green);
}
/* Conversation and typography */
.conversation {
  max-width: calc(var(--content-width) + 48px);
  margin: 0 auto;
  padding: 10px 24px 24px;
}
.conversation-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 10px;
  color: var(--muted);
  padding: 8px 0 28px;
}
.property-tag {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.property-tag svg {
  display: none;
}
.saved-label {
  white-space: nowrap;
  font-size: 10px;
}
.message {
  margin: 0 0 32px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
.message.user {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 32px;
}
.message.user > div {
  max-width: 86%;
  background: var(--user);
  padding: 12px 16px;
  border-radius: var(--r-3xl);
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
}
.assistant-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 550;
}
.assistant-logo {
  width: 25px;
  height: 25px;
  display: block;
}
.answer {
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.002em;
}
.answer p {
  margin: 0 0 16px;
}
.answer h1,
.answer h2,
.answer h3,
.answer h4 {
  font-size: 19px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -0.25px;
  margin: 28px 0 12px;
}
.answer h1 {
  font-size: 22px;
}
.answer > :first-child {
  margin-top: 0;
}
.answer .answer-lead-title {
  font-size: 24px;
  line-height: 1.28;
  font-weight: 650;
  letter-spacing: -0.024em;
  margin: 0 0 4px;
  text-wrap: balance;
}
.answer .answer-dateline {
  font-size: 13px;
  line-height: 1.45;
  font-weight: 450;
  color: var(--muted);
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.answer strong {
  font-weight: 600;
}
.answer ul,
.answer ol {
  padding-left: 24px;
  margin: 12px 0 20px;
}
.answer li {
  padding-left: 4px;
  margin: 8px 0;
}
.answer li::marker {
  color: var(--muted);
}
.answer blockquote {
  border-left: 2px solid color-mix(in oklch, var(--ink) 30%, transparent);
  margin: 20px 0;
  padding: 2px 16px;
  color: var(--muted);
}
.answer hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}
.answer code {
  font:
    13px/1.6 ui-monospace,
    monospace;
  background: var(--side);
  padding: 2px 6px;
  border-radius: var(--r-2xs);
}
.answer pre {
  padding: 14px;
  overflow: auto;
  border-radius: var(--r-md);
  background: var(--side);
}
.answer pre code {
  padding: 0;
}
.answer table {
  display: block;
  max-width: 100%;
  overflow: auto;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 13px;
}
.answer th,
.answer td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
  min-width: 100px;
  vertical-align: top;
}
.answer th {
  background: var(--side);
  font-weight: 550;
}
.citation {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  vertical-align: middle;
  margin: 0 2px;
  padding: 0 4px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  color: var(--ink-muted);
  font-size: 10px;
  line-height: 1;
}
.citation:hover {
  background: var(--surface-3);
}
.citation:focus-visible {
  outline-offset: 2px;
}
.answer-sources {
  display: inline-block;
  max-width: 100%;
  margin: 2px 0 10px;
  vertical-align: top;
}
.answer-sources > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.answer-sources summary::-webkit-details-marker {
  display: none;
}
.answer-sources > summary svg {
  width: 14px;
  height: 14px;
}
.answer-sources > summary::after {
  content: "⌄";
  margin-left: 4px;
}
.answer-sources[open] > summary {
  background: var(--side);
}
.source-list {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}
.source-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--white);
  font-size: 12px;
}
.source-card:hover {
  background: var(--side);
}
.source-card > span,
.source-card > div {
  min-width: 0;
  flex: 1;
}
.source-card strong {
  display: block;
  font-weight: 500;
  line-height: 1.5;
}
.source-card small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.source-card > svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
  margin-top: 2px;
}
.answer-actions {
  display: inline-flex;
  margin: 0 0 0 8px;
  vertical-align: top;
}
.copy-answer {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  color: var(--muted);
}
.copy-answer:hover {
  background: var(--side);
  color: var(--ink);
}
.copy-answer svg {
  width: 15px;
  height: 15px;
}
.message.error .answer {
  border-left: 2px solid var(--warning);
  padding: 10px 16px;
  color: var(--warning);
  background: color-mix(in oklch, var(--warning) 10%, var(--surface));
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.retry-button {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  margin-top: 8px;
  font-size: 12px;
}
.generated-view {
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  min-height: 100px;
  background: var(--paper);
}
.acres-sandbox > div {
  height: var(--acres-ui-height) !important;
}
/* Composer is outside the scrollport in a running conversation. */
.composer-dock {
  position: relative;
  flex: none;
  width: 100%;
  max-width: calc(var(--content-width) + 48px);
  margin: 0 auto;
  padding: 12px 24px max(12px, env(safe-area-inset-bottom));
  background: var(--paper);
  z-index: 3;
}
.welcome .composer-dock {
  padding: 0;
  max-width: none;
  background: transparent;
}
.welcome .composer-note {
  display: none;
}
.composer {
  position: relative;
  background: var(--white);
  border: 1px solid color-mix(in oklch, var(--ink) 18%, transparent);
  border-radius: var(--r-3xl);
  padding: 16px 16px 10px;
  box-shadow: var(--shadow-1);
  transition:
    border-color 0.16s ease-out,
    box-shadow 0.16s ease-out;
}
.composer:focus-within {
  border-color: color-mix(in oklch, var(--ink) 45%, transparent);
  box-shadow: var(--shadow-1);
}
.composer textarea {
  display: block;
  width: 100%;
  min-height: 28px;
  max-height: 160px;
  resize: none;
  overflow-y: hidden;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  font: 15px/1.6 var(--sans);
  color: var(--ink);
}
.composer textarea::placeholder {
  color: var(--ink-faint);
  opacity: 1;
}
.composer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  min-height: 32px;
}
.composer-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}
.composer-tools svg {
  width: 13px;
  height: 13px;
}
.composer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
#prompt-count {
  font-size: 10px;
  color: var(--muted);
}
.send-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green);
  color: var(--on-accent);
  transition:
    background 0.15s,
    transform 0.15s;
}
.send-button:hover:not(:disabled) {
  background: color-mix(in oklch, var(--accent) 85%, transparent);
  transform: translateY(-1px);
}
.send-button:active:not(:disabled) {
  transform: scale(0.93);
}
.send-button:disabled {
  background: var(--surface-3);
  color: var(--ink-faint);
  opacity: 1;
}
.send-button svg {
  width: 18px;
  height: 18px;
}
.composer-note {
  text-align: center;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  margin-top: 10px;
}
.run-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.run-controls:empty,
.message-queue:empty {
  display: none;
}
.run-controls button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 11px;
  background: var(--white);
}
.run-controls button:hover:not(:disabled) {
  background: var(--side);
}
.run-controls button svg {
  width: 13px;
  height: 13px;
}
.run-controls .stop-button {
  padding: 0;
  width: 32px;
}
.run-controls .stop-button svg {
  fill: currentColor;
  stroke-width: 0;
  width: 18px;
  height: 18px;
}
.message-queue {
  margin: 0 2px 8px;
  font-size: 11px;
}
.message-queue > strong {
  display: block;
  font-weight: 500;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 4px;
}
.message-queue > div {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--side);
  margin-top: 4px;
}
.message-queue span {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.message-queue button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  color: var(--muted);
}
.message-queue button svg {
  width: 13px;
  height: 13px;
}
.jump-latest {
  position: absolute;
  top: -44px;
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow-1);
  color: var(--ink);
}
/* Evidence stays outside the conversation layout. */
.context-panel {
  position: fixed;
  inset: 0 0 0 auto;
  width: 380px;
  max-width: calc(100vw - 24px);
  z-index: 30;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--paper);
  animation: drawer-enter 0.22s var(--ease);
}
.context-panel > header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  font-weight: 550;
}
.context-content {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 28px 24px 32px;
}
.section-kicker {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.context-content h2 {
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -0.5px;
  margin: 8px 0;
}
.muted {
  color: var(--muted);
  font-size: 12px;
}
.context-content dl {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  margin: 24px 0;
}
.context-content dl > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  margin: 12px 0;
  font-size: 13px;
}
.context-content dt {
  color: var(--muted);
}
.context-content dd {
  margin: 0;
}
.context-content h3 {
  font-size: 13px;
  margin: 24px 0 12px;
}
.context-content .source-card {
  margin-bottom: 8px;
}
.sample-note {
  font-size: 11px;
  line-height: 1.65;
  color: var(--muted);
  margin-top: 24px;
}
.context-scrim,
.nav-scrim {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.35);
  z-index: 25;
  animation: scrim-enter 0.18s ease-out;
}
/* Dialogs and feedback */
dialog {
  width: min(600px, calc(100% - 32px));
  max-height: min(80dvh, 760px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  padding: 24px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-dialog);
}
dialog::backdrop {
  background: rgb(0 0 0 / 0.45);
}
.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.dialog-header h2 {
  text-wrap: balance;
  font-size: 20px;
  line-height: 1.4;
  margin: 4px 0;
  font-weight: 550;
  letter-spacing: -0.3px;
}
#source-body {
  font-size: 14px;
  line-height: 1.75;
}
#source-body > a {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 12px;
  text-decoration: none;
  color: var(--green);
}
#source-body p {
  overflow-wrap: anywhere;
}
.source-excerpt {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 20px 0;
}
.source-parcel {
  white-space: normal;
  margin: 20px 0;
}
.source-parcel h3 {
  font-size: 14px;
  margin: 0 0 12px;
}
.source-parcel dl {
  margin: 0;
}
.source-parcel dl > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.source-parcel dt {
  color: var(--muted);
}
.source-parcel dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.source-status {
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
#conversation-search {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  font-size: 14px;
}
.search-note {
  font-size: 11px;
  color: var(--muted);
}
#search-results {
  margin: 16px -8px 0;
}
.search-empty {
  font-size: 13px;
  color: var(--muted);
  padding: 8px;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: var(--r-md);
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  box-shadow: var(--shadow-toast);
}
.session-notice {
  padding: 12px 20px;
  background: color-mix(in oklch, var(--warning) 14%, var(--surface));
  color: var(--warning);
  font-size: 13px;
}
.session-notice a {
  margin-left: 6px;
}
.session-notice.floating {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: max-content;
  max-width: calc(100vw - 32px);
  border: 1px solid color-mix(in oklch, var(--warning) 40%, var(--line));
  border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.25);
}
/* Sharing and teams */
#share-button {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: transparent; border-radius: var(--r-sm);
  padding: 8px 12px; font-size: 13px;
}
#share-button svg { width: 15px; height: 15px; color: var(--muted); }
#share-button:hover:not(:disabled) { background: var(--side); }
/* Account and sign out */
#sign-out {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: transparent; border-radius: var(--r-sm);
  padding: 8px 12px; font-size: 13px; text-decoration: none; white-space: nowrap;
}
#sign-out svg { width: 15px; height: 15px; color: var(--muted); }
#sign-out:hover { background: var(--side); }
.account-text { min-width: 0; flex: 1; }
.workspace-card strong, .workspace-card small {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-footer a { color: var(--muted); text-decoration: none; }
.sidebar-footer a:hover { color: var(--ink); text-decoration: underline; }
/* Teams in navigation */
.teams-nav {
  margin-top: 20px;
  min-width: 0;
}
.teams-nav-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 8px 12px;
}
.teams-nav-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
}
.teams-nav-title-wrap svg {
  width: 15px;
  height: 15px;
}
.teams-nav-header h2 {
  margin: 0;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 650;
}
.teams-nav-count {
  font-size: 10px;
  color: var(--muted);
  background: var(--surface-3);
  border-radius: var(--r-pill);
  padding: 2px 6px;
}
.teams-nav-count:empty { display: none; }
.teams-new-button {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  color: var(--green);
  font-size: 11px;
  font-weight: 600;
}
.teams-new-button svg { width: 13px; height: 13px; }
.teams-new-button:hover { background: var(--surface-2); }
#team-nav-list {
  display: grid;
  gap: 4px;
  max-height: 196px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in oklch, var(--ink) 22%, transparent) transparent;
  padding-right: 2px;
}
.team-nav-row {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: var(--r-sm);
  min-width: 0;
}
.team-nav-row[data-focused="true"] { background: var(--surface-3); }
.team-nav-select {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  text-align: left;
}
.team-nav-select:hover { background: var(--surface-2); }
.team-nav-row[data-focused="true"] .team-nav-select:hover { background: var(--surface-3); }
.team-avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.team-avatar.is-selected { background: var(--green); color: var(--on-accent); }
.team-avatar.large {
  width: 44px;
  height: 44px;
  border-radius: var(--r-xl);
  font-size: 14px;
}
.team-nav-row[data-focused="true"] .team-avatar,
.team-manager-row[aria-current="true"] .team-avatar {
  background: var(--green);
  color: var(--on-accent);
}
.team-nav-copy {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0;
}
.team-nav-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 600;
}
.team-nav-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}
.team-focus-check {
  display: inline-grid;
  place-items: center;
  color: var(--green);
}
.team-focus-check svg,
.team-nav-manage svg,
.team-row-chevron svg { width: 15px; height: 15px; }
.team-nav-manage {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: var(--r-sm);
  color: var(--muted);
}
.team-nav-manage:hover { background: var(--surface-2); color: var(--ink); }
.team-nav-scope {
  margin: 8px 12px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.team-nav-message {
  display: grid;
  gap: 6px;
  margin: 2px 4px;
  padding: 10px;
  border: 1px dashed color-mix(in oklch, var(--ink) 22%, transparent);
  border-radius: var(--r-md);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.team-nav-message strong { color: var(--ink); font-size: 12px; }
.team-nav-message.is-error {
  border-color: color-mix(in oklch, var(--danger) 40%, transparent);
  background: color-mix(in oklch, var(--danger) 10%, var(--surface));
  color: var(--danger);
}
.team-nav-message-action,
.team-inline-action {
  justify-self: start;
  padding: 4px 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 650;
}
.team-nav-message-action:hover,
.team-inline-action:hover { text-decoration: underline; }
.team-nav-loading,
.team-manager-loading {
  display: grid;
  gap: 6px;
  padding: 2px 4px;
}
.team-skeleton-row {
  display: block;
  height: 42px;
  border-radius: var(--r-sm);
  background: linear-gradient(100deg, var(--surface-3) 40%, color-mix(in oklch, var(--ink) 9%, var(--surface-3)) 50%, var(--surface-3) 60%);
  background-size: 200% 100%;
  animation: team-skeleton 1.5s ease-in-out infinite;
}
.team-skeleton-row.manager { height: 54px; }
.team-skeleton-row.detail { height: 52px; margin: 8px 0; }
@keyframes team-skeleton { from { background-position: 120% 0; } to { background-position: -80% 0; } }
.team-nav-inline-error {
  margin: 2px 8px 6px;
  color: var(--danger);
  font-size: 11px;
  line-height: 1.4;
}

/* Sharing with a team */
.share-section { padding: 14px 0 4px; }
.share-section + .share-section { border-top: 1px solid var(--line); margin-top: 12px; }
.share-section-heading h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 620;
}
.share-section-heading p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.share-team-note {
  margin: -3px 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.share-team-note:empty { display: none; }
.share-team-empty {
  margin: 2px 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.text-button {
  padding: 2px 0;
  color: var(--green);
  font-weight: 650;
}
.text-button:hover { text-decoration: underline; }

/* Team manager */
#team-dialog {
  width: min(880px, calc(100% - 32px));
  height: min(720px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
}
#team-dialog[open] {
  display: flex;
  flex-direction: column;
}
.team-dialog-header {
  flex: none;
  margin: 0;
  padding: 24px 24px 16px;
}
.team-dialog-header h2 { font-size: 22px; }
.team-dialog-intro {
  max-width: 620px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.team-notice {
  flex: none;
  margin: 0 24px 14px;
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
}
.team-notice:empty { display: none; }
.team-notice[data-tone="success"] { background: var(--green-soft); color: var(--success); }
.team-notice[data-tone="error"] { background: color-mix(in oklch, var(--danger) 10%, var(--surface)); color: var(--danger); }
.team-notice[data-tone="info"] { background: var(--side); color: var(--ink); }
.team-manager {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 262px minmax(0, 1fr);
  border-top: 1px solid var(--line);
}
.team-manager-rail {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--side);
  border-right: 1px solid var(--line);
  padding: 20px 14px 14px;
}
.team-rail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px 12px;
}
.team-rail-header h3 { margin: 0; font-size: 14px; font-weight: 650; }
.team-rail-header p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.team-search-wrap {
  position: relative;
  margin-bottom: 10px;
}
.team-search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.team-search-wrap input,
.team-form input[type="email"],
.team-form input[type="text"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 0 12px;
  font-size: 14px;
}
.team-search-wrap input { min-height: 38px; padding-left: 32px; font-size: 13px; }
.team-manager-list {
  display: grid;
  align-content: start;
  gap: 6px;
  overflow-y: auto;
  min-height: 0;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in oklch, var(--ink) 22%, transparent) transparent;
}
.team-manager-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 8px 10px;
  border-radius: var(--r-lg);
  text-align: left;
}
.team-manager-row:hover { background: var(--surface-2); }
.team-manager-row[aria-current="true"] { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.team-manager-row .team-nav-copy strong { font-size: 13px; }
.team-manager-row .team-nav-copy small { font-size: 11px; }
.team-default-badge,
.team-default-chip {
  flex: none;
  border-radius: var(--r-pill);
  background: var(--green-soft);
  color: var(--green);
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 700;
}
.team-row-chevron { display: inline-grid; place-items: center; color: var(--muted); }
.team-rail-note {
  margin: 2px 4px 0;
  padding-top: 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.team-manager-message {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.team-manager-message strong { color: var(--ink); }
.team-manager-message p { margin: 0; }
.team-manager-message.is-error { background: color-mix(in oklch, var(--danger) 10%, var(--surface)); color: var(--danger); }
.team-manager-message.is-error strong { color: var(--danger); }
.team-manager-message.detail { max-width: 520px; background: color-mix(in oklch, var(--danger) 10%, var(--surface)); }
.team-detail {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 24px 28px;
  background: var(--paper);
  scrollbar-width: thin;
  scrollbar-color: color-mix(in oklch, var(--ink) 18%, transparent) transparent;
}
.team-detail:has(> .team-detail-header) {
  padding-top: 0;
}
.team-detail-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 -24px;
  padding: 24px 24px 12px;
  background: var(--paper);
}
.team-detail-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.team-detail-copy { min-width: 0; }
.team-detail-copy h3,
.team-create-panel h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}
.team-detail-copy h3:focus-visible { outline-offset: 5px; }
.team-detail-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.team-scope-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 20px;
  padding: 12px 12px;
  border-radius: var(--r-lg);
  background: var(--green-soft);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}
.team-scope-note p { margin: 0; }
.team-scope-icon { display: inline-grid; place-items: center; padding-top: 2px; }
.team-scope-icon svg { width: 16px; height: 16px; }
.team-tabs {
  display: inline-flex;
  gap: 4px;
  margin-top: 20px;
  padding: 4px;
  border-radius: var(--r-lg);
  background: var(--side);
}
.team-tab {
  min-height: 34px;
  border-radius: var(--r-sm);
  padding: 8px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.team-tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.team-panel { padding-top: 20px; }
.team-detail-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.team-detail-intro {
  max-width: 560px;
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.team-create-panel { max-width: 560px; padding-top: 8px; }
.team-form { display: grid; gap: 8px; }
.team-form.inline { gap: 8px; }
.team-field-label {
  font-size: 13px;
  font-weight: 650;
}
.team-inline-field {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.team-inline-field input { flex: 1; min-width: 0; }
.team-field-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.team-char-count { flex: none; }
.team-field-help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.team-field-error {
  margin: 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.5;
}
.team-form input[aria-invalid="true"] { border-color: color-mix(in oklch, var(--danger) 40%, transparent); }
.team-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.team-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.team-button:hover:not(:disabled) { background: var(--side); }
.team-button.primary { border-color: var(--green); background: var(--green); color: var(--on-accent); }
.team-button.primary:hover:not(:disabled) { background: color-mix(in oklch, var(--accent) 85%, transparent); }
.team-button.ghost { background: transparent; }
.team-button.compact { min-height: 32px; padding: 6px 10px; font-size: 12px; }
.team-button.danger { border-color: var(--danger); background: var(--danger); color: var(--on-accent); }
.team-button.danger-outline { border-color: color-mix(in oklch, var(--danger) 40%, transparent); color: var(--danger); background: var(--surface); }
.team-button:disabled { cursor: default; opacity: 0.45; }
.team-add-card {
  padding: 16px;
  border-radius: var(--r-xl);
  background: var(--side);
}
.team-add-card h4,
.team-settings-title,
.team-danger-zone h4 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 650;
}
.team-add-card > p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.team-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 4px;
}
.team-section-heading h4 { margin: 0; font-size: 14px; font-weight: 650; }
.team-section-count { color: var(--muted); font-size: 12px; }
.team-member-list .member-row:first-child { border-top: 0; }
.team-readonly-note {
  display: grid;
  gap: 4px;
  padding: 14px 14px;
  border-radius: var(--r-lg);
  background: var(--side);
  font-size: 13px;
  line-height: 1.55;
}
.team-readonly-note p { margin: 0; color: var(--muted); }
.team-confirm-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.team-facts {
  margin: 24px 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.team-facts > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 0;
  font-size: 13px;
}
.team-facts > div + div { border-top: 1px solid var(--line); }
.team-facts dt { color: var(--muted); }
.team-facts dd { margin: 0; overflow-wrap: anywhere; }
.team-form.settings { max-width: 620px; }
.team-danger-zone {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid color-mix(in oklch, var(--danger) 40%, transparent);
}
.team-danger-zone p {
  max-width: 620px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.team-detail-loading { max-width: 560px; padding-top: 8px; }
.team-detail-loading h3 { margin: 0; font-size: 21px; }
select:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

@media (max-width: 760px) {
  #team-dialog {
    width: calc(100% - 20px);
    height: calc(100dvh - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: var(--r-2xl);
  }
  .team-dialog-header { padding: 20px 20px 14px; }
  .team-notice { margin: 0 20px 12px; }
  .team-manager { display: flex; flex-direction: column; }
  .team-manager-rail {
    flex: none;
    max-height: 218px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px 12px 12px;
  }
  .team-rail-header { padding: 0 2px 10px; }
  .team-manager-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 6px;
    scrollbar-width: none;
  }
  .team-manager-list::-webkit-scrollbar { display: none; }
  .team-manager-row { flex: 0 0 202px; }
  .team-manager-row .team-default-badge { display: none; }
  .team-manager-message { min-width: 220px; }
  .team-rail-note { display: none; }
  .team-detail { padding: 20px 20px 24px; }
  .team-detail-header { margin: 0 -20px; padding: 20px 20px 10px; align-items: center; }
  .team-detail-copy h3, .team-create-panel h3 { font-size: 19px; }
  .team-tabs { display: flex; width: 100%; }
  .team-tab { flex: 1; }
  .team-inline-field { flex-direction: column; }
  .team-inline-field .team-button { width: 100%; }
  .team-form-actions { flex-direction: column-reverse; }
  .team-form-actions .team-button { width: 100%; }
  .team-confirm-actions { flex-wrap: wrap; justify-content: flex-end; }
  .team-facts > div { grid-template-columns: 92px minmax(0, 1fr); }
}
.history-item .history-title {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.history-meta {
  display: flex; align-items: center; gap: 6px; margin-top: 4px;
  font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden;
}
.shared-label {
  font-weight: 600; color: var(--green); background: var(--green-soft);
  border-radius: var(--r-xs); padding: 2px 6px;
}
.author-avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--green); color: var(--on-accent); font-size: 9px; font-weight: 600;
}
.author-avatar.small { width: 18px; height: 18px; font-size: 8px; background: color-mix(in oklch, var(--ink) 45%, var(--bg)); }
.message.user > div.user-turn {
  background: transparent; padding: 0; max-width: 86%;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.user-bubble {
  background: var(--user); padding: 12px 16px; border-radius: var(--r-3xl);
  font-size: 15px; line-height: 1.65; white-space: pre-wrap;
}
.author-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 550; color: var(--muted);
}
.run-asking { font-size: 11px; color: var(--muted); align-self: center; }
.viewer-notice {
  text-align: center; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: var(--r-xl); background: var(--white); font-size: 13px; color: var(--muted);
}
.access-note {
  max-width: 520px; margin: 0 auto 20px; padding: 10px 14px;
  background: color-mix(in oklch, var(--warning) 14%, var(--surface)); color: var(--warning); border-radius: var(--r-md); font-size: 13px;
}
.share-form {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px;
}
.share-form input[type="email"], .share-form input[type="text"] {
  flex: 1; min-width: 180px; height: 42px; border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--surface); color: var(--ink); padding: 0 12px; font-size: 14px;
}
.share-form select, .member-row select {
  height: 42px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); padding: 0 8px; font-size: 13px;
}
.member-row select { height: 34px; }
.share-form button, .share-link-row > button, .member-row button {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--r-md);
  padding: 10px 12px; font-size: 12px; white-space: nowrap;
}
.share-form button:hover, .share-link-row > button:hover,
.member-row button:hover { background: var(--side); }
.share-link-row { display: flex; gap: 8px; align-items: center; margin: 4px 0 12px; }
.share-link-row input {
  flex: 1; height: 38px; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 0 10px; font-size: 12px; color: var(--muted); background: var(--surface);
}
.share-members-heading { font-size: 13px; margin: 20px 0 10px; }
.member-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-top: 1px solid var(--line); font-size: 13px;
}
.member-row .member-name { flex: 1; min-width: 0; }
.member-row .member-name strong { display: block; font-weight: 550; }
.member-row .member-name small { display: block; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.member-role { font-size: 11px; color: var(--muted); text-transform: capitalize; }
#share-notice:not(:empty) {
  font-size: 13px; line-height: 1.5; background: var(--green-soft);
  padding: 10px 12px; border-radius: var(--r-sm);
}
@media (max-width: 600px) {
  /* The actions row scrolls within itself rather than widening the page. */
  .top-actions { gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  /* Floor plan and Export Deck shrink to their icons; each keeps its name for assistive technology. */
  .top-actions #export-deck-button { width: 40px; height: 40px; padding: 0; justify-content: center; flex: none; }
  #export-deck-button .deck-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .theme-toggle { min-width: 32px; min-height: 32px; }
  #share-button { font-size: 11px; padding: 8px; }
  #sign-out { padding: 8px 10px; }
  #sign-out span { display: none; }
  .share-form { flex-direction: column; align-items: stretch; }
}
@media (max-width: 440px) {
  /* Too narrow for a readable title beside the actions; the page itself names the view. */
  body:not(.core-mode) .breadcrumb { display: none; }
}
/* Motion has a single owner and never repeats on streamed tokens. */
.new-message {
  animation: message-enter 0.2s var(--ease);
}
@keyframes message-enter {
  from {
    opacity: 0.3;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes drawer-enter {
  from {
    transform: translateX(24px);
    opacity: 0.5;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes scrim-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.live-answer .answer:last-child > :last-child::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  vertical-align: middle;
  border-radius: 50%;
  background: var(--green);
  margin-left: 6px;
}
@media (max-width: 850px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 270px;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.22s var(--ease);
    padding-top: 24px;
    visibility: hidden;
  }
  .sidebar.open {
    visibility: visible;
    transform: none;
  }
  .sidebar-close {
    display: flex;
    position: absolute;
    top: 16px;
    right: 12px;
  }
  .sidebar .brand {
    margin-bottom: 28px;
  }
  .nav-scrim {
    z-index: 35;
  }
  .shell {
    width: 100%;
  }
  .topbar {
    height: 56px;
    padding: 0 12px;
    gap: 10px;
  }
  .top-actions .context-toggle {
    border: 0;
    min-width: 40px;
  }
  .context-label {
    display: none;
  }
  .icon-button {
    min-height: 40px;
    min-width: 40px;
  }
  .breadcrumb strong {
    font-size: 13px;
  }
  .welcome {
    padding: 48px 20px 32px;
  }
  .welcome h1 {
    font-size: 28px;
  }
  .intro {
    font-size: 14px;
  }
  .suggestion-grid {
    gap: 8px;
  }
  .suggestion-grid button {
    min-height: 40px;
  }
  .conversation {
    padding: 8px 20px 20px;
  }
  .conversation-heading {
    padding-bottom: 24px;
  }
  .message {
    margin-bottom: 28px;
  }
  .message.user > div {
    max-width: 90%;
    font-size: 15px;
  }
  .answer {
    font-size: 16px;
    line-height: 1.8;
  }
  .answer h1,
  .answer h2,
  .answer h3 {
    font-size: 18px;
  }
  .composer-dock {
    padding: 10px 14px max(10px, env(safe-area-inset-bottom));
  }
  .composer {
    padding: 14px 14px 10px;
    border-radius: var(--r-2xl);
  }
  .composer textarea {
    font-size: 16px;
    line-height: 1.5;
  }
  .composer-note {
    font-size: 10px;
  }
  .run-controls button {
    height: 34px;
  }
  .run-controls .stop-button {
    height: 34px;
    width: 34px;
  }
  .send-button {
    width: 36px;
    height: 36px;
  }
  .context-panel {
    width: 360px;
  }
  .context-content {
    padding: 24px 20px;
  }
  .research-activity > summary {
    min-height: 38px;
  }
  .answer-actions .copy-answer {
    width: 36px;
    height: 36px;
  }
  .source-card {
    min-height: 52px;
  }
  dialog {
    padding: 20px;
    border-radius: var(--r-xl);
  }
  .topbar + .session-notice {
    font-size: 12px;
  }
}
@media (max-width: 380px) {
  .composer-tools span {
    font-size: 10px;
  }
  .run-controls button {
    padding: 0 8px;
  }
  .suggestion-grid {
    flex-direction: column;
    align-items: center;
  }
  .welcome {
    padding-top: 40px;
  }
}

/* Polish system: shared motion, control states and loading.
   Every interactive element gets the same short, quiet transitions;
   motion only ever communicates state (see DESIGN.md). */
.new-chat, .nav-search, .nav-item, .history-item, .icon-button,
.suggestion-grid button, .example-link, .citation, .answer-sources > summary,
.source-card, .copy-answer, .retry-button, .run-controls button,
.message-queue button, .jump-latest, #share-button, #sign-out,
.teams-new-button, .team-nav-row, .team-nav-select, .team-nav-manage,
.team-inline-action, .team-nav-message-action, .text-button,
.team-manager-row, .team-tab, .team-button, .share-form button,
.share-link-row > button, .member-row button, .concept-open,
.concept-toolbar button, .sidebar-footer a, #source-body > a,
.team-search-wrap input, .team-form input, .share-form input,
.share-form select, .member-row select, #conversation-search,
.share-link-row input, .wallet-topups button, #refresh-wallet, #wallet-button {
  transition:
    background-color var(--dur-2) var(--ease),
    border-color var(--dur-2) var(--ease),
    color var(--dur-2) var(--ease),
    box-shadow var(--dur-2) var(--ease),
    transform var(--dur-1) var(--ease),
    opacity var(--dur-2) var(--ease);
}
.new-chat:active, .nav-search:active, .nav-item:active, .history-item:active,
.suggestion-grid button:active, .source-card:active, .retry-button:active,
.run-controls button:active:not(:disabled), .team-manager-row:active,
.team-button:active:not(:disabled), .share-form button:active,
.member-row button:active, .concept-open:active,
.concept-toolbar button:active, .wallet-topups button:active {
  background: var(--surface-3);
}
.icon-button:active, .copy-answer:active, .jump-latest:active,
.message-queue button:active, .team-nav-manage:active,
#share-button:active:not(:disabled), #sign-out:active {
  transform: scale(0.94);
}
.team-button:active:not(:disabled), .share-form button:active,
.member-row button:active, .concept-open:active, .concept-toolbar button:active {
  transform: scale(0.98);
}
.team-search-wrap input:focus, .team-form input:focus,
.share-form input:focus, .share-form select:focus, .member-row select:focus,
#conversation-search:focus, .share-link-row input:focus {
  outline: none;
  border-color: color-mix(in oklch, var(--ink) 45%, transparent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ink) 12%, transparent);
}
.team-form input[aria-invalid="true"]:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--danger) 18%, transparent);
}
.answer a, .source-excerpt a, .concept-note a {
  text-decoration: underline;
  text-decoration-color: color-mix(in oklch, var(--ink) 35%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--dur-2) var(--ease);
}
.answer a:hover, .source-excerpt a:hover, .concept-note a:hover {
  text-decoration-color: var(--ink);
}
dialog {
  scrollbar-gutter: stable;
}
dialog[open] {
  animation: dialog-enter var(--dur-3) var(--ease);
}
dialog::backdrop {
  animation: scrim-enter var(--dur-2) ease-out;
}
@keyframes dialog-enter {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to { opacity: 1; transform: none; }
}
.toast {
  animation: toast-enter var(--dur-3) var(--ease);
}
@keyframes toast-enter {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.context-panel {
  box-shadow: var(--shadow-2);
}
.is-busy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.is-busy::after {
  content: "";
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid color-mix(in oklch, currentColor 30%, transparent);
  border-top-color: currentColor;
  animation: busy-spin 0.7s linear infinite;
}
@keyframes busy-spin {
  to { transform: rotate(360deg); }
}
#workspace-loading {
  background: var(--paper);
  animation: scrim-enter var(--dur-3) ease-out;
}
.history-item, .team-nav-row, .team-manager-row {
  scroll-margin: 6px;
}

/* Accessibility & output modes */
@media (prefers-contrast: more) {
  :root {
    --ink-muted: oklch(0.34 0 0);
    --ink-faint: oklch(0.42 0 0);
    --line: oklch(0.78 0 0);
    --line-strong: oklch(0.66 0 0);
  }
  html.dark {
    --ink-muted: oklch(0.84 0 0);
    --ink-faint: oklch(0.76 0 0);
    --line: oklch(0.42 0 0);
    --line-strong: oklch(0.54 0 0);
  }
}
@media (forced-colors: active) {
  .composer, dialog, .team-add-card, .generated-view, .concept-canvas {
    border: 1px solid CanvasText;
  }
  .send-button, .team-button.primary, .author-avatar, .team-avatar.is-selected {
    forced-color-adjust: none;
  }
  .citation, .shared-label, .team-default-badge, .team-default-chip {
    border: 1px solid CanvasText;
  }
}
@media print {
  .sidebar, .topbar, .composer-dock, .context-panel, .context-scrim,
  .nav-scrim, .toast, .jump-latest, .answer-actions, .run-controls {
    display: none !important;
  }
  body, .shell, #main {
    height: auto;
    overflow: visible;
    background: #fff;
    color: #000;
  }
  .conversation { max-width: none; }
  .message, .concept-card { break-inside: avoid; }
  a { text-decoration: underline; }
}
@media (max-width: 850px) {
  .share-form input, .team-form input, .team-search-wrap input,
  #conversation-search, .share-link-row input {
    font-size: 16px;
  }
  .citation { min-width: 24px; height: 24px; }
  .teams-new-button { min-height: 36px; padding: 6px 10px; }
  .team-nav-manage { width: 38px; height: 38px; }
  .member-row button, .share-form button { min-height: 38px; }
  .team-tab { min-height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.booting .sidebar,
.booting .shell {
  visibility: hidden;
}
#workspace-loading {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
}
.workspace-loading-content {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}
#workspace-loading .research-dots {
  display: flex;
}

/* Development concepts */
.concept-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 4px;
}
.concept-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--paper);
}
.concept-card strong {
  font-size: 15px;
}
.concept-card small {
  color: var(--muted);
  font-size: 13px;
}
.concept-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}
.concept-compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 4px;
}
.concept-compare caption {
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0 6px;
}
.concept-compare th,
.concept-compare td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.concept-compare thead th {
  font-weight: 600;
}
.concept-compare tbody th {
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.concept-open {
  justify-self: start;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 8px 14px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.concept-open:hover {
  background: var(--surface-2);
}
#concept-dialog {
  width: min(1100px, calc(100% - 32px));
  max-height: min(92dvh, 980px);
}
#concept-summary {
  margin: -6px 0 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
#concept-summary:empty {
  display: none;
}
.concept-view {
  display: grid;
  gap: 14px;
}
.concept-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.concept-toolbar button {
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.concept-toolbar button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.concept-canvas {
  position: relative;
  height: min(520px, 55dvh);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--surface-2);
}
.concept-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.concept-canvas > div {
  position: absolute;
  inset: 0;
}
.concept-plan {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: var(--surface-2);
  /* The plan is drawn in metres; undo the icon stroke that the global svg rule would inherit. */
  stroke: none;
  stroke-width: 0;
  stroke-linecap: butt;
  stroke-linejoin: miter;
  fill: none;
}
.concept-toolbar .concept-toggle {
  margin-left: auto;
}
.concept-toolbar .concept-toggle + .concept-toggle {
  margin-left: 0;
}
.concept-attribution {
  position: absolute;
  left: 8px;
  bottom: 6px;
  max-width: calc(100% - 16px);
  padding: 2px 8px;
  border-radius: var(--r-sm);
  background: color-mix(in oklch, var(--surface) 86%, transparent);
  backdrop-filter: blur(6px);
  color: var(--ink);
  font-size: 11px;
  line-height: 1.4;
  pointer-events: none;
}
.concept-attribution strong {
  font-weight: 600;
  margin-right: 6px;
}
.concept-photo {
  margin: 0;
  display: grid;
  gap: 8px;
}
.concept-photo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: cover;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.concept-photo figcaption {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.concept-places {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 16px;
  font-size: 13px;
}
.concept-places dt {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
}
.concept-places dd {
  margin: 0 0 2px;
}
.concept-places small {
  color: var(--muted);
}
.concept-fallback {
  margin: 0;
  padding: 20px;
  font-size: 14px;
  color: var(--muted);
}
.concept-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 0;
}
.concept-metrics div {
  padding: 10px 12px;
  border-radius: var(--r-lg);
  background: var(--surface-2);
}
.concept-metrics dt {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.concept-metrics dd {
  margin: 2px 0 0;
  font-size: 17px;
  font-weight: 600;
}
.concept-compliance {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  margin: 0.6rem 0;
  padding: 0.5rem 0.7rem;
  border: 1px solid color-mix(in oklch, var(--warning) 45%, transparent);
  background: color-mix(in oklch, var(--warning) 10%, var(--surface));
  border-radius: var(--r-xs);
  font-size: 0.85rem;
}
.concept-compliance[data-compliant="false"] {
  border-color: color-mix(in oklch, var(--danger) 40%, transparent);
  background: color-mix(in oklch, var(--danger) 10%, var(--surface));
}
.concept-compliance ul {
  margin: 0;
  padding-left: 1rem;
}
.concept-levels {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.concept-levels th,
.concept-levels td {
  padding: 8px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.concept-levels th {
  font-weight: 600;
  color: var(--muted);
}
.concept-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
@media (max-width: 600px) {
  .concept-canvas {
    height: 46dvh;
  }
}
/* Architecture walkthrough: Plan, Dollhouse and Walk share the concept viewer's frame. */
.arch-select {
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 6px 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
}
.arch-eye {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.arch-eye input {
  width: 96px;
}
.arch-eye output {
  min-width: 4.5ch;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.arch-notice {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  font-size: 13px;
  color: var(--ink);
  background: var(--surface-2);
}
.arch-canvas .arch-stage[hidden] {
  display: none;
}
.arch-plan .arch-room {
  cursor: pointer;
  transition: fill var(--dur-2) var(--ease);
}
.arch-plan .arch-room:hover {
  fill: var(--arch-room-hover);
}
.arch-canvas .arch-minimap {
  inset: 12px 12px auto auto;
  width: min(34%, 200px);
  height: auto;
  aspect-ratio: 5 / 4;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  pointer-events: none;
}
.arch-hud {
  position: absolute;
  left: 12px;
  top: 12px;
  margin: 0;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 13px;
  color: var(--ink);
  background: color-mix(in oklch, var(--surface) 88%, transparent);
  pointer-events: none;
}
.arch-canvas .arch-stick {
  position: absolute;
  inset: auto auto 20px 20px;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: color-mix(in oklch, var(--surface) 55%, transparent);
  touch-action: none;
  display: grid;
  place-items: center;
}
.arch-stick span {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.7;
}
.arch-selection {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  font-size: 14px;
  color: var(--muted);
}
.arch-selection strong {
  color: var(--ink);
}
.arch-selection button {
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
@media (max-width: 600px) {
  .arch-view .concept-toolbar button,
  .arch-view .arch-select,
  .arch-view .arch-selection button,
  .arch-view .arch-eye input {
    min-height: 44px;
  }
  .arch-view .arch-select {
    min-width: 0;
    max-width: 100%;
  }
}

#export-deck-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  white-space: nowrap;
  padding: 0 11px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
#export-deck-button svg {
  width: 14px;
  height: 14px;
}
#export-deck-button:hover:not(:disabled) {
  background: var(--surface-2);
}
#export-deck-button:disabled {
  opacity: 0.45;
  cursor: default;
}
.attach-plan-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.attach-plan-btn svg {
  width: 13px;
  height: 13px;
}
.attach-plan-btn:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.use-saved-filters { min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-pill); font-size: 12px; color: var(--ink-muted); }
.use-saved-filters:hover { background: var(--surface-2); color: var(--ink); }

.listing-searches { display: grid; gap: 8px; min-width: 0; margin: 16px 0; color: var(--ink-muted); font-size: 12px; line-height: 1.5; }
.listing-searches h3 { margin: 0; font: inherit; font-weight: 600; }
.listing-searches details { min-width: 0; border: 1px solid var(--line); border-radius: var(--r-md); }
.listing-searches summary { padding: 10px 12px; cursor: pointer; overflow-wrap: anywhere; color: var(--ink); }
.listing-search-details { padding: 0 12px 12px; overflow-wrap: anywhere; }
.listing-search-details p { margin: 6px 0; }
.listing-search-source { min-height: 32px; margin-top: 8px; padding: 4px 10px; max-width: 100%; border: 1px solid var(--line); border-radius: var(--r-pill); color: var(--ink); }
.listing-search-source:hover { background: var(--surface-2); }

/* ---------- Design pass: chat, sharing and loading states ---------- */
/* The save line appears only while it has news. */
.saved-label[hidden] { display: none; }

/* An example question is an action in place, so it reads as a chip, not a link out. */
.welcome-links .example-link {
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 12.5px;
}
.welcome-links .example-link:hover:not(:disabled) { border-color: var(--line-strong); color: var(--ink); }

/* Sources, opened, take the answer's width and scroll inside a bounded list. */
.message .answer-sources[open] { display: block; }
.message .answer-sources[open] > summary { width: fit-content; }
.message .answer-sources[open] + .answer-actions { display: none; }
.message .answer-sources .source-list {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  max-height: min(340px, 42vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

/* Wallet: the rail item is named Wallet; the balance is a quiet badge beside it. */
.sidebar .nav-item .rail-badge { margin-left: auto; padding: 1px 7px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-muted); font: 500 11.5px/16px var(--sans); font-variant-numeric: tabular-nums; }
.sidebar .nav-item .rail-badge[hidden], body.sidebar-collapsed .sidebar .nav-item .rail-badge { display: none; }

/* Loading placeholders, each shaped like what replaces it. */
.history-skeleton { display: grid; gap: 14px; margin: 10px 10px; }
.dialog-skeleton { display: grid; gap: 12px; margin-bottom: 16px; }
.search-skeleton { display: grid; gap: 16px; padding: 12px; }
.activity-skeleton { display: grid; gap: 12px; margin: 10px 0 4px 30px; }
.context-skeleton { display: grid; gap: 6px; }
.context-skeleton-facts { display: grid; grid-template-columns: 110px 1fr; gap: 14px 12px; margin: 22px 0; padding: 16px 0; border-block: 1px solid var(--line); }
.concept-skeleton { padding: 0; }
.generated-view { position: relative; }
.generated-skeleton { display: flex; flex-direction: column; gap: 10px; padding: 18px; }
.acres-sandbox.is-preparing { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
#account-email .skel { display: inline-block; vertical-align: middle; }

/* Property & sources: facts with values only; a field the record lacks reads quietly. */
.context-content dd.muted { font-size: 13px; }

/* Share: one invite field, the people with access, then Copy link as the one primary action. */
#share-dialog[open] { display: flex; flex-direction: column; }
#share-dialog > .dialog-header { order: 0; margin-bottom: 16px; }
#share-dialog > #share-notice { order: 1; margin: 0 0 12px; }
#share-dialog > #share-notice:empty { display: none; }
#share-manage { display: contents; }
#share-manage[hidden] { display: none; }
.share-invite { order: 2; display: flex; gap: 8px; margin: 0; }
.share-invite input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font-size: 14px; }
.share-invite input::placeholder { color: var(--ink-faint); }
.share-invite select { height: 40px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font-size: 13px; }
.share-invite button { height: 40px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 550; white-space: nowrap; }
.share-invite button:hover:not(:disabled) { background: var(--surface-2); }
.share-invite :is(input, select, button):focus-visible { outline: 2px solid color-mix(in oklch, var(--ink) 40%, transparent); outline-offset: 1px; }
#share-dialog > .share-members-heading { order: 3; margin: 20px 0 4px; }
#share-dialog > #share-members { order: 4; }
.share-footer { order: 5; display: grid; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.share-link-actions { display: flex; align-items: center; gap: 12px; min-width: 0; }
.share-primary { display: inline-flex; align-items: center; gap: 7px; flex: none; height: 38px; padding: 0 16px; border: 0; border-radius: var(--r-md); background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 600; }
.share-primary svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.share-primary:hover:not(:disabled) { background: color-mix(in oklch, var(--ink) 86%, var(--bg)); }
.share-link-reason { flex: 1; min-width: 0; color: var(--ink-muted); font-size: 12.5px; line-height: 1.4; }
.share-more { flex: none; }
.share-more > summary { min-height: 34px; padding: 0 12px; border-color: var(--line); font-size: 12.5px; }
#share-link-url { height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink-muted); font-size: 12px; }
.share-menu { width: min(360px, calc(100vw - 24px)); gap: 0; padding: 4px 14px; }
.share-menu-section { padding: 12px 0; }
.share-menu-section + .share-menu-section { border-top: 1px solid var(--line); }
.share-menu-section h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.share-team-form { display: flex; gap: 6px; }
.share-team-form[hidden] { display: none; }
.share-team-form select { flex: 1; min-width: 0; height: 34px; padding: 0 6px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-size: 12.5px; }
.share-team-form select + label + select { flex: none; }
.share-team-form button { height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-size: 12.5px; font-weight: 550; }
.share-team-form button:hover:not(:disabled) { background: var(--surface-2); }
.share-menu .share-team-note { margin: 8px 0 0; font-size: 12px; }
.share-menu .share-team-empty { margin: 0; font-size: 12.5px; }
.share-menu-empty { margin: 0; color: var(--ink-muted); font-size: 12.5px; }
.share-link-setting, .share-confirm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.share-link-state { flex: 1; min-width: 0; color: var(--ink-muted); font-size: 12.5px; }
.share-confirm { width: 100%; }
.share-confirm > span { flex: 1 1 100%; color: var(--ink); font-size: 12.5px; }
.share-danger, .share-quiet { height: 30px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: transparent; font-size: 12.5px; font-weight: 550; }
.share-danger { color: var(--danger); }
.share-danger:hover:not(:disabled) { background: color-mix(in oklch, var(--danger) 12%, transparent); }
.share-quiet { color: var(--ink-muted); }
.share-quiet:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
/* While sharing settings load, the invite row and the link row hold their place. */
.share-skeleton { order: 2; display: none; }
#share-dialog[aria-busy="true"] > .share-skeleton { display: block; }
.share-skeleton .skel { height: 40px; }
@media (max-width: 600px) {
  .share-invite { flex-wrap: wrap; }
  .share-invite input { flex: 1 1 100%; }
  .share-invite select { flex: 1; }
  .share-link-actions { flex-wrap: wrap; }
  .share-link-reason { order: 3; flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .chat-run-status i { animation: none; }
}
/* With Steer and Stop beside Send, the composer's controls wrap as groups instead of breaking words. */
.composer-bottom { flex-wrap: wrap; row-gap: 8px; }
.composer-right { margin-left: auto; }
.composer-tools > span, .attach-plan-btn, .run-controls button { white-space: nowrap; }
