/** Responsive personal lead workspace with readable cards and compact source panels.
 * @author Son Nguyen <hoangson091104@gmail.com>
 */
:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #1c332b;
  background: #f4f6f3;
  font-synthesis: none;
  --green: #226047;
  --ink: #193b2d;
  --muted: #708078;
  --line: #e2e8e0;
  --radius: 16px;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}
body {
  margin: 0;
  display: flex;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
select,
summary {
  cursor: pointer;
}
button {
  border: 1px solid #dce4d9;
  border-radius: 9px;
  background: #fff;
  padding: 10px 14px;
  color: #3b5145;
  font-size: 12px;
  font-weight: 550;
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:hover {
  background: #f0f5ee;
  border-color: #a8bfac;
}
button:disabled {
  cursor: wait;
  opacity: 0.6;
}
a {
  color: #28694b;
  text-underline-offset: 3px;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #7fb796;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
aside {
  width: 226px;
  height: 100dvh;
  position: fixed;
  inset: 0 auto 0 0;
  background: #163a2e;
  color: #b9cdbf;
  padding: 34px 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 2;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #f3fff5;
  font-size: 29px;
  text-decoration: none;
  font-weight: 750;
  letter-spacing: -1px;
}
.brand > span {
  line-height: 1;
}
.brand small {
  display: block;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 2.4px;
  color: #8cad99;
  margin-top: 9px;
}
.green {
  color: #b4dcb7;
}
.small {
  font-size: 9px;
  letter-spacing: 1.5px;
}
.sidebar-label {
  font-size: 9px;
  letter-spacing: 1.4px;
  color: #7f9e8a;
  margin: 38px 10px 14px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 11px;
  background: transparent;
  border: 0;
  color: #b0c5b7;
  text-align: left;
  font-size: 13px;
  padding: 13px 11px;
  margin: 3px 0;
  border-radius: 9px;
  text-decoration: none;
}
.nav-label {
  flex: 1;
}
.nav-count {
  font-size: 9px;
  padding: 4px 6px;
  border-radius: 5px;
  background: #385c44;
  color: #d1e6cd;
  white-space: nowrap;
}
.nav.active,
.nav:hover {
  background: #2b4e3c;
  color: #f2fff0;
  border: 0;
}
.aside-bottom {
  margin-top: auto;
  padding: 55px 10px 0;
}
.local-dot {
  font-size: 8px;
  color: #96bf9d;
  letter-spacing: 1px;
}
.aside-bottom b {
  display: block;
  font-size: 22px;
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: -0.7px;
  margin: 20px 0 12px;
  color: #dcecdc;
}
.aside-bottom p {
  font-size: 11px;
  line-height: 1.9;
  color: #89a491;
  margin: 0;
}
main {
  margin-left: 226px;
  width: calc(100% - 226px);
  padding: 0 36px;
  max-width: 1800px;
  min-width: 0;
}
header {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.breadcrumb-slash {
  padding: 0 12px;
  color: #a0afa1;
}
header b {
  color: #425344;
  font-weight: 500;
}
.account-menu {
  display: flex;
  align-items: center;
  gap: 9px;
}
.avatar {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: #e3ebdd;
  color: #446048;
  font-size: 11px;
}
.account-menu button {
  border: 0;
  background: transparent;
  font-size: 10px;
  color: #829183;
  margin-left: 6px;
  padding: 8px;
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 34px 0 28px;
}
.eyebrow,
.section-kicker {
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 1.7px;
  color: #7b8f79;
}
.eyebrow {
  margin: 0 0 11px;
}
.heading h1 {
  font-size: 34px;
  line-height: 1.22;
  font-weight: 600;
  letter-spacing: -1.5px;
  margin: 0 0 10px;
}
.heading .muted {
  margin: 0;
}
h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin: 0;
}
h3 {
  font-size: 16px;
}
.muted {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
}
.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
  padding: 12px 17px;
  white-space: nowrap;
  box-shadow: 0 2px 3px #193b2d0a;
}
.primary:hover {
  background: #174a34;
  border-color: #174a34;
}
.material-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.material-chips > span:not(.scope-note) {
  font-size: 9px;
  font-weight: 600;
  border: 1px solid #dbe6d8;
  border-radius: 5px;
  padding: 4px 7px;
  background: #edf2e9;
  color: #587054;
}
.scope-note {
  font-size: 10px;
  color: #8a9888;
  margin-left: 5px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.stats article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 2px 3px #26432602;
}
.stats article > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.stats article span:first-child {
  font-size: 11px;
  color: #667762;
}
.stat-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  background: #f0f5ec;
  color: #879f7c;
  font-size: 15px;
}
.facebook-icon {
  font-weight: 750;
  color: #697fa1;
  background: #eef2f6;
}
.stats strong {
  display: block;
  font-size: 33px;
  font-weight: 550;
  line-height: 1;
  margin: 15px 0 10px;
  color: #284a33;
  letter-spacing: -1px;
}
.stats small {
  font-size: 9px;
  color: #94a08e;
}
.notice {
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid #d9e6d4;
  border-radius: 11px;
  background: #eaf1e4;
  padding: 15px 18px;
  margin: 22px 0;
}
.notice-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid #cedfc5;
  border-radius: 8px;
  color: #5e8756;
  font-size: 18px;
  flex: none;
}
.notice b {
  font-size: 11px;
  font-weight: 600;
  color: #466542;
}
.notice p {
  font-size: 10px;
  line-height: 1.7;
  color: #7b9170;
  margin: 4px 0 0;
}
.schedule-badge {
  margin-left: auto;
  font-size: 8px;
  letter-spacing: 0.8px;
  white-space: nowrap;
  color: #57784b;
  border: 1px solid #d2e0c9;
  background: #f5f8ef;
  border-radius: 5px;
  padding: 7px 9px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 20px;
  align-items: start;
}
.panel,
.connection {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 5px #24432a02;
  min-width: 0;
  overflow: hidden;
}
.panel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 24px 23px 18px;
}
.panel-top .section-kicker {
  margin: 0 0 8px;
  font-size: 8px;
}
.panel-top .muted {
  margin: 6px 0 0;
  font-size: 10px;
}
.panel-top button {
  font-size: 10px;
  padding: 9px 11px;
  white-space: nowrap;
}
.filters {
  display: flex;
  gap: 8px;
  padding: 0 23px 20px;
  flex-wrap: wrap;
}
input,
select,
textarea {
  border: 1px solid #dde5da;
  border-radius: 8px;
  background: #fff;
  color: #374f3b;
  padding: 11px 12px;
  min-width: 0;
  font-size: 12px;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #9bbf9f;
  outline-offset: 1px;
}
.filters input {
  flex: 1 1 180px;
  background: #fafcf8;
}
.filters select {
  font-size: 10px;
  padding: 10px 8px;
  flex: 0 1 auto;
}
.lead {
  padding: 22px 23px;
  border-top: 1px solid #edf0e8;
}
.lead-top,
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.lead-top {
  justify-content: space-between;
}
.lead-top b {
  font-size: 13px;
  color: #2c4332;
}
.badge {
  font-size: 9px;
  padding: 5px 8px;
  border-radius: 5px;
  background: #edf4e8;
  color: #6c8b60;
}
.content {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.85;
  overflow-wrap: anywhere;
  color: #4d5e4d;
  margin: 13px 0 8px;
}
.lead > .muted {
  font-size: 10px;
  margin: 8px 0;
}
.actions {
  margin-top: 17px;
}
.actions a {
  font-size: 10px;
  color: #4c7c4b;
  text-decoration: none;
  margin-right: auto;
}
.actions button,
.actions select {
  font-size: 10px;
  padding: 8px;
}
.actions button:not(.delete) {
  background: #f4f8ef;
  border-color: #dce6d5;
  color: #5b7951;
}
.actions .delete {
  color: #b28f85;
  border-color: transparent;
  background: transparent;
}
.empty {
  text-align: center;
  padding: 60px 20px 70px;
  color: #8a9c87;
}
.empty-icon {
  font-size: 40px;
  color: #a4bea0;
}
.empty h3 {
  font-weight: 550;
  color: #52684e;
}
.empty p {
  font-size: 11px;
}
.right-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.connection {
  padding: 21px;
}
.section-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 13px;
}
.section-kicker {
  font-size: 8px;
}
.dot-label {
  font-size: 8px;
  color: #91a389;
  white-space: nowrap;
}
.connection > .muted {
  font-size: 11px;
  margin: 10px 0 17px;
}
#crawl-summary {
  font-size: 12px;
  font-weight: 550;
  line-height: 1.9;
  margin: 12px 0 5px;
  color: #44653b;
}
.crawl-date {
  font-size: 9px;
  color: #a0ac96;
  margin: 0 0 14px;
}
details {
  border-top: 1px solid #edf0e8;
}
summary {
  list-style: none;
  padding: 15px 0;
  font-size: 11px;
  font-weight: 500;
  color: #62765a;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
summary::-webkit-details-marker {
  display: none;
}
summary span {
  font-size: 14px;
  color: #9bac91;
}
details[open] > summary {
  color: #265c34;
}
#crawl-posts {
  max-height: 720px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#crawl-posts .lead {
  padding: 16px 0;
}
#crawl-posts b {
  font-size: 12px;
}
#crawl-posts p {
  font-size: 11px;
  line-height: 1.8;
  color: #7a8970;
  overflow-wrap: anywhere;
  margin: 8px 0;
}
#crawl-posts p:first-of-type {
  color: #4d6444;
}
#crawl-posts p:nth-of-type(2) {
  font-size: 10px;
  color: #9a846f;
}
#crawl-posts [data-status="pending"] {
  border-left: 3px solid #bdad76;
  padding-left: 12px;
}
#crawl-posts a {
  font-size: 10px;
}
#crawl-sources {
  max-height: 300px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#crawl-sources p {
  font-size: 11px;
  line-height: 1.8;
  margin: 9px 0;
}
#crawl-sources a {
  text-decoration: none;
}
.source-logo {
  font-size: 16px;
  font-weight: 750;
  color: #7184a4;
  background: #eff2f7;
  border-radius: 6px;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
}
.connection-actions {
  display: flex;
  gap: 7px;
}
.connection-actions button {
  font-size: 10px;
  padding: 10px 12px;
}
.connection-actions .primary {
  flex: 1;
}
#fb-state {
  font-size: 10px;
  line-height: 1.8;
  color: #9c937b;
  background: #f8f7f1;
  border: 1px solid #eeece0;
  border-radius: 7px;
  padding: 10px 12px;
  margin: 13px 0 0;
}
.mini-note {
  display: flex;
  gap: 12px;
  padding: 13px 8px;
  color: #a1af94;
}
.mini-note > span {
  font-size: 25px;
}
.mini-note b {
  font-size: 11px;
  font-weight: 500;
  color: #7c9070;
}
.mini-note p {
  font-size: 10px;
  line-height: 1.8;
  margin: 5px 0;
  color: #a0ad95;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0;
  font-size: 8px;
  letter-spacing: 1.6px;
  color: #a0ad96;
}
footer span:last-child {
  letter-spacing: 0;
}
#feedback {
  margin: 0 23px;
  font-size: 12px;
  color: #a96345;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  width: min(600px, calc(100% - 30px));
  color: var(--ink);
  box-shadow: 0 24px 80px #152f3526;
}
dialog::backdrop {
  background: #102d2559;
  backdrop-filter: blur(5px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  margin: 15px 0;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
#error,
#auth-error {
  color: #ad6548;
  font-size: 12px;
  line-height: 1.7;
}
form > .primary {
  width: 100%;
  margin-top: 10px;
}
.auth-page {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 25px;
  background: radial-gradient(ellipse at top, #e8f0df, #f5f7f1 65%);
}
.auth-card {
  background: white;
  border: 1px solid #dfe7d7;
  border-radius: 20px;
  padding: 38px;
  width: min(460px, 100%);
  box-shadow: 0 20px 70px #344e2510;
}
.auth-card h1 {
  font-size: 28px;
  letter-spacing: -1px;
  margin: 16px 0;
}
.auth-card button {
  width: 100%;
}
.auth-card input {
  padding: 13px;
}
.auth-card > .muted {
  font-size: 12px;
  line-height: 1.8;
}
.auth-card .eyebrow {
  font-size: 9px;
  line-height: 1.8;
}
#leads-area,
#crawl-results,
#facebook-area {
  scroll-margin-top: 24px;
}
@media (min-width: 1600px) {
  main {
    padding: 0 64px;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr) 360px;
  }
}
@media (max-width: 1250px) {
  main {
    padding: 0 24px;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 15px;
  }
  .stats article {
    padding: 16px;
  }
  .stats article span:first-child {
    font-size: 10px;
  }
  .stats small {
    font-size: 8px;
  }
  .panel-top,
  .lead {
    padding-left: 18px;
    padding-right: 18px;
  }
  .filters {
    padding-left: 18px;
    padding-right: 18px;
  }
}
@media (max-width: 1050px) {
  aside {
    width: 190px;
    padding: 26px 14px;
  }
  main {
    margin-left: 190px;
    width: calc(100% - 190px);
    padding: 0 20px;
  }
  .brand {
    font-size: 25px;
  }
  .nav {
    font-size: 11px;
    gap: 8px;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .right-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .mini-note {
    grid-column: 1/-1;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .heading h1 {
    font-size: 30px;
  }
  .account-menu > span:not(.avatar) {
    display: none;
  }
  .schedule-badge {
    display: none;
  }
}
@media (max-width: 650px) {
  aside {
    position: relative;
    inset: auto;
    height: auto;
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 19px 16px;
    gap: 5px;
  }
  .brand {
    flex-basis: 100%;
    margin-bottom: 12px;
  }
  .brand small {
    display: none;
  }
  .nav {
    margin: 0;
    padding: 10px 9px;
    font-size: 10px;
    gap: 5px;
  }
  .nav-count {
    font-size: 8px;
  }
  .sidebar-label,
  .aside-bottom {
    display: none;
  }
  body {
    display: block;
  }
  main {
    margin: 0;
    width: 100%;
    padding: 0 16px;
  }
  header {
    height: 58px;
    font-size: 10px;
  }
  .breadcrumb-slash {
    padding: 0 6px;
  }
  .account-menu {
    gap: 3px;
  }
  .account-menu button {
    font-size: 9px;
    margin: 0;
  }
  .avatar {
    display: none;
  }
  .heading {
    padding: 28px 0 23px;
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
  }
  .heading h1 {
    font-size: 29px;
  }
  .heading .primary {
    width: 100%;
  }
  .material-chips {
    margin-top: 14px;
  }
  .scope-note {
    font-size: 9px;
  }
  .stats {
    gap: 10px;
  }
  .stats article {
    padding: 15px;
  }
  .stats strong {
    font-size: 29px;
  }
  .stats small {
    font-size: 8px;
  }
  .stat-icon {
    width: 22px;
    height: 22px;
    font-size: 13px;
  }
  .notice {
    margin: 17px 0;
    padding: 13px;
    align-items: flex-start;
  }
  .notice p {
    font-size: 10px;
  }
  .notice-icon {
    display: none;
  }
  .workspace {
    gap: 16px;
  }
  .right-stack {
    display: flex;
  }
  .panel-top {
    padding: 20px 16px 16px;
    gap: 9px;
  }
  .panel-top h2 {
    font-size: 16px;
  }
  .panel-top .section-kicker {
    font-size: 7px;
  }
  .filters {
    padding: 0 16px 16px;
  }
  .filters input {
    flex-basis: 100%;
  }
  .filters select {
    flex: 1;
  }
  .lead {
    padding: 20px 16px;
  }
  .lead-top {
    gap: 8px;
  }
  .lead-top b {
    font-size: 12px;
  }
  .content {
    font-size: 12px;
  }
  .actions {
    gap: 6px;
  }
  .actions a {
    flex-basis: 100%;
    margin-bottom: 6px;
  }
  .actions select {
    flex: 1;
  }
  .connection {
    padding: 19px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .auth-card {
    padding: 26px;
  }
  .auth-card h1 {
    font-size: 25px;
  }
  footer span:last-child {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  button {
    transition: none;
  }
}

.review-tag {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 6px;
  background: #faf3e2;
  color: #997436;
  font-size: 10px;
}
.observation-lead {
  background: #fffefb;
}
.observation-lead .actions > .muted {
  font-size: 10px;
}

#include-manual {
  width: auto;
  margin-right: 8px;
}
