:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --ink: #171b28;
  --muted: #6b7280;
  --soft: #eef0f4;
  --line: #e3e5ea;
  --copper: #b3745d;
  --copper-dark: #93563f;
  --green: #16c456;
  --red: #ff2f3d;
  --orange: #ff7a00;
  --purple: #7147ff;
  --shadow: 0 20px 60px rgba(17, 24, 39, 0.18);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button, input { font: inherit; }
button { cursor: pointer; }

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(760px, 1fr) 400px;
}

body.settings-open .app {
  grid-template-columns: 300px minmax(760px, 1fr);
}

.side-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 12px 0;
  background: linear-gradient(180deg, #dfad98 0%, #a96d56 100%);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.brand-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 26px;
  color: #fff;
}

.brand-row strong {
  font-size: 36px;
  line-height: 1;
  letter-spacing: 0;
}

.nav-collapse,
.nav-user button {
  border: 1px solid transparent;
  background: transparent;
  color: #fff;
}

.nav-kicker {
  width: 100%;
  margin: 14px 0 8px;
  padding: 0 14px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-weight: 800;
}

.nav-item {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-size: 20px;
  font-weight: 760;
  text-align: left;
}

.nav-item span {
  width: 25px;
  display: inline-grid;
  place-items: center;
  font-size: 20px;
}

.nav-item small {
  margin-left: auto;
  padding: 2px 12px;
  border-radius: 999px;
  color: var(--copper-dark);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.nav-item.active {
  color: var(--copper-dark);
  background: #fff;
  box-shadow: 0 10px 22px rgba(83, 48, 33, 0.16);
}

.nav-item.outline {
  border-color: rgba(255, 255, 255, 0.62);
}

.nav-spacer { flex: 1; }

.nav-user {
  width: calc(100% + 24px);
  min-height: 82px;
  display: grid;
  grid-template-columns: 48px 1fr 28px;
  align-items: center;
  gap: 12px;
  padding: 16px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
}

.nav-user span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--copper-dark);
  background: #fff;
  font-weight: 800;
}

.nav-user strong {
  font-size: 16px;
}

.board {
  min-width: 0;
  padding: 0 34px 40px;
}

body.settings-open .board {
  padding: 0 70px 48px;
}

.top-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 76px;
  display: flex;
  align-items: center;
  gap: 28px;
  background: rgba(247, 247, 248, 0.94);
  backdrop-filter: blur(12px);
}

.tab {
  border: 0;
  background: transparent;
  color: #40485a;
  font-size: 18px;
  font-weight: 500;
}

.tab.active {
  color: var(--ink);
  font-weight: 800;
}

.tab span {
  margin-left: 4px;
  color: #9aa1af;
  font-size: 14px;
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bucket-filters {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bucket-filter {
  height: 36px;
  padding: 0 12px;
  border: 1px solid #d3d7df;
  border-radius: 8px;
  color: #3b4659;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}

.bucket-filter.active {
  border-color: var(--copper-dark);
  color: #fff;
  background: var(--copper-dark);
}

.small-icon,
.tool-btn,
.add-btn {
  height: 48px;
  border: 1px solid #cfd3db;
  border-radius: 8px;
  background: #fff;
  color: #1c2230;
  font-weight: 750;
  box-shadow: 0 2px 0 rgba(17, 24, 39, 0.09);
}

.small-icon { width: 40px; }
.tool-btn { padding: 0 20px; }
.add-btn {
  padding: 0 24px;
  border-color: var(--copper-dark);
  box-shadow: 0 3px 0 rgba(147, 86, 63, 0.35);
}

.content {
  max-width: 1140px;
  margin: 0 auto;
}

.settings-header {
  max-width: 1450px;
  margin: 0 auto;
  padding: 36px 0 28px;
}

.settings-header h1 {
  margin: 0 0 4px;
  color: #101728;
  font-size: 36px;
  line-height: 1.1;
}

.settings-header p {
  margin: 0;
  color: #41516a;
  font-size: 18px;
}

.settings-layout {
  max-width: 1450px;
  display: grid;
  grid-template-columns: 306px minmax(0, 1fr);
  gap: 28px;
  margin: 10px auto 0;
}

.settings-menu,
.settings-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(17, 24, 39, 0.05);
}

.settings-menu {
  min-height: 690px;
  padding: 22px 18px;
}

.settings-menu h2 {
  margin: 0 0 22px;
  padding: 0 16px;
  font-size: 22px;
}

.settings-menu button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  color: #26344e;
  background: transparent;
  font-weight: 750;
  text-align: left;
}

.settings-menu button span {
  width: 22px;
  display: inline-grid;
  place-items: center;
  color: #344762;
  font-size: 21px;
}

.settings-menu button.active {
  background: #f0f1f4;
}

.settings-menu button.active span {
  color: var(--copper);
}

.settings-panel {
  min-height: 690px;
  padding: 28px;
}

.profile-policy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: -10px 0 22px;
}

