:root {
  --ink: #142f31;
  --muted: #647371;
  --paper: #f4f0e5;
  --panel: #fffdf8;
  --line: rgba(20, 47, 49, .16);
  --brand: #142f31;
  --brand-dark: #0d2426;
  --plum: #4257df;
  --plum-dark: #3347c4;
  --coral: #ff654f;
  --lime: #d7ef55;
  --lavender: #e8eaff;
  --rose: #ffe5dd;
  --sage: #edf3dc;
  --sage-dark: #687842;
  --gold: #bd8c38;
  --shadow: 0 18px 55px rgba(20, 47, 49, .12);
  --shadow-soft: 0 10px 30px rgba(20, 47, 49, .08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  min-height: 100vh;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

h1, h2, h3 { margin: 0; color: var(--ink); }
h1, h2 { font-family: Arial, Helvetica, sans-serif; letter-spacing: -0.045em; font-weight: 760; }
h1 em, h2 em { font-family: Georgia, "Times New Roman", serif; color: var(--plum); font-weight: 400; }
p { color: var(--muted); line-height: 1.55; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--plum);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: var(--brand);
  color: white;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(20, 47, 49, .22);
}
.brand-mark.small { width: 42px; height: 42px; border-radius: 13px; font-size: .95rem; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(440px, 47%) 1fr;
  background: var(--paper);
}
.auth-card {
  min-height: 100vh;
  padding: clamp(48px, 8vw, 96px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 2;
  background: var(--paper);
  border-right: 1px solid var(--line);
}
.auth-logo { width: min(290px, 74vw); height: auto; margin: 0 0 46px; }
.auth-card h1 { font-size: clamp(3rem, 6vw, 5.2rem); margin-top: 10px; }
.auth-copy { font-size: 1.1rem; max-width: 460px; margin: 18px 0 30px; }
.auth-form { display: grid; gap: 12px; max-width: 420px; }
.auth-form label, .modal-card label { display: grid; gap: 8px; color: var(--ink); font-weight: 700; font-size: .92rem; }
input, textarea, select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus, select:focus { border-color: var(--plum); box-shadow: 0 0 0 4px rgba(66, 87, 223, .11); }
.microcopy { font-size: .82rem; margin-top: 16px; }
.auth-art { min-height: 100vh; display: grid; place-items: center; overflow: hidden; padding: clamp(24px, 4vw, 58px); background: var(--brand); }
.auth-art-panel { width: min(720px, 100%); min-height: min(760px, calc(100vh - 96px)); display: grid; grid-template-rows: auto 1fr auto auto; gap: 28px; padding: clamp(26px, 4vw, 52px); border: 1px solid rgba(244,240,229,.22); border-radius: 30px; background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.012)); box-shadow: 0 28px 90px rgba(0,0,0,.16); }
.auth-art-topline { display: flex; justify-content: space-between; gap: 20px; color: rgba(244,240,229,.72); font-size: .74rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.auth-symbol { align-self: center; display: grid; place-items: center; }
.auth-symbol img { width: clamp(170px, 19vw, 248px); height: auto; filter: drop-shadow(0 20px 38px rgba(0,0,0,.17)); }
.auth-art-statement { margin: 0; color: var(--paper); font-size: clamp(2.15rem, 4vw, 4.4rem); line-height: .98; letter-spacing: -.045em; font-weight: 760; }
.auth-art-statement em { color: var(--lime); font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.auth-art-nav { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(244,240,229,.24); }
.auth-art-nav span { padding: 18px 10px 2px 0; color: rgba(244,240,229,.8); font-size: .78rem; line-height: 1.35; }

.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: var(--paper); box-shadow: 0 8px 20px rgba(20, 47, 49, .18); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--lavender); color: var(--plum-dark); }
.btn.compact { padding: 10px 16px; }
.full { width: 100%; }
.text-button { border: 0; background: transparent; color: var(--plum); font-weight: 700; padding: 6px; }
.text-button:hover { color: var(--plum-dark); }

