:root {
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #25312d;
  background: #f7f8f5;
  font-size: 14px;
  --green: #24664e;
  --line: #e0e5de;
  --muted: #7b857b;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  display: flex;
  min-height: 100vh;
}
aside {
  width: 245px;
  padding: 34px 22px;
  position: fixed;
  inset: 0 auto 0 0;
  background: #edf1e9;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.brand {
  color: #234536;
  text-decoration: none;
  font-size: 26px;
  letter-spacing: -1px;
}
.brand strong {
  margin-left: 9px;
}
.muted {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
aside > .muted {
  font-size: 9px;
  letter-spacing: 1.6px;
  margin: 18px 0 36px;
}
nav {
  display: grid;
  gap: 9px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 15px;
  background: white;
  color: inherit;
  cursor: pointer;
}
button:hover {
  border-color: #769c80;
}
nav button {
  border: 0;
  text-align: left;
  padding: 13px;
  background: transparent;
  color: #606f62;
}
nav button.active {
  background: #dce6d7;
  color: #23513c;
  font-weight: 600;
}
footer {
  margin-top: auto;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
}
footer button {
  display: block;
  border: 0;
  background: none;
  font-size: 11px;
  padding: 12px 0;
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #6e9360;
  border-radius: 100%;
  margin-right: 5px;
}
main {
  margin-left: 245px;
  padding: 48px 54px;
  width: calc(100% - 245px);
  max-width: 1700px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: #819074;
}
h1 {
  font-size: 33px;
  font-weight: 500;
  letter-spacing: -1px;
  margin: 10px 0;
}
h2 {
  font-size: 23px;
  font-weight: 500;
  letter-spacing: -0.5px;
}
h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px;
}
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.badge {
  font-size: 11px;
  border-radius: 30px;
  background: #edf0e9;
  padding: 7px 11px;
}
.badge.warn {
  background: #fff1d8;
  color: #896027;
}
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.card,
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
}
.card span {
  color: var(--muted);
  font-size: 12px;
}
.card strong {
  display: block;
  font-size: 36px;
  font-weight: 400;
  margin: 18px 0 6px;
}
.grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 22px;
}
.panel p {
  color: #72806f;
  line-height: 1.75;
}
.panel + .panel {
  margin-top: 18px;
}
.hero {
  background: #e8eedf;
  border-color: #dae3d1;
  padding: 32px;
}
.hero h2 {
  font-size: 29px;
  max-width: 500px;
}
.hero p {
  max-width: 570px;
}
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 20px;
}
input,
select,
textarea {
  border: 1px solid #d7dfd3;
  border-radius: 6px;
  background: #fff;
  padding: 11px;
  color: inherit;
  max-width: 100%;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #a7c4a1;
}
textarea {
  min-height: 110px;
  resize: vertical;
}
label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  margin: 15px 0;
  color: #626f60;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  text-align: left;
}
th {
  font-size: 10px;
  letter-spacing: 1px;
  color: #88917e;
  font-weight: 500;
  padding: 16px;
}
td {
  padding: 16px;
  border-top: 1px solid #e8ece5;
  font-size: 13px;
}
td small {
  display: block;
  color: #8a9285;
  margin-top: 5px;
}
td a {
  color: #2b7154;
  text-decoration: none;
}
.empty {
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border: 1px dashed #cfd8c8;
  border-radius: 10px;
}
.empty p {
  color: #7c8874;
  max-width: 400px;
  margin: 12px auto 24px;
  line-height: 1.7;
}
.board {
  display: flex;
  gap: 14px;
  overflow: auto;
}
.column {
  background: #edf0e8;
  min-width: 220px;
  flex: 1;
  border-radius: 8px;
  padding: 16px;
}
.lead {
  background: white;
  padding: 16px;
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.lead p {
  color: #818b7b;
  font-size: 12px;
}
.timeline {
  list-style: none;
  padding: 0;
}
.timeline li {
  padding: 13px 0;
  border-bottom: 1px solid #edf0e8;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.timeline small {
  color: #8b9684;
}
.message {
  background: #f1f4eb;
  padding: 15px;
  border-radius: 8px;
  margin: 12px 0;
  white-space: pre-wrap;
}
.message small {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
}
dialog {
  border: 1px solid #dbe3d3;
  border-radius: 14px;
  padding: 36px;
  width: 560px;
  max-width: 95vw;
  color: inherit;
  max-height: 90vh;
}
dialog::backdrop {
  background: #15231dcc;
  backdrop-filter: blur(4px);
}
#login h2 {
  font-size: 40px;
  line-height: 1.15;
}
#login p {
  color: #7a8572;
  line-height: 1.6;
}
#login button {
  width: 100%;
  margin: 12px 0;
}
.close {
  float: right;
  border: 0;
  padding: 0;
  font-size: 25px;
}
.row {
  display: flex;
  gap: 15px;
}
.row > * {
  flex: 1;
}
#notice:not(:empty) {
  padding: 14px;
  background: #fff0d1;
  color: #8b6023;
  margin-bottom: 22px;
  border-radius: 6px;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  background: #f0f3eb;
  padding: 15px;
  max-height: 350px;
  overflow: auto;
}
.steps {
  counter-reset: s;
}
.step {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.step:before {
  counter-increment: s;
  content: counter(s);
  display: inline-grid;
  place-items: center;
  background: #e9efdf;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  margin-right: 10px;
}
.danger {
  color: #a1533d;
}
.settings-form {
  max-width: 720px;
}
@media (max-width: 1000px) {
  main {
    padding: 30px;
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  aside {
    width: 70px;
    padding: 20px 5px;
  }
  .brand {
    font-size: 22px;
  }
  .brand strong,
  aside > .muted,
  footer {
    display: none;
  }
  nav {
    margin-top: 35px;
  }
  nav button {
    font-size: 0;
    padding: 15px 5px;
  }
  nav button:first-letter {
    font-size: 18px;
  }
  main {
    margin-left: 70px;
    width: calc(100% - 70px);
    padding: 20px;
  }
  header {
    align-items: start;
    gap: 10px;
  }
  .actions {
    flex-wrap: wrap;
  }
  .card {
    padding: 16px;
  }
  .cards {
    gap: 10px;
  }
  .toolbar input {
    width: 100%;
  }
  table {
    display: block;
    overflow: auto;
  }
}
main {
  min-width: 0;
}
.cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.card,
.panel {
  min-width: 0;
}
.grid {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
}
@media (max-width: 1000px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.inbox-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 15px;
}
.mailbox {
  display: grid;
  grid-template-columns: minmax(240px, 330px) minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  height: min(740px, 75vh);
  min-height: 480px;
  overflow: hidden;
}
.thread-list {
  padding: 18px;
  border-right: 1px solid var(--line);
  min-height: 0;
  overflow: auto;
}
.thread-list input {
  width: 100%;
}
.thread-row {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 5px;
  padding: 17px 12px;
  border-bottom: 1px solid #edf0e9;
}
.thread-row strong {
  display: block;
  font-weight: 500;
}
.thread-row span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 8px;
}
.thread-row.selected {
  background: #e8eedf;
}
.thread-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: #fbfcf8;
}
.thread-panel .empty {
  border: 0;
  margin-top: 90px;
}
.thread-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 21px 24px;
  background: white;
  flex-shrink: 0;
}
.thread-heading h2 {
  font-size: 18px;
  margin: 0 0 5px;
}
.conversation-person {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.conversation-person .muted { font-size: 11px; }
.conversation-avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #e6ecdc;
  color: #4d633b;
  font-size: 13px;
  font-weight: 600;
}
.history-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 24px;
  border-bottom: 1px solid #edf0e8;
  color: var(--muted);
  font-size: 11px;
}
.history-bar button {
  padding: 3px 7px;
  font-size: 11px;
  border: 0;
  background: transparent;
  white-space: nowrap;
}
#messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 28px 24px;
}
#older-messages { align-self: center; margin-top: 8px; }
.message-day {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 20px 0;
  color: #7e8975;
  font-size: 10px;
}
.message-day::before, .message-day::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e8ecdf;
}
.message {
  width: fit-content;
  max-width: 82%;
  margin-right: auto;
  margin-top: 10px;
  margin-bottom: 10px;
  padding: 13px 16px 10px;
  border: 1px solid #e5e9df;
  border-radius: 14px 14px 14px 3px;
  background: white;
  white-space: normal;
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.message.outbound {
  margin-left: auto;
  margin-right: 0;
  background: #e4edda;
  border-color: #dce6cf;
  border-radius: 14px 14px 3px 14px;
}
.message-sender {
  color: #4f6640;
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 5px;
}
.message-text { white-space: pre-wrap; }
.message time {
  display: block;
  text-align: right;
  margin-top: 7px;
  color: #7a876e;
  font-size: 9px;
}
.message.system-message {
  max-width: 100%;
  background: #f0f2eb;
}
.conversation-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  background: white;
  flex-shrink: 0;
}
.conversation-footer span { color: var(--muted); font-size: 10px; }
button[hidden] { display: none; }
@media (max-width: 1050px) {
  .mailbox { grid-template-columns: 235px minmax(0, 1fr); }
  .conversation-footer { flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 850px) {
  .mailbox {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
  }
  .thread-list {
    max-height: 250px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .thread-panel {
    height: 600px;
  }
  #messages { padding: 10px 16px 20px; }
  .thread-heading, .conversation-footer { padding: 16px; }
  .history-bar { padding: 10px 16px; }
  .inbox-top {
    align-items: start;
    flex-direction: column;
  }
}
/* Browser-based MCP authorization uses the same workspace design. */
.oauth-page{display:grid;place-items:center;min-height:100vh;padding:32px}
.oauth-card{max-width:620px;background:#fff;border:1px solid #dce0d8;border-radius:18px;padding:36px}
.oauth-card h1{font-size:32px;line-height:1.15;margin:12px 0 24px}
.oauth-card p{line-height:1.55;margin:16px 0;overflow-wrap:anywhere}
.oauth-card input{width:100%;margin-top:8px}
.oauth-actions{display:flex;gap:12px;margin-top:24px}