.profile-policy-grid article {
  min-height: 78px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid #e0c9be;
  border-radius: 8px;
  background: #fff8f4;
}

.profile-policy-grid strong {
  color: #7f432d;
  font-size: 13px;
  text-transform: uppercase;
}

.profile-policy-grid span {
  color: #273349;
  font-size: 15px;
  font-weight: 760;
  line-height: 1.35;
}

.profile-form {
  display: grid;
  gap: 18px;
}

.profile-form label {
  display: grid;
  gap: 8px;
}

.profile-form label span {
  color: #26344e;
  font-weight: 850;
}

.profile-form textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #d2d8e2;
  border-radius: 8px;
  padding: 12px 14px;
  color: #172033;
  background: #fbfcff;
  line-height: 1.45;
  outline: 0;
}

.profile-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 6px;
}

.profile-actions span {
  color: #667085;
  font-size: 14px;
}

.profile-actions button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--copper-dark);
  border-radius: 8px;
  color: #fff;
  background: var(--copper-dark);
  font-weight: 850;
}

.panel-heading h2 {
  margin: 0 0 4px;
  font-size: 24px;
}

.panel-heading p {
  margin: 0 0 28px;
  color: #41516a;
  font-size: 17px;
}

.integration-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  overflow-x: auto;
}

.integration-tools input,
.filter {
  height: 44px;
  border: 1px solid #d2d8e2;
  border-radius: 8px;
  background: #fff;
}

.integration-tools input {
  width: 196px;
  padding: 0 14px;
  color: #1f2937;
  outline: 0;
}

.filter {
  padding: 0 20px;
  color: #2a3a54;
  background: #eef2f7;
  font-weight: 800;
  white-space: nowrap;
}

.filter.active {
  border-color: #1f5eff;
  color: #fff;
  background: #1f5eff;
}

.integrations-list {
  display: grid;
  gap: 20px;
}

.integration-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 5px rgba(17, 24, 39, 0.08);
}

.integration-main {
  min-height: 96px;
  display: grid;
  grid-template-columns: 58px minmax(260px, 1fr) auto 50px;
  align-items: center;
  gap: 20px;
  padding: 20px;
  border-bottom: 1px solid #20242e;
}

.integration-logo {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid #d6dce6;
  border-radius: 8px;
  color: #fff;
  background: #1f2937;
  font-size: 26px;
  font-weight: 900;
}