.portal { min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 74px;
  padding: 0 28px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  background: rgba(244, 240, 229, .94);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-logo { width: 152px; height: auto; display: block; }
.brand-divider { width: 1px; height: 30px; background: var(--line); }
.brand-sub { display: block; color: var(--ink); font-size: .76rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.topnav { display: flex; justify-content: center; align-items: center; gap: 4px; }
.nav-link {
  border: 0;
  background: transparent;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
}
.nav-link:hover, .nav-link.active { color: var(--plum-dark); background: var(--lavender); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.avatar-button {
  width: 40px; height: 40px; border: 1px solid rgba(20,47,49,.15); border-radius: 50%; background: var(--rose); color: var(--ink); font-weight: 800;
}
.account-menu, .add-menu {
  position: fixed;
  right: 26px;
  top: 82px;
  z-index: 80;
  width: min(340px, calc(100vw - 24px));
  padding: 0;
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  overflow: hidden;
}
.account-menu { display: grid; align-items: stretch; }
.account-section { padding: 20px; }
.account-copy { min-width: 0; background: var(--brand); }
.account-copy strong, .account-copy span { display: block; }
.account-copy strong { color: var(--paper); font-size: 1.15rem; margin-top: 7px; }
.account-copy span:not(.account-kicker) { color: rgba(244,240,229,.72); font-size: .84rem; margin-top: 5px; overflow-wrap: anywhere; }
.account-kicker { color: var(--lime); font-size: .7rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.sign-out-button { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; border-top: 1px solid var(--line); padding: 15px 20px; text-align: left; color: #8e3328; background: var(--panel); font-weight: 750; }
.sign-out-button:hover { color: #6f241c; background: var(--rose); }
.add-menu { display: grid; gap: 5px; padding: 12px; }
.add-menu button { display: flex; gap: 12px; width: 100%; border: 0; background: transparent; text-align: left; padding: 12px; border-radius: 12px; }
.add-menu button:hover { background: var(--lavender); }
.add-menu strong, .add-menu small { display: block; }
.add-menu small { color: var(--muted); margin-top: 3px; }
.menu-icon { font-size: 1.3rem; }

.app-shell { width: min(1280px, calc(100% - 48px)); margin: 0 auto; padding: 44px 0 80px; }
.view { display: none; }
.view.active { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.hero-card {
  min-height: 360px;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  align-items: center;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.hero-copy { padding: clamp(34px, 6vw, 72px); }
.hero-copy h1 { font-size: clamp(2.8rem, 5vw, 4.9rem); line-height: .98; }
.hero-copy h1 em { white-space: nowrap; }
.hero-copy > p:not(.eyebrow) { font-size: 1.05rem; max-width: 660px; margin: 20px 0 26px; }
.hero-actions, .button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-graphic { align-self: stretch; display: grid; place-items: stretch; min-width: 320px; padding: 18px; }
.hero-brandscape { position: relative; min-height: 324px; display: grid; grid-template-rows: auto 1fr auto; gap: 22px; padding: 24px; border-radius: 22px; overflow: hidden; background: var(--brand); }
.hero-brandscape::before { content: ""; position: absolute; inset: 0; border-top: 7px solid var(--plum); border-bottom: 7px solid var(--lime); pointer-events: none; }
.brandscape-head { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brandscape-head img { width: 48px; height: 48px; border: 1px solid rgba(244,240,229,.22); border-radius: 14px; }
.brandscape-label { color: rgba(244,240,229,.72); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.brandscape-flow { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 8px; }
.flow-card { min-height: 138px; padding: 17px 14px; display: flex; flex-direction: column; justify-content: space-between; border-radius: 16px; color: var(--ink); box-shadow: 0 14px 30px rgba(0,0,0,.12); }
.flow-card span { font-size: .68rem; font-weight: 850; letter-spacing: .08em; }
.flow-card strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.04rem; line-height: 1.05; font-weight: 500; }
.flow-card small { color: rgba(20,47,49,.7); font-size: .68rem; }
.flow-talk { background: var(--lavender); transform: rotate(-2deg); }
.flow-decide { background: var(--rose); transform: translateY(9px); }
.flow-do { background: var(--sage); transform: rotate(2deg); }
.flow-line { width: 15px; height: 2px; background: rgba(244,240,229,.48); }
.brandscape-foot { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(244,240,229,.25); }
.brandscape-foot span { padding: 13px 8px 0 0; color: rgba(244,240,229,.84); font-size: .68rem; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 20px 0; }
.metric-card {
  min-height: 176px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  text-align: left;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: 0 8px 22px rgba(54, 43, 61, .045);
  overflow: hidden;
}
.metric-card::after { content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%; right: -38px; top: -38px; opacity: .52; }
.conversation-card::after { background: var(--lavender); }
.todo-card::after { background: var(--rose); }
.opportunity-card::after { background: var(--sage); }
.file-card::after { background: #eee6d9; }
.metric-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); }
.metric-icon { position: absolute; top: 20px; left: 22px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #f7f3f7; color: var(--plum); font-weight: 800; font-size: 1.1rem; }
.metric-label { color: var(--muted); font-size: .84rem; font-weight: 700; margin-bottom: 7px; }
.metric-card strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; font-weight: 500; }
.metric-meta { color: var(--muted); font-size: .78rem; margin-top: 4px; }

.home-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; }
.panel { background: white; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; box-shadow: 0 8px 20px rgba(54, 43, 61, .035); }
.panel-heading { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 22px; }
.panel-heading h2 { font-size: 1.8rem; }
.empty-state { padding: 28px; border: 1px dashed #ddd3dd; border-radius: 16px; color: var(--muted); background: #fcfafc; }
.compact-state { padding: 20px; }
.stack-list { display: grid; gap: 10px; }
.stack-row { display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px; border-radius: 14px; background: #faf8fa; border: 1px solid #f0ebef; }
.stack-row .status-dot { margin-top: 6px; }
.stack-row strong { font-size: .94rem; }
.stack-row span { display: block; color: var(--muted); font-size: .8rem; margin-top: 3px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); flex: 0 0 auto; }
.status-dot.done { background: var(--sage-dark); }

.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 28px; }
.page-heading.split { align-items: end; }
.page-heading h1 { font-size: clamp(2.6rem, 5vw, 4.4rem); }
.page-heading p:not(.eyebrow) { margin: 10px 0 0; max-width: 620px; }
.segmented { display: inline-flex; gap: 4px; background: #f1ecef; padding: 4px; border-radius: 12px; margin: -8px 0 20px; }
.segmented button { border: 0; background: transparent; color: var(--muted); padding: 8px 14px; border-radius: 9px; font-weight: 700; font-size: .86rem; }
.segmented button.active { background: white; color: var(--plum-dark); box-shadow: 0 3px 10px rgba(54, 43, 61, .08); }

.timeline-list { display: grid; gap: 14px; }
.timeline-item { display: grid; grid-template-columns: 130px 1fr auto; gap: 24px; align-items: center; padding: 22px; border-radius: 18px; background: white; border: 1px solid var(--line); }
.timeline-date { color: var(--plum); font-weight: 700; font-size: .84rem; }
.timeline-item h3 { font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; font-weight: 500; }
.timeline-item p { margin: 5px 0 0; font-size: .9rem; }
.timeline-item button { border: 0; background: #f2edf4; color: var(--plum-dark); padding: 9px 12px; border-radius: 10px; font-weight: 700; }

.card-list { display: grid; gap: 12px; }
.todo-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 18px 20px; border: 1px solid var(--line); background: white; border-radius: 16px; }
.todo-check { width: 25px; height: 25px; border: 1.5px solid #cbbdca; border-radius: 8px; display: grid; place-items: center; color: white; background: white; }
.todo-check.done { background: var(--sage-dark); border-color: var(--sage-dark); }
.todo-item h3 { font-size: .98rem; }
.todo-item p { margin: 4px 0 0; font-size: .82rem; }
.todo-due { color: var(--muted); font-size: .8rem; white-space: nowrap; }

.opportunity-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.opportunity-card-item { padding: 20px; background: white; border: 1px solid var(--line); border-radius: 18px; min-height: 220px; display: flex; flex-direction: column; }
.opportunity-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.opportunity-top h3 { font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; font-weight: 500; }
.opportunity-company { color: var(--muted); font-size: .82rem; margin-top: 3px; }
.stage-pill { padding: 6px 9px; border-radius: 999px; background: #f0ebf1; color: var(--plum-dark); font-size: .72rem; font-weight: 800; white-space: nowrap; }
.opportunity-notes { margin: 18px 0; font-size: .88rem; flex: 1; }
.next-step { padding-top: 14px; border-top: 1px solid #f0ebef; color: #514b55; font-size: .82rem; }
.next-step strong { color: var(--ink); }

.file-layout { display: grid; gap: 34px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title h2 { font-size: 1.7rem; }
.file-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.file-item { min-height: 180px; display: flex; flex-direction: column; justify-content: space-between; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.file-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--lavender); font-size: 1.25rem; }
.file-item h3 { font-size: .94rem; margin-top: 18px; word-break: break-word; }
.file-item p { font-size: .76rem; margin: 5px 0 0; }
.file-actions { display: flex; gap: 8px; margin-top: 14px; }
.file-actions button { border: 0; background: #f3eef4; color: var(--plum-dark); padding: 8px 10px; border-radius: 9px; font-size: .78rem; font-weight: 700; }

.modal { border: 0; padding: 0; border-radius: 22px; width: min(680px, calc(100% - 28px)); box-shadow: 0 24px 80px rgba(42,36,48,.24); }
.modal::backdrop { background: rgba(37, 30, 42, .44); backdrop-filter: blur(6px); }
.modal-card { padding: 28px; display: grid; gap: 18px; background: white; }
.modal-card.wide { width: min(840px, 100%); }
.modal-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.modal-heading h2 { font-size: 2rem; }
.modal-close { width: 38px; height: 38px; border: 0; border-radius: 50%; background: #f3eef3; color: #625a65; font-size: 1.5rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.span-2 { grid-column: span 2; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.document-editor { min-height: 330px; resize: vertical; line-height: 1.6; }
.upload-drop { padding: 34px 22px !important; display: grid !important; justify-items: center; text-align: center; border: 1.5px dashed #cabcca; border-radius: 18px; background: #fbf9fb; cursor: pointer; }
.upload-drop:hover { background: #f7f2f7; border-color: #a992aa; }
.upload-drop input { margin-top: 10px; max-width: 360px; }
.upload-drop span { color: var(--muted); font-weight: 400; font-size: .82rem; }
.upload-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--lavender); color: var(--plum); font-size: 1.35rem !important; font-weight: 800 !important; }
.progress { height: 8px; background: #eee9ed; border-radius: 999px; overflow: hidden; }
.progress span { display: block; width: 35%; height: 100%; background: var(--plum); animation: progress 1.2s ease-in-out infinite alternate; }
@keyframes progress { from { width: 15%; } to { width: 88%; } }
.conversation-detail { display: grid; gap: 18px; }
.conversation-detail section { padding: 16px 18px; background: #faf8fa; border-radius: 14px; }
.conversation-detail h3 { font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; color: var(--plum); margin-bottom: 6px; }
.conversation-detail p { margin: 0; white-space: pre-wrap; }

.toast { position: fixed; z-index: 120; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #2d2731; color: white; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow); transition: all .2s ease; font-size: .9rem; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1080px) {
  .topnav { display: none; }
  .topbar { grid-template-columns: 1fr auto; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .home-grid { grid-template-columns: 1fr; }
  .opportunity-grid { grid-template-columns: repeat(2, 1fr); }
  .file-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-card { padding: 38px 24px; }
  .topbar { padding: 0 16px; }
  .brand-logo { width: 138px; }
  .brand-divider, .brand-sub { display: none; }
  .app-shell { width: min(100% - 28px, 1280px); padding-top: 26px; }
  .hero-card { grid-template-columns: 1fr; min-height: 0; }
  .hero-graphic { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: 10px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}
@media (max-width: 560px) {
  .metric-grid, .opportunity-grid, .file-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 150px; }
  .page-heading.split { align-items: flex-start; flex-direction: column; }
  .todo-item { grid-template-columns: auto 1fr; }
  .todo-due { grid-column: 2; }
  .header-actions .btn { display: none; }
  .hero-copy { padding: 34px 26px; }
  .hero-copy h1 { font-size: 2.9rem; }
  .account-menu, .add-menu { right: 12px; top: 76px; }
}

.preview-banner {
  position: sticky;
  top: 72px;
  z-index: 35;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 9px 18px;
  background: #3f3450;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.14);
  font-size: .84rem;
}
.preview-banner .text-button { color: #fff; text-decoration: underline; }
.admin-tools { display: grid; gap: 8px; padding: 18px 20px; margin: 0; background: var(--panel); }
.admin-tools label { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.admin-tools p { margin: 0 0 4px; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.admin-tools select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; font: inherit; color: var(--ink); }
.preview-mode [data-add], .preview-mode .todo-check { opacity: .42; cursor: not-allowed; }
.preview-mode .hero-actions, .preview-mode #add-button { visibility: hidden; }
