:root {
  color: #1c2924;
  background: #f3f5f2;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --ink: #1c2924;
  --muted: #65736c;
  --line: #dbe1dd;
  --surface: #ffffff;
  --canvas: #f3f5f2;
  --green: #176044;
  --green-dark: #173d31;
  --blue: #2e6284;
  --coral: #c85643;
  --amber: #a66b16;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  min-height: 100vh;
  background: var(--canvas);
}

button,
select,
textarea {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(46, 98, 132, 0.26);
  outline-offset: 2px;
}

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

.login-view { display: grid; min-height: 100vh; padding: 24px; place-items: center; background: #f4f7f4; }
.login-panel { width: min(430px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 18px 50px rgba(31, 48, 40, 0.08); text-align: center; }
.login-mark { width: 56px; height: 56px; margin: 0 auto 26px; border-radius: 8px; }
.login-panel h1 { margin: 7px 0 10px; font-size: 28px; }
.login-panel p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.google-login-button { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 28px; border: 1px solid #bdc8c1; border-radius: 6px; background: #fff; color: var(--text); font-size: 13px; font-weight: 750; text-decoration: none; }
.google-login-button:hover { border-color: var(--green); background: #f7faf8; }

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 24px 18px 84px;
  border-right: 1px solid var(--line);
  background: #f9faf8;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0 6px 28px;
}

.brand-mark {
  display: block;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: var(--green-dark);
  object-fit: cover;
}

.brand-name,
.brand-subtitle,
.control-label,
.scope-note,
.eyebrow,
.empty-state p,
.sidebar-footer {
  margin: 0;
}

.brand-name {
  overflow: hidden;
  font-size: 15px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.control-label {
  display: block;
  margin: 0 8px 9px;
  color: #76817b;
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.mode-nav,
.primary-nav {
  display: grid;
  gap: 5px;
}

.nav-button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.nav-button:hover { background: #eef1ee; }
.nav-button.is-active { border-color: #d7dfda; background: #e8eeea; }
.nav-icon { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 4px; background: #dce8e1; color: var(--green); font-size: 10px; font-weight: 800; }
.nav-icon-calendar { background: #f5e7df; color: #934936; }
.nav-icon-corpus { background: #e1ebf1; color: var(--blue); }
.nav-icon-review { background: #faead4; color: var(--amber); }
.nav-icon-users { background: #eee7f3; color: #624679; }
.nav-icon-feeds { background: #e8f1ed; color: #285f48; }
.nav-icon-connections { background: #e7eef4; color: #34546e; }
.nav-count { min-width: 22px; padding: 2px 5px; border-radius: 8px; background: #fff; color: var(--muted); font-size: 10px; text-align: center; }

.mode-button {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  width: 100%;
  min-height: 55px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  text-align: left;
}

.mode-button:hover {
  background: #eef1ee;
}

.mode-button.is-active {
  border-color: #d7dfda;
  background: #e8eeea;
}

.mode-button strong,
.mode-button small {
  display: block;
}

.mode-button strong {
  font-size: 14px;
  font-weight: 700;
}

.mode-button small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.mode-icon {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 5px;
  background: #dce8e1;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.mode-icon-message {
  background: #f7e4df;
  color: var(--coral);
}

.agent-control {
  margin-top: 30px;
}

.agent-control select {
  width: 100%;
  min-height: 42px;
  padding: 0 34px 0 12px;
  border: 1px solid #ccd5cf;
  border-radius: 6px;
  background: var(--surface);
  font-size: 13px;
}

.agent-static {
  min-height: 42px;
  padding: 12px;
  border: 1px solid #d7dfda;
  border-radius: 6px;
  background: #eef3ef;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
}

.scope-note {
  min-height: 32px;
  padding: 8px 8px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.account-initial { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: #dce8e1; color: var(--green-dark); font-size: 11px; font-weight: 800; }
.account-copy { min-width: 0; }
.account-copy strong,
.account-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { font-size: 11px; }
.account-copy small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.account-menu { position: fixed; bottom: 18px; left: 23px; z-index: 20; width: 214px; }
.account-menu-trigger { display: grid; grid-template-columns: 30px minmax(0, 1fr) 18px; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 8px; border: 1px solid transparent; border-radius: 6px; background: #f9faf8; text-align: left; }
.account-menu-trigger:hover,
.account-menu.is-open .account-menu-trigger { border-color: #d7dfda; background: #eef1ee; }
.account-chevron { color: var(--muted); font-size: 11px; text-align: center; transition: transform 140ms ease; }
.account-menu.is-open .account-chevron { transform: rotate(180deg); }
.account-popover { position: absolute; right: 0; bottom: calc(100% + 7px); left: 0; padding: 7px; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: 0 12px 30px rgba(31, 48, 40, 0.14); }
.account-popover-identity { display: none; padding: 7px 8px 10px; border-bottom: 1px solid var(--line); }
.account-popover-identity strong,
.account-popover-identity small { display: block; overflow-wrap: anywhere; }
.account-popover-identity strong { font-size: 11px; }
.account-popover-identity small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.sign-out-button { width: 100%; min-height: 34px; padding: 0 9px; border: 0; border-radius: 5px; background: transparent; color: #7d392f; font-size: 11px; font-weight: 750; text-align: left; }
.sign-out-button:hover { background: #f8ece9; }

.no-access-view { display: grid; min-height: 100vh; padding: 24px; place-items: center; }
.no-access-message { max-width: 460px; text-align: center; }
.no-access-message .brand-mark { width: 48px; height: 48px; margin: 0 auto 24px; border-radius: 7px; }
.no-access-message h1 { margin: 0; font-size: 26px; }
.no-access-message p { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.app-shell.has-no-access { display: block; }
.app-shell.has-no-access .sidebar,
.app-shell.has-no-access .workspace { display: none; }

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

.view-panel { min-width: 0; min-height: 0; }
.chat-view { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; }

.calendar-view { min-height: 0; padding: 22px clamp(24px, 4vw, 54px) 32px; overflow: auto; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.calendar-navigation { display: flex; align-items: center; gap: 7px; }
.calendar-navigation h2 { min-width: 210px; margin: 0 0 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: 21px; font-weight: 600; }
.calendar-arrow { width: 34px; height: 34px; font-size: 23px; line-height: 1; }
.calendar-today { min-height: 34px; padding: 0 12px; border: 1px solid #cad4ce; border-radius: 5px; background: #fff; font-size: 12px; font-weight: 750; }
.calendar-today:hover { border-color: var(--green); background: #f6faf7; }
.calendar-confidence { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; font-weight: 750; }
.calendar-confidence select { min-height: 36px; padding: 0 32px 0 11px; border: 1px solid #cad4ce; border-radius: 5px; background: #fff; font-size: 12px; }
.calendar-filters { display: flex; align-items: center; gap: 16px; }
.calendar-subscribe { display: inline-flex; align-items: center; align-self: end; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--green); border-radius: 5px; background: var(--green); color: #fff; font-size: 11px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.calendar-subscribe:hover { background: #0e5239; }
.calendar-subscribe span { font-size: 17px; font-weight: 500; line-height: 1; }
.calendar-context { display: flex; justify-content: space-between; gap: 16px; margin: 16px 0 10px; color: var(--muted); font-size: 11px; }
.calendar-layout { display: grid; grid-template-columns: minmax(540px, 1fr) minmax(270px, 350px); min-height: 610px; border: 1px solid var(--line); background: #fff; }
.month-calendar { min-width: 0; border-right: 1px solid var(--line); }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-height: 34px; border-bottom: 1px solid var(--line); background: #f6f8f6; }
.calendar-weekdays span { display: grid; place-items: center; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(92px, 1fr)); min-height: 574px; }
.calendar-day { min-width: 0; padding: 7px; overflow: hidden; border: 0; border-right: 1px solid #e4e8e5; border-bottom: 1px solid #e4e8e5; background: #fff; text-align: left; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day:nth-last-child(-n + 7) { border-bottom: 0; }
button.calendar-day:hover { background: #f5f8f6; }
.calendar-day.is-outside { background: #fafbfa; }
.calendar-day.is-selected { background: #edf4f0; box-shadow: inset 0 0 0 2px var(--green); }
.calendar-day-number { display: grid; width: 23px; height: 23px; place-items: center; color: #4f5d56; font-size: 11px; font-weight: 800; }
.calendar-day.is-today .calendar-day-number { border-radius: 50%; background: var(--green-dark); color: #fff; }
.calendar-day-items { display: grid; gap: 3px; margin-top: 4px; }
.calendar-item-summary { display: block; min-width: 0; padding-left: 6px; overflow: hidden; border-left: 2px solid var(--blue); color: #344b5a; font-size: 9px; font-weight: 700; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.calendar-kind-deadline { border-color: var(--coral); color: #7c3f34; }
.calendar-kind-closure { border-color: var(--amber); color: #76501a; }
.calendar-kind-trip,
.calendar-kind-event { border-color: var(--green); color: #285f48; }
.calendar-more { color: var(--muted); font-size: 9px; font-weight: 750; }
.calendar-agenda { min-width: 0; padding: 18px 20px; overflow: auto; background: #fbfcfb; }
.agenda-heading { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.agenda-heading h2 { margin: 4px 0 0; font-size: 18px; }
.calendar-agenda-list { display: grid; }
.agenda-item { position: relative; padding: 17px 0 18px 14px; border-bottom: 1px solid var(--line); }
.agenda-item::before { position: absolute; top: 20px; bottom: 20px; left: 0; width: 3px; background: var(--blue); content: ""; }
.agenda-kind-deadline::before { background: var(--coral); }
.agenda-kind-closure::before { background: var(--amber); }
.agenda-kind-trip::before,
.agenda-kind-event::before { background: var(--green); }
.agenda-time { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.agenda-item h3 { margin: 4px 0 8px; font-size: 14px; line-height: 1.35; }
.agenda-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }
.agenda-meta .status-chip { font-size: 8px; }
.agenda-item blockquote { margin: 12px 0 9px; padding-left: 10px; border-left: 2px solid #d5dcd7; color: #4d5a53; font-size: 11px; line-height: 1.5; }
.agenda-source { color: var(--blue); font-size: 10px; font-weight: 750; text-decoration: none; }
a.agenda-source:hover { text-decoration: underline; }
.agenda-reason { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.agenda-item.is-ignored { opacity: .82; }
.agenda-suppression { margin: 9px 0 0; padding: 7px 9px; border-left: 2px solid var(--amber); background: #fff8eb; color: #76501a; font-size: 10px; line-height: 1.4; }
.agenda-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 11px; }
.agenda-action { padding: 0; border: 0; background: none; color: #52665c; font-size: 10px; font-weight: 750; text-decoration: underline; text-decoration-color: #bdc9c2; text-underline-offset: 3px; }
.agenda-action:hover { color: var(--green-dark); text-decoration-color: currentColor; }
.agenda-action:disabled { color: var(--muted); cursor: wait; }
.calendar-empty { padding: 30px 6px; color: var(--muted); font-size: 11px; text-align: center; }
.calendar-view-empty { margin-top: 18px; padding: 34px; border: 1px dashed #cbd4ce; background: #f8faf8; }
.calendar-view-empty .empty-mark { margin: 0 auto 12px; }
.calendar-view-empty h2 { margin: 0; color: var(--ink); font-size: 16px; }
.calendar-view-empty p { margin: 7px 0 0; }

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 90px;
  padding: 18px clamp(24px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.eyebrow {
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}

h1 {
  margin: 5px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quick-reply-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.toggle-track {
  display: flex;
  align-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 16px;
  padding: 2px;
  border-radius: 8px;
  background: #c6cfca;
  transition: background 140ms ease;
}

.toggle-track span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(28, 41, 36, 0.24);
  transition: transform 140ms ease;
}

.quick-reply-toggle.is-active {
  color: var(--green-dark);
}

.quick-reply-toggle.is-active .toggle-track { background: var(--green); }
.quick-reply-toggle.is-active .toggle-track span { transform: translateX(12px); }

.scope-badge {
  max-width: 240px;
  overflow: hidden;
  padding: 7px 9px;
  border: 1px solid #bfd4c6;
  border-radius: 5px;
  background: #edf5f0;
  color: #285f48;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scope-badge.is-private {
  border-color: #e6c994;
  background: #fff6e6;
  color: #85510b;
}

.secondary-button,
.send-button,
.copy-button,
.suggestions button {
  border-radius: 6px;
  font-weight: 700;
}

.secondary-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #ccd5cf;
  background: var(--surface);
  font-size: 12px;
}

.secondary-button:hover,
.suggestions button:hover {
  border-color: #9eaaa3;
  background: #f8faf8;
}

.conversation {
  overflow-y: auto;
  padding: 38px clamp(24px, 7vw, 96px) 28px;
  scroll-behavior: smooth;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 650px;
  margin: min(12vh, 110px) auto 0;
  text-align: center;
}

.empty-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid #c8d8ce;
  border-radius: 8px;
  background: #eaf1ed;
  color: var(--green-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 700;
}

.empty-state h2 {
  margin: 20px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 600;
}

.empty-state p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.suggestions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin-top: 28px;
}

.suggestions button {
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.4;
}

.message-list {
  display: grid;
  max-width: 820px;
  margin: 0 auto;
  gap: 24px;
}

.message-row {
  display: grid;
  gap: 7px;
}

.message-row.user {
  justify-items: end;
}

.message-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.message-bubble {
  max-width: min(680px, 88%);
  padding: 15px 17px;
  border: 1px solid #dce2de;
  border-radius: 8px;
  background: var(--surface);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.message-bubble.rendered-markdown {
  white-space: normal;
}

.message-bubble > :first-child {
  margin-top: 0;
}

.message-bubble > :last-child {
  margin-bottom: 0;
}

.message-bubble p,
.message-bubble ul,
.message-bubble ol,
.message-bubble blockquote,
.message-bubble pre {
  margin: 0 0 10px;
}

.message-bubble ul,
.message-bubble ol {
  padding-left: 22px;
}

.message-bubble li + li {
  margin-top: 4px;
}

.message-bubble h1,
.message-bubble h2,
.message-bubble h3,
.message-bubble h4 {
  margin: 14px 0 7px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.35;
}

.message-bubble code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #eef1ef;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.message-bubble pre {
  padding: 10px;
  overflow-x: auto;
  border-radius: 6px;
  background: #eef1ef;
  white-space: pre;
}

.message-bubble pre code {
  padding: 0;
}

.message-bubble blockquote {
  padding-left: 12px;
  border-left: 3px solid #9fb7a8;
  color: #53635b;
}

.rendered-markdown table {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 4px 0 12px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-collapse: collapse;
  background: var(--surface);
}

.rendered-markdown th,
.rendered-markdown td {
  min-width: 110px;
  padding: 7px 9px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.rendered-markdown th {
  background: #eef2ef;
  font-size: 11px;
  font-weight: 800;
}

.rendered-markdown td {
  font-size: 12px;
}

.rendered-markdown tr:last-child td {
  border-bottom: 0;
}

.rendered-markdown th:last-child,
.rendered-markdown td:last-child {
  border-right: 0;
}

.message-bubble a,
.sources a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.user .message-bubble {
  border-color: var(--green-dark);
  background: var(--green-dark);
  color: #fff;
}

.message-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-button {
  min-height: 27px;
  padding: 0 8px;
  border: 1px solid #d3dad6;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
}

.sources {
  display: flex;
  align-items: baseline;
  gap: 8px;
  max-width: min(680px, 88%);
  color: var(--muted);
  font-size: 11px;
}

.sources-label {
  flex: 0 0 auto;
  font-weight: 700;
}

.sources ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sources li {
  min-width: 0;
}

.typing-bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 62px;
  min-height: 48px;
}

.typing-bubble span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #829087;
  animation: pulse 1.1s infinite ease-in-out;
}

.typing-bubble span:nth-child(2) {
  animation-delay: 0.14s;
}

.typing-bubble span:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes pulse {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px 10px;
  width: min(860px, calc(100% - 48px));
  margin: 0 auto;
  padding: 13px 14px 11px;
  border: 1px solid #cfd7d2;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: var(--surface);
  box-shadow: 0 -8px 30px rgba(31, 48, 40, 0.06);
}

.composer textarea {
  width: 100%;
  max-height: 150px;
  min-height: 39px;
  resize: none;
  padding: 9px 4px;
  overflow-y: auto;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
  line-height: 1.5;
}

.composer textarea::placeholder {
  color: #909b95;
}

.send-button {
  align-self: end;
  min-width: 68px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
  font-size: 12px;
}

.send-button:hover {
  background: #0e5239;
}

.send-button:disabled,
.composer textarea:disabled {
  cursor: wait;
  opacity: 0.58;
}

.composer-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 26px;
}

#request-status {
  margin-left: 12px;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

#request-status:empty {
  display: none;
}

#request-status.is-error {
  color: #a13a2c;
  font-weight: 700;
}

.management-view { overflow: hidden; background: #f7f8f6; }
.metrics-strip { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); border-bottom: 1px solid var(--line); background: #fff; }
.metrics-strip > div { display: flex; align-items: baseline; gap: 9px; min-height: 62px; padding: 15px 22px; border-right: 1px solid var(--line); }
.metrics-strip > div:last-child { border-right: 0; }
.metrics-strip strong { font-family: Georgia, "Times New Roman", serif; font-size: 23px; font-weight: 600; }
.metrics-strip span { color: var(--muted); font-size: 11px; }
.corpus-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; height: calc(100% - 62px); }
.corpus-layout:has(.detail-panel[hidden]) { grid-template-columns: minmax(0, 1fr); }
.corpus-list-pane { display: grid; grid-template-rows: auto auto minmax(0, 1fr); min-width: 0; min-height: 0; }
.filter-bar { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(130px, 180px)); gap: 8px; padding: 16px 20px 10px; }
.filter-bar input,
.filter-bar select { width: 100%; height: 38px; padding: 0 11px; border: 1px solid #ccd5cf; border-radius: 5px; background: #fff; font-size: 12px; }
.filter-bar input::placeholder { color: #89958e; }
.table-meta { display: flex; justify-content: space-between; padding: 2px 22px 10px; color: var(--muted); font-size: 10px; }
.table-wrap { min-height: 0; overflow: auto; border-top: 1px solid var(--line); background: #fff; }
.corpus-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.corpus-table th { position: sticky; top: 0; z-index: 1; height: 36px; padding: 0 12px; border-bottom: 1px solid var(--line); background: #f3f5f2; color: #68766f; font-size: 10px; font-weight: 800; text-align: left; text-transform: uppercase; }
.corpus-table th:first-child { width: 40%; padding-left: 22px; }
.corpus-table th:nth-child(2),
.corpus-table th:nth-child(3) { width: 12%; }
.corpus-table th:nth-child(4),
.corpus-table th:nth-child(5) { width: 11%; }
.corpus-table th:last-child { width: 14%; }
.corpus-table td { height: 59px; padding: 8px 12px; border-bottom: 1px solid #e7ebe8; font-size: 11px; vertical-align: middle; }
.corpus-table td:first-child { padding-left: 22px; }
.corpus-table tbody tr { cursor: pointer; }
.corpus-table tbody tr:hover { background: #f6f9f7; }
.corpus-table tbody tr.is-selected { background: #edf4f0; box-shadow: inset 3px 0 var(--green); }
.corpus-table td strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.corpus-table td small { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.status-chip { display: inline-block; max-width: 100%; overflow: hidden; padding: 4px 6px; border: 1px solid #d3dad6; border-radius: 4px; background: #f6f8f6; color: #536159; font-size: 9px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.status-indexed,
.status-archived,
.status-shareable { border-color: #c6d9ce; background: #edf5f0; color: #286047; }
.status-private,
.status-local-only { border-color: #e7cd9e; background: #fff6e7; color: #82540d; }
.status-private-shareable { border-color: #bdcfd8; background: #edf4f7; color: #315e76; }
.status-not-indexed,
.status-not-archived { border-color: #d8dcdf; background: #f3f4f5; color: #667078; }
.table-empty { padding: 48px 20px; color: var(--muted); font-size: 13px; text-align: center; }
.detail-panel { min-width: 0; padding: 22px; overflow-y: auto; border-left: 1px solid var(--line); background: #fff; }
.detail-header { display: flex; align-items: center; justify-content: space-between; }
.detail-kicker { color: var(--green); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.icon-button { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid #d3dad6; border-radius: 5px; background: #fff; color: var(--muted); font-size: 20px; line-height: 1; }
.detail-panel h2 { margin: 18px 0 8px; overflow-wrap: anywhere; font-family: Georgia, "Times New Roman", serif; font-size: 20px; font-weight: 600; line-height: 1.3; }
.canonical-link { color: var(--blue); font-size: 11px; text-underline-offset: 2px; }
.detail-list { display: grid; grid-template-columns: 95px minmax(0, 1fr); gap: 0; margin: 24px 0; border-top: 1px solid var(--line); }
.detail-list dt,
.detail-list dd { min-width: 0; margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 11px; line-height: 1.45; }
.detail-list dt { color: var(--muted); }
.detail-list dd { overflow-wrap: anywhere; font-weight: 650; }
.private-notice { margin: 0 0 12px; padding: 10px; border-left: 3px solid #d69a37; background: #fff7e9; color: #754b0c; font-size: 10px; line-height: 1.5; }
.preview-button { width: 100%; min-height: 37px; border: 1px solid var(--green); border-radius: 5px; background: var(--green); color: #fff; font-size: 11px; font-weight: 750; }
.preview-content { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.preview-content h1,
.preview-content h2,
.preview-content h3 { font-family: inherit; font-size: 14px; }
.review-view { overflow-y: auto; }
.ingest-panel { padding: 18px 24px; border-bottom: 1px solid var(--line); background: #f7f9f7; }
.ingest-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ingest-heading h2 { margin: 3px 0 0; font-size: 17px; }
.start-ingest-button { min-height: 36px; padding: 0 14px; border: 1px solid var(--green); border-radius: 5px; background: var(--green); color: #fff; font-size: 11px; font-weight: 750; }
.start-ingest-button:hover { background: #0e5239; }
.start-ingest-button:disabled { cursor: default; opacity: 0.52; }
.ingest-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-top: 14px; }
.ingest-summary strong { font-size: 12px; }
.ingest-summary span { color: var(--muted); font-size: 10px; text-align: right; }
.ingest-progress { height: 5px; margin-top: 14px; overflow: hidden; background: #dce3df; }
.ingest-progress span { display: block; width: 0; height: 100%; background: var(--green); transition: width 180ms ease; }
.ingest-progress.is-running span { background: #2779a7; }
.ingest-progress.is-failed span { background: #a13a2c; }
.ingest-stages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 18px; margin: 14px 0 0; padding: 0; color: var(--muted); font-size: 10px; list-style: none; }
.ingest-stage { display: grid; grid-template-columns: 15px minmax(0, 1fr); align-items: center; gap: 7px; min-width: 0; }
.ingest-stage-mark { display: grid; place-items: center; width: 15px; height: 15px; padding: 0; border: 1px solid #bcc8c1; border-radius: 50%; background: transparent; color: #fff; font: inherit; font-size: 9px; font-weight: 800; cursor: pointer; }
.ingest-stage-mark > span { grid-area: 1 / 1; }
.ingest-stage-refresh-icon { display: none; color: var(--green); font-size: 12px; line-height: 1; }
.ingest-stage-mark:hover:not(:disabled) .ingest-stage-status-icon,
.ingest-stage-mark:focus-visible:not(:disabled) .ingest-stage-status-icon { display: none; }
.ingest-stage-mark:hover:not(:disabled) .ingest-stage-refresh-icon,
.ingest-stage-mark:focus-visible:not(:disabled) .ingest-stage-refresh-icon { display: block; }
.ingest-stage-mark:hover:not(:disabled),
.ingest-stage-mark:focus-visible:not(:disabled) { border-color: var(--green); background: #eef4f0; outline: none; }
.ingest-stage-mark:disabled { cursor: wait; }
.ingest-stage-body { min-width: 0; }
.ingest-stage-label { display: flex; justify-content: space-between; gap: 8px; min-width: 0; margin-bottom: 4px; }
.ingest-stage-label span:first-child { overflow: hidden; color: inherit; text-overflow: ellipsis; white-space: nowrap; }
.ingest-stage-label span:last-child { flex: none; color: var(--muted); font-size: 9px; }
.ingest-stage-progress { position: relative; height: 3px; overflow: hidden; background: #dce3df; }
.ingest-stage-progress > span { display: block; width: 0; height: 100%; background: #91a59b; transition: width 180ms ease; }
.ingest-stage.status-running .ingest-stage-progress > span { background: #2779a7; }
.ingest-stage.status-completed .ingest-stage-progress > span,
.ingest-stage.status-fresh .ingest-stage-progress > span { background: var(--green); }
.ingest-stage-progress.is-indeterminate > span { width: 35% !important; animation: ingest-stage-indeterminate 1.15s ease-in-out infinite; }
@keyframes ingest-stage-indeterminate { from { transform: translateX(-110%); } to { transform: translateX(300%); } }
.ingest-stage.status-completed { color: var(--text); }
.ingest-stage.status-completed .ingest-stage-mark { border-color: var(--green); background: var(--green); }
.ingest-stage.status-fresh { color: #456557; }
.ingest-stage.status-fresh .ingest-stage-mark { border-color: #789487; background: #eef4f0; color: #456557; }
.ingest-stage.status-running .ingest-stage-mark { border-color: #2779a7; background: #2779a7; }
.ingest-stage.status-failed { color: #a13a2c; }
.ingest-stage.status-failed .ingest-stage-mark { border-color: #a13a2c; background: #a13a2c; }
.review-toolbar { display: flex; align-items: center; justify-content: space-between; min-height: 63px; gap: 18px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: #fff; }
.review-toolbar strong,
.review-toolbar span { display: block; }
.review-toolbar strong { font-size: 13px; }
.review-toolbar div span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.review-toolbar div span.is-error { color: #a13a2c; }
.review-toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.review-toolbar .batch-result { max-width: 290px; margin: 0; color: var(--green); font-weight: 700; text-align: right; }
.review-toolbar .batch-result.is-error { color: #a13a2c; }
.policy-badge { padding: 6px 8px; border: 1px solid #e3c58f; border-radius: 4px; background: #fff5e4; color: #7b4d07; font-size: 10px; font-weight: 750; }
.batch-review-button { min-height: 34px; padding: 0 12px; border: 1px solid var(--green); border-radius: 5px; background: var(--green); color: #fff; font-size: 10px; font-weight: 750; }
.retry-publication-button { min-height: 34px; padding: 0 12px; border: 1px solid #b66a25; border-radius: 5px; background: #fff; color: #8a4b16; font-size: 10px; font-weight: 750; }
.retry-publication-button:disabled { cursor: wait; opacity: 0.55; }
.batch-review-button:hover { background: #0e5239; }
.batch-review-button:disabled { cursor: default; opacity: 0.52; }
.review-empty { display: flex; flex-direction: column; align-items: center; max-width: 470px; margin: 16vh auto 0; padding: 0 20px; text-align: center; }
.review-empty h2 { margin: 17px 0 7px; font-family: Georgia, "Times New Roman", serif; font-size: 22px; font-weight: 600; }
.review-empty p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.review-list { display: grid; gap: 1px; max-width: 920px; margin: 22px auto; border: 1px solid var(--line); background: var(--line); }
.review-item { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr); gap: 16px 24px; padding: 18px; background: #fff; }
.review-item h2 { margin: 0; font-size: 14px; }
.review-item p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.review-recommendation { align-self: start; padding: 9px 10px; border-left: 3px solid #d69a37; background: #fff7e9; }
.review-recommendation.recommendation-share { border-left-color: #4a8967; background: #edf6f1; }
.review-recommendation.recommendation-private { border-left-color: #4a8967; background: #edf6f1; }
.review-recommendation.is-high-confidence { border-left-color: #176044; background: #e3f1e9; box-shadow: inset 0 0 0 1px #b8d6c5; }
.review-recommendation strong,
.review-recommendation span { display: block; }
.review-recommendation strong { color: #65420b; font-size: 10px; }
.review-recommendation.recommendation-share strong,
.review-recommendation.recommendation-private strong { color: #285f48; }
.review-recommendation.is-high-confidence strong { color: #104b35; }
.review-recommendation span { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.review-signals { color: #59665f; font-size: 10px; line-height: 1.5; }
.publication-status { display: flex; align-items: center; justify-content: flex-end; gap: 7px; color: var(--muted); font-size: 9px; }
.review-actions { display: flex; flex-wrap: wrap; grid-column: 1 / -1; gap: 7px; }
.review-action { min-height: 32px; padding: 0 10px; border: 1px solid #ccd5cf; border-radius: 5px; background: #fff; font-size: 10px; font-weight: 700; }
.review-action.is-recommended { border-color: #72a58b; background: #e8f3ed; color: #174d38; box-shadow: 0 0 0 2px rgba(23, 96, 68, 0.08); }
.review-action.is-recommended.is-high-confidence { border-color: var(--green); background: var(--green); color: #fff; box-shadow: 0 0 0 2px rgba(23, 96, 68, 0.12); }
.review-action.is-recommended::after { content: "Recommended"; margin-left: 7px; padding-left: 7px; border-left: 1px solid rgba(23, 77, 56, 0.35); font-size: 8px; text-transform: uppercase; }
.review-action.is-recommended.is-high-confidence::after { content: "High confidence"; border-left-color: rgba(255, 255, 255, 0.45); }
.review-action:disabled { cursor: wait; opacity: 0.55; }
.review-preview { grid-column: 1 / -1; max-height: 320px; padding: 14px; overflow-y: auto; border: 1px solid #dbe1dd; background: #f8faf8; font-size: 11px; line-height: 1.55; }
.review-preview > :first-child { margin-top: 0; }
.review-preview > :last-child { margin-bottom: 0; }

.users-view { overflow-y: auto; padding-bottom: 36px; }
.users-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 22px 26px; border-bottom: 1px solid var(--line); background: #fff; }
.users-heading h2 { margin: 4px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 21px; font-weight: 600; }
.users-heading p { max-width: 440px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; text-align: right; }
.users-status { min-height: 18px; max-width: 960px; margin: 14px auto 0; color: var(--green); font-size: 11px; font-weight: 700; }
.users-status.is-error { color: #a13a2c; }
.invite-admin { max-width: 960px; margin: 8px auto 22px; padding: 20px; border: 1px solid var(--line); background: #fff; }
.invite-admin-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.invite-admin-heading h3 { margin: 4px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 19px; font-weight: 600; }
.invite-admin-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.invite-form { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(240px, 1.7fr) 110px 100px auto; align-items: end; gap: 10px; margin-top: 18px; }
.invite-form label { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.invite-form input,
.invite-form select { width: 100%; min-width: 0; height: 34px; padding: 0 9px; border: 1px solid #ccd5cf; border-radius: 5px; background: #fff; color: var(--text); font-size: 11px; text-transform: none; }
.invite-form .user-save-button { height: 34px; }
.invite-created { margin-top: 14px; padding: 12px; border: 1px solid #a9c9b9; background: #f1f7f3; color: #174d38; font-size: 10px; }
.invite-created > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; margin-top: 7px; }
.invite-created input { min-width: 0; height: 32px; padding: 0 8px; border: 1px solid #bccdc4; background: #fff; font-size: 10px; }
.invite-created button,
.invite-row-actions button { min-height: 32px; padding: 0 10px; border: 1px solid #b8c8bf; border-radius: 5px; background: #fff; color: var(--green); font-size: 10px; font-weight: 750; }
.invite-section-heading { display: flex; justify-content: space-between; margin-top: 20px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.invite-section-heading h4 { margin: 0; font-size: 11px; }
.invite-section-heading span { color: var(--muted); font-size: 9px; }
.invite-history-heading { margin-top: 22px; }
.invite-list { display: grid; }
.invite-list.is-empty { padding: 15px 0; color: var(--muted); font-size: 10px; }
.invite-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid #edf0ee; }
.invite-row-copy { min-width: 0; }
.invite-row-copy strong,
.invite-row-copy span,
.invite-row-copy small { display: block; }
.invite-row-copy strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.invite-row-copy span { margin-top: 3px; color: #42544a; font-size: 10px; }
.invite-row-copy small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.invite-row-actions { display: flex; flex: none; gap: 6px; }
.people-heading { display: flex; justify-content: space-between; max-width: 960px; margin: 0 auto; color: var(--muted); font-size: 10px; }
.people-heading strong { color: var(--text); font-size: 12px; }
.users-list { display: grid; max-width: 960px; margin: 8px auto 0; border: 1px solid var(--line); background: var(--line); gap: 1px; }
.user-access-row { display: grid; grid-template-columns: minmax(190px, 0.8fr) minmax(300px, 1.5fr) auto; gap: 18px; padding: 18px; background: #fff; }
.user-identity strong,
.user-identity span { display: block; }
.user-identity strong { font-size: 13px; }
.user-identity span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.user-flags { display: flex; gap: 15px; margin-top: 15px; }
.user-flags label,
.agent-grant { display: flex; align-items: center; gap: 7px; color: #415047; font-size: 10px; font-weight: 700; }
.user-flags input,
.agent-grant input { width: 15px; height: 15px; margin: 0; accent-color: var(--green); }
.agent-grants { display: grid; grid-template-columns: repeat(2, minmax(130px, 1fr)); gap: 8px 14px; align-content: start; }
.agent-grant span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-access-actions { display: flex; align-items: flex-start; gap: 7px; }
.user-save-button,
.user-delete-button { min-height: 32px; padding: 0 10px; border-radius: 5px; background: #fff; font-size: 10px; font-weight: 750; }
.user-save-button { border: 1px solid var(--green); background: var(--green); color: #fff; }
.user-delete-button { border: 1px solid #d4b2ab; color: #8c3c31; }
.user-save-button:disabled,
.user-delete-button:disabled { cursor: default; opacity: 0.48; }
.users-empty { max-width: 960px; margin: 8px auto; padding: 28px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 12px; text-align: center; }

.feeds-view { overflow-y: auto; padding-bottom: 36px; }
.feed-editor { max-width: 960px; margin: 8px auto 22px; padding: 20px; border: 1px solid var(--line); background: #fff; }
.schema-chip { padding: 5px 7px; border: 1px solid #cbd8d1; border-radius: 5px; background: #f3f7f5; color: #315844; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.feed-form { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr); gap: 14px; margin-top: 18px; }
.feed-form > label,
.feed-form fieldset { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.feed-form input[type="text"],
.feed-form select,
.feed-form textarea { width: 100%; min-width: 0; padding: 9px; border: 1px solid #ccd5cf; border-radius: 5px; background: #fff; color: var(--text); font: inherit; font-size: 11px; line-height: 1.5; text-transform: none; }
.feed-form input[type="text"],
.feed-form select { height: 36px; }
.feed-form textarea { resize: vertical; }
.feed-form fieldset,
.feed-prompt,
.feed-form-footer { grid-column: 1 / -1; }
.feed-scopes { display: flex; flex-wrap: wrap; gap: 8px 16px; min-height: 28px; }
.feed-scopes label,
.feed-enabled { display: flex; align-items: center; gap: 7px; color: #415047; font-size: 10px; font-weight: 700; text-transform: none; }
.feed-scopes input,
.feed-enabled input { width: 15px; height: 15px; margin: 0; accent-color: var(--green); }
.feed-form-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.feed-enabled { margin-right: auto; }
.feeds-list { display: grid; max-width: 960px; margin: 8px auto 0; border: 1px solid var(--line); background: var(--line); gap: 1px; }
.feed-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px; background: #fff; }
.feed-row-copy { min-width: 0; }
.feed-row-copy strong,
.feed-row-copy span,
.feed-row-copy small,
.feed-row-copy code { display: block; }
.feed-row-copy strong { font-size: 13px; }
.feed-row-copy span { margin-top: 4px; color: #42544a; font-size: 10px; }
.feed-row-copy small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.feed-row-copy code { max-width: 580px; margin-top: 8px; overflow: hidden; color: #315844; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.feed-row-actions { display: flex; flex: none; gap: 6px; }
.feed-row-actions a,
.feed-row-actions button { display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; border: 1px solid #b8c8bf; border-radius: 5px; background: #fff; color: var(--green); font-size: 10px; font-weight: 750; text-decoration: none; }
.feed-row-actions a { border-color: var(--green); background: var(--green); color: #fff; }

.connections-view { overflow-y: auto; padding-bottom: 36px; }
.connections-list { display: grid; max-width: 960px; margin: 14px auto 0; border: 1px solid var(--line); background: var(--line); gap: 1px; }
.connection-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 92px; padding: 18px; background: #fff; }
.connection-copy strong,
.connection-copy span,
.connection-copy small { display: block; }
.connection-copy strong { font-size: 13px; }
.connection-copy span { margin-top: 4px; color: #42544a; font-size: 10px; }
.connection-copy small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.connection-copy .connection-error { color: #a13a2c; }
.connection-actions { display: flex; flex: none; gap: 7px; }
.connection-actions a,
.connection-actions button { display: inline-flex; align-items: center; min-height: 34px; padding: 0 11px; border: 1px solid #b8c8bf; border-radius: 5px; background: #fff; color: var(--green); font-size: 10px; font-weight: 750; text-decoration: none; }
.connection-actions a { border-color: var(--green); background: var(--green); color: #fff; }
.connection-actions button:disabled { cursor: wait; opacity: 0.55; }

.invite-body { min-height: 100vh; background: #f4f7f4; }
.invite-page { width: min(440px, calc(100% - 32px)); margin: 0 auto; padding: 12vh 0 48px; text-align: center; }
.invite-mark { width: 58px; height: 58px; margin: 0 auto 26px; border-radius: 9px; }
.invite-page h1 { margin: 7px 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 600; }
.invite-purpose-copy { margin: 0 auto; color: var(--muted); font-size: 13px; line-height: 1.6; }
.invite-agent-card { margin-top: 24px; padding: 18px; border: 1px solid var(--line); background: #fff; text-align: left; }
.invite-agent-card span,
.invite-agent-card strong,
.invite-agent-card small { display: block; }
.invite-agent-card span { color: var(--green); font-size: 9px; font-weight: 800; }
.invite-agent-card strong { margin-top: 6px; font-size: 16px; }
.invite-agent-card small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.invite-identity { margin: 18px 0 0; color: #42544a; font-size: 12px; line-height: 1.5; }
.invite-primary { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; margin-top: 22px; border: 1px solid var(--green); border-radius: 6px; background: var(--green); color: #fff; font-size: 12px; font-weight: 750; text-decoration: none; }
.invite-primary:hover { background: #0f543b; }
.invite-primary:disabled { cursor: wait; opacity: 0.6; }
.invite-status { min-height: 18px; margin: 12px 0 0; color: var(--muted); font-size: 10px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  .app-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .sidebar {
    display: grid;
    grid-column: 1;
    grid-template-columns: auto minmax(0, 1fr) 38px;
    grid-row: 1;
    column-gap: 8px;
    min-width: 0;
    min-height: auto;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    padding: 0;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .brand-subtitle,
  .scope-note,
  .control-label {
    display: none;
  }

  .mode-nav,
  .primary-nav {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 6px;
    margin-top: 11px;
    overflow-x: auto;
  }

  .nav-button { display: flex; justify-content: center; min-height: 36px; padding: 4px 10px; }
  .nav-icon { display: none; }
  .nav-count { margin-left: 3px; }

  .mode-button {
    display: flex;
    justify-content: center;
    min-height: 36px;
    padding: 4px 10px;
  }

  .mode-icon,
  .mode-button small {
    display: none;
  }

  .agent-control {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    width: 100%;
    margin: 0;
  }

  .agent-control select {
    width: 100%;
    min-height: 36px;
    font-size: 16px;
  }

  .agent-static {
    min-height: 36px;
    padding: 9px 11px;
    font-size: 12px;
  }

  .account-menu { position: relative; top: auto; right: auto; bottom: auto; left: auto; grid-column: 1; grid-row: 1; align-self: start; justify-self: end; width: 34px; margin: 12px 14px 0 0; }
  .account-menu-trigger { display: block; width: 34px; min-height: 34px; padding: 0; border: 0; border-radius: 50%; background: transparent; }
  .account-menu-trigger:hover,
  .account-menu.is-open .account-menu-trigger { border: 0; background: transparent; }
  .account-menu-trigger .account-initial { width: 34px; height: 34px; box-shadow: 0 0 0 1px #c9d5ce; }
  .account-menu-trigger .account-copy,
  .account-menu-trigger .account-chevron { display: none; }
  .account-popover { top: calc(100% + 8px); right: 0; bottom: auto; left: auto; width: min(250px, calc(100vw - 28px)); }
  .account-popover-identity { display: block; }
  .app-shell.has-no-access .account-menu { margin-left: auto; }
  .no-access-view { min-height: calc(100dvh - 46px); padding: 26px 22px 72px; }

  .workspace {
    grid-column: 1;
    grid-row: 2;
    height: auto;
    min-width: 0;
    min-height: 0;
  }

  .workspace-header {
    min-height: 68px;
    padding: 12px 16px;
  }

  h1 {
    font-size: 20px;
  }

  .scope-badge {
    display: none;
  }

  .conversation {
    padding: 22px 16px;
  }

  .empty-state {
    margin-top: 7vh;
  }

  .empty-state h2 {
    font-size: 23px;
  }

  .suggestions {
    grid-template-columns: 1fr;
    max-width: 390px;
    margin-top: 20px;
  }

  .suggestions button {
    min-height: 45px;
  }

  .message-bubble,
  .sources {
    max-width: 94%;
  }

  .composer {
    width: calc(100% - 24px);
    padding: 10px 12px;
  }

  .composer textarea {
    min-height: 44px;
    font-size: 16px;
  }

  .calendar-view { padding: 14px 12px 24px; }
  .calendar-toolbar { align-items: stretch; flex-direction: column; gap: 12px; }
  .calendar-navigation h2 { min-width: 0; margin-left: 5px; font-size: 18px; }
  .calendar-confidence { justify-content: space-between; }
  .calendar-confidence select { min-width: 0; max-width: 230px; font-size: 16px; }
  .calendar-filters { align-items: stretch; flex-direction: column; gap: 9px; }
  .calendar-layout { display: block; min-height: 0; overflow: hidden; }
  .month-calendar { overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .calendar-weekdays,
  .calendar-grid { min-width: 650px; }
  .calendar-agenda { max-height: none; padding: 18px 16px; }

  .management-view { overflow-y: auto; }
  .metrics-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics-strip > div { min-height: 52px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
  .corpus-layout,
  .corpus-layout:has(.detail-panel[hidden]) { display: block; height: auto; }
  .filter-bar { grid-template-columns: 1fr 1fr; padding: 12px; }
  .search-field { grid-column: 1 / -1; }
  .filter-bar select:last-child { grid-column: 1 / -1; }
  .table-wrap { overflow: visible; }
  .corpus-table th:nth-child(3),
  .corpus-table th:nth-child(4),
  .corpus-table th:nth-child(5),
  .corpus-table td:nth-child(3),
  .corpus-table td:nth-child(4),
  .corpus-table td:nth-child(5) { display: none; }
  .corpus-table th:first-child { width: 55%; padding-left: 14px; }
  .corpus-table th:nth-child(2) { width: 20%; }
  .corpus-table th:last-child { width: 25%; }
  .corpus-table td:first-child { padding-left: 14px; }
  .detail-panel { position: fixed; inset: 0; z-index: 10; padding: 20px; border-left: 0; }
  .review-toolbar { align-items: stretch; flex-direction: column; gap: 10px; padding: 12px 16px; }
  .ingest-panel { padding: 15px 16px; }
  .ingest-heading { align-items: flex-end; }
  .start-ingest-button { min-height: 38px; }
  .ingest-summary { align-items: flex-start; flex-direction: column; gap: 4px; }
  .ingest-summary span { text-align: left; }
  .ingest-stages { display: grid; grid-template-columns: 1fr; gap: 7px; }
  .review-toolbar-actions { display: grid; grid-template-columns: 1fr auto; justify-content: stretch; }
  .review-toolbar .batch-result { grid-column: 1 / -1; max-width: none; text-align: left; }
  .policy-badge { align-self: center; }
  .batch-review-button { min-height: 38px; }
  .review-list { margin: 12px; }
  .review-item { grid-template-columns: 1fr; }
  .publication-status { justify-content: flex-start; }
  .review-actions { grid-column: 1; }
  .review-preview { grid-column: 1; }
  .users-heading { align-items: flex-start; flex-direction: column; padding: 16px; }
  .users-heading p { text-align: left; }
  .users-status { margin: 12px; }
  .invite-admin { margin: 0 12px 20px; padding: 16px; }
  .invite-admin-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .invite-form { grid-template-columns: 1fr 1fr; }
  .invite-purpose { grid-column: 1 / -1; grid-row: 1; }
  .invite-form .user-save-button { grid-column: 1 / -1; }
  .people-heading { margin: 0 12px; }
  .users-list { margin: 0 12px; }
  .feed-editor,
  .feeds-list { margin: 0 12px 20px; }
  .feed-form { grid-template-columns: 1fr; }
  .feed-form > label,
  .feed-form fieldset,
  .feed-prompt,
  .feed-form-footer { grid-column: 1; }
  .feed-row { align-items: flex-start; flex-direction: column; gap: 14px; }
  .feed-row-actions { flex-wrap: wrap; }
  .connections-list { margin: 0 12px; }
  .connection-row { align-items: flex-start; flex-direction: column; gap: 14px; }
  .connection-actions { flex-wrap: wrap; }
  .user-access-row { grid-template-columns: 1fr; }
  .agent-grants { grid-template-columns: 1fr; }
  .user-access-actions { justify-content: flex-end; }
}

@media (max-width: 430px) {
  .login-view { padding: 12px; }
  .login-panel { padding: 32px 22px; }
  .brand-name {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  .invite-page { padding-top: 9vh; }
  .invite-form { grid-template-columns: 1fr; }
  .invite-purpose,
  .invite-form .user-save-button { grid-column: 1; }
  .invite-row { align-items: flex-start; flex-direction: column; }

}

@media (prefers-reduced-motion: reduce) {
  .conversation {
    scroll-behavior: auto;
  }

  .typing-bubble span {
    animation: none;
  }
}