.integration-logo.google { background: linear-gradient(135deg, #ea4335, #fbbc05 48%, #34a853 49%, #4285f4); }
.integration-logo.slack { background: linear-gradient(135deg, #36c5f0, #2eb67d 35%, #ecb22e 65%, #e01e5a); }
.integration-logo.readai { background: #172033; }
.integration-logo.notion { color: #111827; background: #fff; }
.integration-logo.linear { background: #101828; }

.integration-main h3 {
  margin: 0 0 4px;
  color: #0f172a;
  font-size: 20px;
}

.integration-main p {
  margin: 0;
  color: #3c485c;
  font-size: 16px;
  line-height: 1.35;
}

.integration-badge {
  padding: 6px 10px;
  border-radius: 999px;
  color: #41516a;
  background: #eef2f7;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.integration-badge.available,
.integration-badge.connected {
  color: #05603a;
  background: #dcfae6;
}

.integration-badge.stubbed {
  color: #93370d;
  background: #ffead5;
}

.connect-btn,
.integration-account button {
  width: 48px;
  height: 46px;
  border: 1px solid #c8cdd6;
  border-radius: 10px;
  color: #162033;
  background: #fbfcff;
  box-shadow: 0 3px 0 rgba(17, 24, 39, 0.18);
  font-size: 24px;
}

.integration-account {
  min-height: 82px;
  display: grid;
  grid-template-columns: 16px minmax(0, 1.2fr) minmax(0, 0.9fr) max-content 50px 50px;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
}

.integration-account + .integration-account {
  border-top: 1px solid #eef0f4;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f59e0b;
}

.status-dot.connected {
  background: var(--green);
}

.integration-account strong {
  color: #172033;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.account-owner {
  color: #334155;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.account-state {
  justify-self: start;
  padding: 5px 9px;
  border-radius: 6px;
  color: #475467;
  background: #f2f4f7;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.account-detail {
  grid-column: 2 / -1;
  color: #697386;
  line-height: 1.45;
  margin-top: -10px;
}

.integration-account.empty {
  grid-template-columns: 16px minmax(0, 1.2fr) minmax(0, 0.9fr) max-content;
}

.empty-integrations {
  padding: 28px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #667085;
  background: #fbfcff;
}

.data-banner {
  margin: 20px 0 14px;
  padding: 12px 14px;
  border: 1px solid #f0c7a7;
  border-radius: 8px;
  color: #70452f;
  background: #fff6ee;
  font-size: 14px;
}

.quadrant-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0 18px;
}

.quadrant-card {
  min-height: 132px;
  position: relative;
  padding: 22px 20px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.04);
}

.quadrant-card.active {
  border-color: #9cf2ba;
  background: #edfff3;
  box-shadow: 0 7px 16px rgba(22, 196, 86, 0.16);
}

.quad-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 8px;
  color: #748095;
  background: #f3f5f8;
  font-size: 11px;
  font-weight: 800;
}

.quadrant-card.active .quad-icon {
  color: var(--green);
  background: #cffff0;
}

.quadrant-card strong {
  position: absolute;
  top: 28px;
  right: 20px;
  font-size: 23px;
}

.quadrant-card h3 {
  margin: 0 0 4px;
  color: #111827;
  font-size: 18px;
}

.quadrant-card p {
  margin: 0;
  color: #667085;
  font-size: 13px;
}

.task-section {
  margin-top: 24px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.section-heading::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #dfe3e8;
}

.section-heading h2 {
  margin: 0;
  font-size: 18px;
}

.section-heading span {
  color: #98a1b1;
  font-size: 14px;
}

.bond-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.04);
}

.bond-row {
  width: 100%;
  min-height: 73px;
  display: grid;
  grid-template-columns: 52px minmax(260px, 1fr) 120px 120px 64px;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border: 0;
  border-bottom: 1px solid #eceef2;
  background: #fff;
  text-align: left;
}

.bond-row:last-child { border-bottom: 0; }
.bond-row:hover { background: #fbfcff; }

.round-check,
.check-circle {
  width: 24px;
  height: 24px;
  display: inline-block;
  border: 2px solid #b8bdc5;
  border-radius: 50%;
}

.row-title {
  color: #2c2f36;
  font-size: 16px;
  font-weight: 720;
  line-height: 1.25;
}

.row-title small {
  display: inline-flex;
  margin-right: 8px;
  padding: 3px 7px;
  border: 1px solid #e6b9a6;
  border-radius: 5px;
  color: var(--copper-dark);
  background: #fff3ed;
  font-size: 11px;
}

.importance {
  justify-self: start;
  padding: 4px 9px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 750;
  line-height: 1;
}

.importance.critical {
  border: 1px solid var(--red);
  color: #e60012;
  background: #fff8f8;
}

.importance.high {
  border: 1px solid var(--orange);
  color: #f05e00;
  background: #fff8ef;
}

.due {
  color: var(--red);
  font-size: 16px;
  font-weight: 650;
}

.source-dot {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #e3e8ef;
  border-radius: 50%;
  color: #fff;
  background: #6a7eea;
  box-shadow: 0 2px 5px rgba(17, 24, 39, 0.18);
  font-size: 14px;
  font-style: normal;
  font-weight: 900;
}

.source-dot.gmail { background: #ef5350; }
.source-dot.slack { background: #31b47f; }
.source-dot.readai { background: #3842d6; }
.source-dot.natbot { background: #111827; }

.bond-chat {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e5e7eb;
  background: #fff;
}

body.settings-open .bond-chat {
  display: none;
}

.chat-brand {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.chat-brand strong {
  font-size: 21px;
  letter-spacing: 0;
}

.chat-brand button {
  border: 0;
  background: transparent;
  color: #6b7280;
  font-size: 18px;
}

.chat-tabs {
  height: 32px;
  display: grid;
  grid-template-columns: 1fr 1.55fr;
  align-items: center;
  border-top: 1px solid #f0f1f3;
  border-bottom: 1px solid #f0f1f3;
  color: #667085;
  font-size: 14px;
}

.chat-tabs span,
.chat-tabs strong {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 16px;
}

.chat-tabs strong {
  color: #111827;
  background: #fff;
}

.chat-log {
  flex: 1;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 26px 20px 16px;
}

.msg {
  max-width: 88%;
  position: relative;
  padding-left: 44px;
  color: #111827;
  font-size: 17px;
  line-height: 1.35;
}

.msg::before {
  content: "−";
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #111827;
  font-weight: 900;
}

.msg.user {
  justify-self: end;
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--copper);
}

.msg.user::before { display: none; }

.chat-form {
  display: flex;
  gap: 8px;
  margin: 0 18px 16px;
  padding: 10px;
  border: 1px solid #d7a894;
  border-radius: 12px;
  background: #fff;
}

.chat-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #111827;
  font-size: 16px;
}

.chat-form button {
  width: 46px;
  height: 42px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: #d5ab9b;
  font-size: 20px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 48px;
  background: rgba(14, 18, 27, 0.32);
  backdrop-filter: blur(8px);
}

.modal-overlay[hidden] { display: none; }

.task-modal {
  width: min(1048px, 86vw);
  min-height: 680px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-top {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid #eceef2;
}

.modal-top button {
  border: 0;
  background: transparent;
  color: #8a92a1;
  font-size: 24px;
}

.modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 262px;
  min-height: 628px;
}

.modal-main {
  padding: 26px 28px;
}

.modal-actions {
  padding: 22px 20px;
  border-left: 1px solid #e5e7eb;
  background: #fbfbfc;
}

.modal-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-title-row h2 {
  margin: 0;
  color: #2a2d34;
  font-size: 23px;
  line-height: 1.2;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 24px 0 30px;
  color: #a0a5af;
  font-size: 14px;
}

.modal-meta b {
  margin-left: 8px;
  color: #475467;
}

.modal-meta .importance { margin-left: 8px; }

.effort {
  padding: 4px 9px;
  border: 1px solid #f5b11b;
  border-radius: 5px;
  color: #bd7900 !important;
  background: #fff8e8;
}

.modal-block {
  margin-top: 24px;
}

.modal-block h3,
.modal-actions h3 {
  margin: 0 0 18px;
  color: #b0b4bd;
  font-size: 14px;
  text-transform: uppercase;
}

.modal-block p {
  max-width: 720px;
  margin: 0;
  color: #424852;
  font-size: 17px;
  line-height: 1.55;
}

.evidence-pill {
  min-width: 160px;
  height: 42px;
  border: 1px solid #cbd8ea;
  border-radius: 999px;
  color: #344054;
  background: #f9fbff;
  font-weight: 800;
}

.action {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 16px;
  border-radius: 8px;
  background: #fff;
  font-weight: 800;
  box-shadow: 0 3px 0 rgba(17, 24, 39, 0.18);
}

.action.primary {
  justify-content: center;
  border: 1px solid #814d3b;
  color: #fff;
  background: var(--copper);
}

.action.remind {
  border: 1px solid #dfb3bd;
  color: #b6566b;
  background: #fff7f9;
}

.action.snooze {
  border: 1px solid #ffc46e;
  color: #ae6a00;
  background: #fff5e4;
}

.action.schedule,
.action.assign {
  border: 1px solid #b69bff;
  color: var(--purple);
  background: #f7f3ff;
}

.action.muted {
  border: 1px solid #d6d8dc;
  color: #6b7280;
}

kbd {
  min-width: 21px;
  height: 21px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #cfd5df;
  border-radius: 5px;
  color: #667085;
  background: #f7f8fa;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .app {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  body.settings-open .app {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .bond-chat {
    grid-column: 2;
    position: static;
    height: 520px;
    border-top: 1px solid #e5e7eb;
  }

  .quadrant-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-layout { grid-template-columns: 1fr; }
  body.settings-open .board { padding: 0 24px 36px; }
  .settings-menu { min-height: auto; }
  .integration-account {
    grid-template-columns: 16px minmax(180px, 1fr) minmax(140px, 1fr) 140px 50px 50px;
  }
}

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side-nav { display: none; }
  .board { padding: 0 14px 24px; }
  .top-tabs {
    height: auto;
    min-height: 84px;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 0;
  }
  .top-actions {
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
  }
  .quadrant-row { grid-template-columns: 1fr; }
  body.settings-open .app { grid-template-columns: 1fr; }
  .settings-layout { gap: 14px; }
  .integrations-panel { padding: 16px; }
  .integration-main {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
  }
  .integration-badge { grid-column: 2 / 4; justify-self: start; }
  .integration-account {
    grid-template-columns: 12px minmax(0, 1fr) 46px 46px;
    gap: 10px;
    padding: 14px;
  }
  .account-owner,
  .account-state {
    grid-column: 2 / 5;
  }
  .bond-row {
    grid-template-columns: 36px minmax(0, 1fr) 78px;
    min-height: 88px;
  }
  .due, .source-dot { display: none; }
  .task-modal {
    width: calc(100vw - 20px);
    min-height: auto;
  }
  .modal-overlay { padding: 10px; }
  .modal-body { grid-template-columns: 1fr; }
  .modal-actions { border-left: 0; border-top: 1px solid #e5e7eb; }
}
