:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef2f6;
  --ink: #16181d;
  --muted: #6e7784;
  --line: #e3e7ed;
  --blue: #2672ff;
  --blue-soft: #e9f1ff;
  --green: #11a36a;
  --green-soft: #e8f7ef;
  --amber: #d98d12;
  --amber-soft: #fff4da;
  --red: #e84c4f;
  --red-soft: #ffecee;
  --shadow: 0 18px 60px rgba(22, 24, 29, 0.08);
  --radius: 8px;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.app-shell {
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr);
  min-height: 100vh;
}

.side-rail {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(24px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #111827;
  overflow: hidden;
}

.brand-mark span:first-child {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
}

.brand-mark span:last-child {
  position: absolute;
  right: 9px;
  bottom: 9px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #53d28f;
}

.nav-stack {
  display: grid;
  gap: 6px;
}

.nav-item,
.ghost-button,
.primary-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: var(--radius);
  transition:
    transform 140ms ease,
    background 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

.nav-item {
  justify-content: flex-start;
  width: 100%;
  padding: 10px 12px;
  color: var(--muted);
  background: transparent;
}

.nav-item:hover,
.nav-item.is-active {
  color: var(--ink);
  background: var(--surface-2);
}

.nav-item b {
  margin-left: auto;
  min-width: 26px;
  padding: 2px 7px;
  border-radius: 999px;
  text-align: center;
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
}

.nav-item-report {
  margin-bottom: 8px;
  color: #1258c8;
  border: 1px solid #cfe0ff;
  background: #f4f8ff;
}

.nav-item-report:hover,
.nav-item-report.is-active {
  color: #ffffff;
  border-color: var(--blue);
  background: var(--blue);
}

.nav-item-lead {
  margin-bottom: 8px;
  color: #16684c;
  border: 1px solid #bee8d5;
  background: #f0fbf6;
}

.nav-item-lead:hover,
.nav-item-lead.is-active {
  color: #ffffff;
  border-color: #0a8f60;
  background: #0a8f60;
}

.nav-item-project {
  margin-bottom: 8px;
  color: #5b3fb4;
  border: 1px solid #ddd3ff;
  background: #f8f5ff;
}

.nav-item-project:hover,
.nav-item-project.is-active {
  color: #ffffff;
  border-color: #6d4fd3;
  background: #6d4fd3;
}

.nav-item-vault {
  margin-bottom: 8px;
  color: #116457;
  border: 1px solid #bfe5dc;
  background: #f0faf7;
}

.nav-item-vault:hover,
.nav-item-vault.is-active {
  color: #ffffff;
  border-color: #116457;
  background: #116457;
}

.nav-item-report.is-active b {
  color: #1258c8;
}

.nav-item-lead.is-active b {
  color: #16684c;
}

.nav-item-project.is-active b {
  color: #5b3fb4;
}

.nav-item-vault.is-active b {
  color: #116457;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.calendar-panel {
  width: min(100%, 340px);
  overflow: hidden;
  padding: 0;
  border: 1px solid #dedbd2;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fffdf3 100%);
  box-shadow: 0 10px 24px rgba(22, 24, 29, 0.1);
}

.calendar-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 14px 0 16px;
  border-bottom: 1px solid #ebe8df;
  color: #282b30;
  font-size: 14px;
}

.calendar-summary strong {
  font-weight: 500;
}

.calendar-jump-button {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid #e3e0d8;
  border-radius: 5px;
  color: #555b64;
  background: rgba(255, 255, 255, 0.82);
}

.calendar-jump-button:hover {
  color: var(--ink);
  background: #f4f2eb;
}

.calendar-jump-button .icon {
  width: 14px;
  height: 14px;
}

.calendar-body {
  padding: 12px 12px 14px;
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 8px;
  padding: 0 2px;
}

.calendar-head strong {
  font-size: 15px;
  font-weight: 700;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.calendar-nav .icon-button {
  width: 30px;
  min-height: 30px;
  border-radius: 50%;
}

.calendar-nav .icon {
  width: 15px;
  height: 15px;
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  column-gap: 0;
}

.calendar-grid {
  row-gap: 4px;
}

.weekday-row span {
  padding: 8px 0;
  color: #202124;
  text-align: center;
  font-size: 12px;
  font-weight: 650;
}

.weekday-row span:first-child,
.weekday-row span:last-child {
  color: #d43d4d;
}

.day-cell {
  position: relative;
  display: grid;
  place-items: center;
  justify-self: center;
  width: 100%;
  max-width: 38px;
  aspect-ratio: 1;
  border-radius: 50%;
  color: #25272b;
  background: transparent;
  font-size: 13px;
}

.day-cell:hover {
  background: #f1efe7;
}

.day-cell.is-muted {
  color: #aaa8a0;
}

.day-cell.is-weekend:not(.is-selected) {
  color: #d43d4d;
}

.day-cell.is-weekend.is-muted:not(.is-selected) {
  color: #d99aa1;
}

.day-cell.is-today:not(.is-selected) {
  color: #0878d1;
  background: transparent;
  box-shadow: inset 0 0 0 1px #0878d1;
}

.day-cell.is-today.is-weekend:not(.is-selected) {
  color: #d43d4d;
  box-shadow: inset 0 0 0 1px #d43d4d;
}

.day-cell.is-selected {
  color: #ffffff;
  background: #0878d1;
  box-shadow: 0 4px 12px rgba(8, 120, 209, 0.25);
  font-weight: 700;
}

.day-cell span {
  line-height: 1;
}

.day-dot {
  position: absolute;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #0878d1;
}

.day-cell.is-weekend:not(.is-selected) .day-dot {
  background: #d43d4d;
}

.day-cell.is-selected .day-dot {
  background: #ffffff;
}

.day-cell:focus-visible,
.calendar-jump-button:focus-visible {
  outline: 2px solid #0878d1;
  outline-offset: 2px;
}

.main {
  min-width: 0;
  padding: 28px 32px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.08;
}

h2 {
  font-size: 24px;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.ghost-button {
  padding: 0 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: #ffffff;
}

.ghost-button:hover {
  background: var(--surface-2);
}

.ghost-button.danger {
  color: var(--red);
}

.primary-button {
  padding: 0 16px;
  color: #ffffff;
  background: var(--blue);
  box-shadow: 0 10px 24px rgba(38, 114, 255, 0.24);
}

.primary-button:hover {
  transform: translateY(-1px);
}

.icon-button {
  width: 40px;
  min-height: 40px;
  color: var(--muted);
  background: transparent;
}

.icon-button:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.metric span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  overflow: hidden;
  font-size: 28px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operations-policy-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.9fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid #bfd4ff;
  border-radius: 18px;
  background: linear-gradient(135deg, #f7faff 0%, #edf4ff 100%);
  box-shadow: 0 8px 24px rgba(38, 114, 255, 0.08);
}

.operations-policy-kicker {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.operations-policy-card h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.operations-policy-card p:not(.operations-policy-kicker),
.operations-policy-card li {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.operations-policy-card p:not(.operations-policy-kicker) {
  margin: 7px 0 0;
}

.operations-policy-card ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.operations-policy-card nav {
  display: grid;
  gap: 7px;
}

.operations-policy-card a {
  padding: 7px 10px;
  border: 1px solid #bfd4ff;
  border-radius: 10px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.daily-report-workspace {
  display: grid;
  gap: 18px;
}

.report-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.95fr);
  gap: 26px;
  align-items: end;
  padding: 26px;
  overflow: hidden;
  border: 1px solid #d8e5ff;
  border-radius: 22px;
  background:
    radial-gradient(
      circle at 100% 0,
      rgba(38, 114, 255, 0.18),
      transparent 42%
    ),
    linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%);
  box-shadow: var(--shadow);
}

.report-kicker {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.report-hero h2 {
  max-width: 680px;
  font-size: clamp(24px, 2.5vw, 36px);
  line-height: 1.15;
}

.report-hero-copy > p:last-child {
  max-width: 720px;
  margin: 12px 0 0;
  color: #596579;
  font-size: 14px;
  line-height: 1.65;
}

.target-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.72fr) auto;
  gap: 10px;
  align-items: end;
  padding: 16px;
  border: 1px solid rgba(207, 224, 255, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
}

.target-form .primary-button {
  min-height: 40px;
  white-space: nowrap;
}

.report-metric-strip {
  display: grid;
  grid-template-columns: 0.7fr 0.7fr 1.15fr 1fr;
  gap: 12px;
}

.report-metric {
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.report-metric span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.report-metric strong {
  display: block;
  overflow: hidden;
  font-size: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.target-panel,
.report-feed-zone {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.target-panel {
  padding: 18px;
}

.panel-help {
  margin: -5px 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.target-list {
  display: grid;
  gap: 8px;
}

.target-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f9fafc;
}

.target-item.is-selected {
  border-color: #a9c6ff;
  background: var(--blue-soft);
}

.target-item button {
  width: 100%;
  padding: 0;
  color: inherit;
  text-align: left;
  background: transparent;
}

.target-item strong,
.target-item span {
  display: block;
}

.target-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.report-feed-zone {
  min-width: 0;
  padding: 20px;
}

.report-feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.customer-report-list {
  display: grid;
  gap: 14px;
}

.customer-report-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

.customer-report-card.is-warning {
  border-color: #f1cf8a;
}

.customer-report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.customer-report-title {
  min-width: 0;
}

.customer-report-title strong {
  display: block;
  font-size: 16px;
}

.customer-report-title span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.report-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.report-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  color: #1258c8;
  background: var(--blue-soft);
  font-size: 11px;
  font-weight: 700;
}

.report-badge.good {
  color: #08734b;
  background: var(--green-soft);
}

.report-badge.warning {
  color: #925d00;
  background: var(--amber-soft);
}

.customer-report-copy {
  flex: 0 0 auto;
  min-width: 104px;
}

.customer-report-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.customer-report-actions .ghost-button,
.customer-report-actions .primary-button {
  min-height: 38px;
  white-space: nowrap;
}

.report-visual-preview {
  padding: 16px 18px 18px;
  border-bottom: 1px solid var(--line);
  background: #f3f6fa;
}

.report-visual-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 11px;
}

.report-visual-copy strong {
  color: #263244;
  font-size: 13px;
}

.report-visual-copy span {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.report-visual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
  gap: 12px;
}

.report-visual-panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid #dce3ec;
  border-radius: 14px;
  background: #ffffff;
}

.report-visual-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.report-visual-panel-head strong {
  color: #1f2937;
  font-size: 13px;
}

.report-visual-panel-head span {
  color: var(--muted);
  font-size: 10px;
}

.report-booking-table,
.report-rank-list {
  display: grid;
  gap: 4px;
}

.report-booking-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  padding: 3px 7px;
  border-radius: 6px;
  color: #4b5565;
  background: #fafbfc;
  font-size: 10px;
}

.report-booking-row.is-ours {
  color: #145fc7;
  background: #eaf2ff;
}

.report-booking-row b,
.report-booking-row strong {
  font-size: 10px;
}

.report-booking-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-rank-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 7px 9px;
  border: 1px solid #edf0f4;
  border-radius: 9px;
  background: #fafbfc;
}

.report-rank-row > span {
  overflow: hidden;
  color: #344054;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-rank-row b {
  color: #155bd5;
  font-size: 11px;
  white-space: nowrap;
}

.report-rank-row em {
  padding: 4px 7px;
  border-radius: 999px;
  color: #788397;
  background: #eef1f5;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.report-rank-row em.up {
  color: #cf372e;
  background: #fee9e7;
}

.report-rank-row em.down {
  color: #2268c7;
  background: #e8f1ff;
}

.customer-report-body {
  margin: 0;
  padding: 18px;
  overflow: auto;
  color: #2d3440;
  background: #ffffff;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.72;
  white-space: pre-wrap;
  word-break: keep-all;
}

.customer-report-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #fbfcfe;
  font-size: 11px;
}

.report-empty {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 28px;
  border: 1px dashed #cfd6e0;
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.cafe-lead-workspace {
  display: grid;
  gap: 18px;
}

.cafe-lead-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.36fr);
  gap: 28px;
  align-items: center;
  padding: 26px;
  overflow: hidden;
  border: 1px solid #cce8dc;
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0, rgba(49, 203, 137, 0.22), transparent 42%),
    linear-gradient(135deg, #ffffff 0%, #f0fbf6 100%);
  box-shadow: var(--shadow);
}

.cafe-lead-hero h2 {
  max-width: 680px;
  font-size: clamp(24px, 2.5vw, 36px);
  line-height: 1.15;
}

.cafe-lead-hero > div:first-child > p:last-child {
  max-width: 760px;
  margin: 12px 0 0;
  color: #54675f;
  font-size: 14px;
  line-height: 1.65;
}

.cafe-lead-coverage {
  min-width: 0;
  padding: 18px;
  border: 1px solid #d6e2dd;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
}

.cafe-lead-coverage span,
.cafe-lead-coverage strong,
.cafe-lead-coverage small {
  display: block;
}

.cafe-lead-coverage span {
  color: var(--muted);
  font-size: 12px;
}

.cafe-lead-coverage strong {
  margin-top: 7px;
  font-size: 18px;
}

.cafe-lead-coverage small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.cafe-lead-coverage.is-healthy {
  color: #08734b;
  border-color: #9edfc2;
  background: #edfaf4;
}

.cafe-lead-coverage.is-warning {
  color: #925d00;
  border-color: #f1cf8a;
  background: #fff8e9;
}

.cafe-lead-metrics {
  display: grid;
  grid-template-columns: 0.8fr 0.8fr 0.8fr 1.3fr;
  gap: 12px;
}

.cafe-lead-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1.08fr) minmax(400px, 0.92fr);
  gap: 18px;
  align-items: start;
}

.cafe-lead-list-zone,
.cafe-lead-detail {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.cafe-lead-list-zone {
  overflow: hidden;
}

.cafe-lead-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 15px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.cafe-lead-filter-grid {
  display: grid;
  grid-template-columns: 140px 140px minmax(160px, 1fr);
  gap: 9px;
  flex: 1;
}

.cafe-lead-filter-grid label,
.cafe-lead-detail-section > span,
.cafe-lead-status-control > span {
  color: var(--muted);
  font-size: 12px;
}

.cafe-lead-filter-grid label > span {
  display: block;
  margin-bottom: 5px;
}

.cafe-lead-filter-grid select,
.cafe-lead-filter-grid input {
  width: 100%;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #ffffff;
}

.cafe-lead-scope-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 15px;
  border-bottom: 1px solid #cfe7dc;
  background: #f2faf6;
}

.cafe-lead-scope-summary p {
  display: grid;
  gap: 3px;
  margin: 0;
}

.cafe-lead-scope-summary strong {
  color: #075f43;
  font-size: 14px;
}

.cafe-lead-scope-summary span {
  color: var(--muted);
  font-size: 12px;
}

.cafe-lead-scope-summary .ghost-button {
  flex: 0 0 auto;
  min-width: 150px;
  background: #ffffff;
}

.cafe-lead-list {
  display: grid;
  gap: 10px;
  max-height: 780px;
  padding: 14px;
  overflow: auto;
}

.cafe-lead-list-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #fbfcfd;
  font-size: 12px;
}

.cafe-lead-list-footer .ghost-button {
  min-width: 108px;
}

.cafe-lead-list-footer .ghost-button[hidden] {
  display: none;
}

.cafe-lead-card {
  display: block;
  width: 100%;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  text-align: left;
  background: #ffffff;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.cafe-lead-card:hover {
  border-color: #9dcfb9;
  box-shadow: 0 8px 24px rgba(12, 103, 71, 0.09);
  transform: translateY(-1px);
}

.cafe-lead-card.is-selected {
  border-color: #21a875;
  box-shadow: 0 0 0 2px rgba(33, 168, 117, 0.12);
  background: #f7fcfa;
}

.cafe-lead-card.classification-excluded {
  filter: saturate(0.45);
  opacity: 0.72;
}

.cafe-lead-card-head,
.cafe-lead-card-meta,
.cafe-lead-signals,
.cafe-lead-model-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cafe-lead-card-head {
  margin-bottom: 9px;
}

.cafe-lead-card-head span,
.cafe-lead-signals b {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.cafe-lead-score,
.cafe-lead-classification {
  color: #08734b;
  background: var(--green-soft);
}

.classification-uncertain .cafe-lead-classification {
  color: #925d00;
  background: var(--amber-soft);
}

.classification-potential .cafe-lead-classification {
  color: #6242a6;
  background: #efe9ff;
}

.cafe-lead-card.classification-potential {
  border-color: #d8cbf5;
  background: #fcfaff;
}

.cafe-lead-card.classification-potential.is-selected {
  border-color: #8d6bd1;
  box-shadow: 0 0 0 2px rgba(118, 82, 188, 0.13);
  background: #f8f4ff;
}

.classification-excluded .cafe-lead-classification {
  color: #5c6570;
  background: #e9edf1;
}

.cafe-lead-workflow {
  color: #1258c8;
  background: var(--blue-soft);
}

.cafe-lead-card > strong {
  display: block;
  font-size: 16px;
  line-height: 1.4;
}

.cafe-lead-card > p {
  display: -webkit-box;
  margin: 7px 0 10px;
  overflow: hidden;
  color: #596579;
  font-size: 13px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.cafe-lead-card-meta {
  gap: 6px 12px;
  color: var(--muted);
  font-size: 11px;
}

.cafe-lead-detail {
  position: sticky;
  top: 18px;
  overflow: hidden;
}

.cafe-lead-detail-empty,
.cafe-lead-empty {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.cafe-lead-detail-empty .icon {
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  color: #0a8f60;
}

.cafe-lead-detail-empty p,
.cafe-lead-empty p {
  max-width: 430px;
  margin: 7px 0 0;
  font-size: 13px;
  line-height: 1.55;
}

.cafe-lead-detail-head,
.cafe-lead-detail-section,
.cafe-lead-model-meta,
.cafe-lead-status-control {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.cafe-lead-detail-head {
  background: #f8fbfa;
}

.cafe-lead-detail-head h2 {
  margin: 13px 0 7px;
  font-size: 21px;
  line-height: 1.35;
}

.cafe-lead-detail-head > p,
.cafe-lead-detail-section p {
  margin: 0;
  color: #596579;
  font-size: 13px;
  line-height: 1.65;
}

.cafe-lead-detail-section > span {
  display: block;
  margin-bottom: 7px;
  font-weight: 700;
}

.cafe-lead-detail-section small {
  display: block;
  margin-top: 9px;
  color: #88919e;
  line-height: 1.45;
}

.cafe-lead-reason {
  background: #fbfdfc;
}

.cafe-lead-signals {
  margin-top: 10px;
}

.cafe-lead-signals b {
  color: #16684c;
  background: #e8f7ef;
}

.cafe-lead-model-meta {
  color: var(--muted);
  font-size: 11px;
}

.cafe-lead-status-control > div {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.cafe-lead-status-control button {
  min-height: 36px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
}

.cafe-lead-status-control button.is-active {
  color: #ffffff;
  border-color: #0a8f60;
  background: #0a8f60;
}

.cafe-lead-status-control small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.cafe-lead-source {
  width: calc(100% - 40px);
  margin: 18px 20px 20px;
  text-decoration: none;
}

.task-zone,
.smart-add,
.quick-add,
.report-panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.task-zone {
  min-width: 0;
  padding: 14px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.filter-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-2);
}

.segmented button {
  min-width: 70px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
}

.segmented button.is-active {
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(22, 24, 29, 0.08);
}

.select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.select-wrap select {
  min-width: 116px;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

select,
input {
  min-height: 40px;
  padding: 0 11px;
}

textarea {
  resize: vertical;
  padding: 11px;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(38, 114, 255, 0.12);
}

.bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--ink);
  background: var(--blue-soft);
}

.bulk-bar div {
  display: flex;
  gap: 6px;
}

.task-list {
  display: grid;
  gap: 18px;
}

.task-group {
  display: grid;
  gap: 10px;
}

.task-group-done {
  margin-top: 8px;
  padding: 14px;
  border: 1px solid #d7dce3;
  border-radius: 16px;
  background: #eef0f3;
}

.task-group-done .task-group-head strong {
  color: #374151;
}

.task-group-done .task-group-head span {
  color: #58616e;
}

.task-group-done .task-group-head b {
  color: #58616e;
  background: #dfe3e8;
}

.task-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.task-group-head strong,
.task-group-head span {
  display: block;
}

.task-group-head strong {
  font-size: 14px;
}

.task-group-head span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.task-group-head b {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 12px;
}

.task-group-list {
  display: grid;
  gap: 10px;
}

.task-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

.task-card.is-manual {
  border-color: #bfe9d2;
  background: #f7fcf9;
}

.task-card.is-ai {
  border-color: #cfe0ff;
  background: #f8fbff;
}

.task-card.is-overdue {
  border-color: #ffc8cd;
  background: #fff8f8;
}

.task-card.is-suggested {
  border-color: #cfe0ff;
  background: #f8fbff;
}

.task-card.is-selectable {
  cursor: pointer;
}

.task-card.is-selectable:hover {
  border-color: #9fc0ff;
  background: #f3f8ff;
}

.task-card.is-selected {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 0 0 3px rgba(38, 114, 255, 0.12);
}

.task-card.is-done {
  border-color: #cbd1d8;
  color: #4b5563;
  background: #f7f8f9;
}

.task-card.is-done .task-title {
  color: #4b5563;
}

.task-card.is-done .task-notes,
.task-card.is-done .latest-progress {
  color: #5f6875;
}

.task-card.is-done .latest-progress {
  background: rgba(255, 255, 255, 0.62);
}

.task-card.is-done .latest-progress .icon {
  color: #5f6875;
}

.task-card.is-done .priority-dot {
  background: #8b95a1;
}

.task-card.is-done .pill {
  color: #5f6875;
  background: #e5e7eb;
}

.task-check {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: #ffffff;
}

.task-check.is-done {
  color: #ffffff;
  border-color: #4b5563;
  background: #4b5563;
}

.requires-edit-connection {
  opacity: 0.72;
}

.requires-edit-connection:hover {
  opacity: 1;
}

.suggest-select {
  width: 22px;
  height: 22px;
  accent-color: var(--blue);
}

.task-main {
  min-width: 0;
}

.task-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.task-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 750;
}

.priority-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
}

.priority-dot.high {
  background: var(--red);
}

.priority-dot.low {
  background: var(--green);
}

.task-notes {
  display: -webkit-box;
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.latest-progress {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  color: #324153;
  background: rgba(255, 255, 255, 0.72);
}

.latest-progress .icon {
  margin-top: 1px;
  color: var(--blue);
}

.latest-progress p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 12px;
}

.pill.deadline {
  color: #1258c8;
  background: var(--blue-soft);
}

.pill.overdue {
  color: #c33135;
  background: var(--red-soft);
}

.pill.done {
  color: #08734b;
  background: var(--green-soft);
}

.pill.origin-manual {
  color: #08734b;
  background: var(--green-soft);
}

.pill.origin-ai {
  color: #1258c8;
  background: var(--blue-soft);
}

.pill.local-only-pill {
  color: #7a4d00;
  background: #fff1c7;
}

.pill.linked-pill {
  color: #5b3fb4;
  background: #eee8ff;
}

.pill.sync-synced {
  color: #08734b;
  background: var(--green-soft);
}

.pill.sync-pending {
  color: #7a4d00;
  background: #fff1c7;
}

.pill.sync-error {
  color: #c33135;
  background: var(--red-soft);
}

.pill.outcome-pill {
  color: #5b3fb4;
  background: #f3efff;
}

.pill.rollover-pill {
  color: #5b3fb4;
  background: #eee8ff;
}

.task-actions {
  display: flex;
  gap: 4px;
}

.right-stack {
  display: grid;
  gap: 14px;
}

.smart-add,
.quick-add,
.report-panel {
  padding: 16px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.toggle-field {
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #d9d0fb;
  border-radius: 12px;
  color: var(--ink);
  background: #faf8ff;
  cursor: pointer;
}

.toggle-field input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 1px 0 0;
  padding: 0;
  accent-color: #6d4fd3;
}

.toggle-field span,
.toggle-field strong,
.toggle-field small {
  display: block;
}

.toggle-field strong {
  font-size: 13px;
}

.toggle-field small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

label + label,
.form-row + label,
label + .form-row {
  margin-top: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-row.compact-3 {
  grid-template-columns: 1fr 0.82fr 0.9fr;
}

.form-row.compact-4 {
  grid-template-columns: 1fr 0.82fr 0.9fr 0.95fr;
}

.full {
  width: 100%;
  margin-top: 14px;
}

.smart-actions {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 8px;
  margin-top: 12px;
}

.smart-preview {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.smart-preview-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 8px;
  padding: 10px 10px 10px 12px;
  border: 1px solid #cfe0ff;
  border-radius: 12px;
  background: #f8fbff;
}

.smart-preview-item strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smart-preview-item p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.smart-preview-item .meta-row {
  margin-top: 7px;
}

.smart-preview-empty {
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 13px;
  line-height: 1.45;
}

.summary-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.summary-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.summary-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-item span,
.summary-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  color: var(--muted);
  text-align: center;
}

dialog {
  width: min(540px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 22px;
  box-shadow: 0 28px 90px rgba(22, 24, 29, 0.24);
}

#editDialog {
  width: min(680px, calc(100vw - 28px));
}

dialog::backdrop {
  background: rgba(22, 24, 29, 0.32);
}

.settings-panel {
  padding: 20px;
}

.dialog-head,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-head {
  margin-bottom: 18px;
}

.dialog-actions {
  margin-top: 18px;
}

.compact-title {
  margin: 18px 0 10px;
}

.progress-panel {
  margin-top: 14px;
  padding-top: 2px;
}

.sync-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #d9d0fb;
  border-radius: 14px;
  background: #faf8ff;
}

.traffic-renewal-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #badfc9;
  border-radius: 14px;
  background: #f5fcf7;
}

.sync-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.sync-panel-head p,
.sync-help {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.sync-help {
  margin-top: 10px;
}

.progress-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  margin-bottom: 12px;
  overflow: auto;
}

.progress-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.progress-item time {
  display: block;
  margin-bottom: 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.progress-item p,
.progress-empty {
  margin: 0;
  color: #3b4554;
  font-size: 13px;
  line-height: 1.45;
}

.progress-empty {
  padding: 12px;
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface-2);
}

.project-workspace {
  display: grid;
  gap: 18px;
}

.project-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 26px;
  overflow: hidden;
  border: 1px solid #ddd3ff;
  border-radius: 22px;
  background:
    radial-gradient(circle at 90% 10%, rgba(109, 79, 211, 0.16), transparent 32%),
    linear-gradient(135deg, #ffffff 0%, #f7f3ff 100%);
}

.project-hero h2 {
  font-size: clamp(22px, 2.4vw, 32px);
}

.project-hero p:last-child {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.project-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.project-layout {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.project-sidebar {
  display: grid;
  gap: 14px;
}

.project-create-panel,
.project-list-panel,
.project-detail {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.project-create-panel {
  padding: 18px;
}

.project-list-panel {
  min-width: 0;
  padding: 14px;
}

.project-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.project-list-head span,
.project-list-head strong {
  display: block;
}

.project-list-head span {
  color: var(--muted);
  font-size: 12px;
}

.project-list-head strong {
  margin-top: 2px;
  font-size: 15px;
}

.project-list-head select {
  width: auto;
  min-width: 112px;
}

.project-list {
  display: grid;
  gap: 9px;
  max-height: 560px;
  overflow: auto;
}

.project-card {
  display: block;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #ffffff;
  text-align: left;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    transform 140ms ease;
}

.project-card:hover {
  transform: translateY(-1px);
  border-color: #bfaeff;
  background: #fcfaff;
}

.project-card.is-selected {
  border-color: #6d4fd3;
  background: #f8f5ff;
  box-shadow: 0 0 0 3px rgba(109, 79, 211, 0.1);
}

.project-card-head,
.project-detail-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.project-card-head {
  justify-content: space-between;
  margin-bottom: 9px;
}

.project-status,
.project-priority {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.project-status.status-planned,
.pill.status-planned {
  color: #1258c8;
  background: var(--blue-soft);
}

.project-status.status-in_progress,
.pill.status-in_progress {
  color: #08734b;
  background: var(--green-soft);
}

.project-status.status-on_hold,
.pill.status-on_hold {
  color: #7a4d00;
  background: #fff1c7;
}

.project-status.status-completed,
.pill.status-completed {
  color: #5f6875;
  background: #e8ebef;
}

.project-priority {
  color: var(--muted);
  background: var(--surface-2);
}

.project-priority.priority-high {
  color: #c33135;
  background: var(--red-soft);
}

.project-priority.priority-low {
  color: #58616e;
  background: #f1f3f5;
}

.project-card > strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card > p {
  display: -webkit-box;
  min-height: 34px;
  margin: 6px 0 10px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.project-card-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.project-card-progress > span,
.project-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7e9ee;
}

.project-card-progress i,
.project-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6d4fd3, #2672ff);
}

.project-card-progress b {
  color: #5b3fb4;
  font-size: 11px;
}

.project-card > small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.project-list-empty,
.project-detail-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.project-list-empty {
  min-height: 180px;
  padding: 20px;
}

.project-list-empty strong,
.project-detail-empty strong {
  color: #3b4554;
}

.project-list-empty p,
.project-detail-empty p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.5;
}

.project-detail {
  position: sticky;
  top: 18px;
  min-width: 0;
  padding: 22px;
}

.project-detail-empty {
  min-height: 520px;
}

.project-detail-empty .icon {
  width: 30px;
  height: 30px;
  margin-bottom: 10px;
  color: #6d4fd3;
}

.project-detail-head {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.project-detail-head h2 {
  margin-top: 10px;
}

.project-detail-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.project-date-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.project-date-grid > div {
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
}

.project-date-grid span,
.project-date-grid strong {
  display: block;
}

.project-date-grid span {
  color: var(--muted);
  font-size: 11px;
}

.project-date-grid strong {
  margin-top: 5px;
  font-size: 13px;
}

.project-progress-section {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #ddd3ff;
  border-radius: 14px;
  background: #faf8ff;
}

.project-progress-section > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.project-progress-section span {
  color: var(--muted);
  font-size: 12px;
}

.project-progress-section strong {
  color: #5b3fb4;
  font-size: 18px;
}

.project-progress-track {
  height: 9px;
}

.project-update-form {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcfd;
}

.project-update-controls {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(180px, 1.3fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
}

.project-progress-input > span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.project-progress-input output {
  color: #5b3fb4;
  font-weight: 700;
}

.project-progress-input input[type="range"] {
  padding: 0;
  border: 0;
  box-shadow: none;
  accent-color: #6d4fd3;
}

.project-readonly-help {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.project-timeline-section {
  margin-top: 20px;
}

.project-timeline-section .panel-title b {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 999px;
  color: #5b3fb4;
  background: #eee8ff;
  font-size: 11px;
}

.project-timeline {
  display: grid;
  gap: 0;
  max-height: 520px;
  overflow: auto;
}

.project-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  padding: 0 4px 16px 0;
}

.project-timeline-item::before {
  position: absolute;
  top: 12px;
  bottom: -1px;
  left: 6px;
  width: 1px;
  background: #d9d0fb;
  content: "";
}

.project-timeline-item:last-child::before {
  display: none;
}

.project-timeline-item > i {
  position: relative;
  z-index: 1;
  width: 13px;
  height: 13px;
  margin-top: 3px;
  border: 3px solid #eee8ff;
  border-radius: 50%;
  background: #6d4fd3;
}

.project-timeline-item time {
  display: block;
  color: #6d4fd3;
  font-size: 11px;
  font-weight: 700;
}

.project-timeline-item p {
  margin: 5px 0 0;
  color: #3b4554;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.project-timeline-item .meta-row {
  margin-top: 7px;
}

.project-timeline-empty {
  padding: 18px;
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface-2);
  text-align: center;
  font-size: 12px;
}

.vault-workspace {
  display: grid;
  gap: 18px;
}

.vault-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 26px;
  overflow: hidden;
  border: 1px solid #bfe5dc;
  border-radius: 22px;
  background:
    radial-gradient(circle at 92% 8%, rgba(17, 100, 87, 0.16), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #effaf7 100%);
}

.vault-hero h2 {
  max-width: 800px;
  font-size: clamp(22px, 2.4vw, 32px);
}

.vault-hero p:last-child {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.vault-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.vault-security-state,
.vault-encrypted-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #d6dce3;
  border-radius: 999px;
  color: #5c6674;
  background: #ffffff;
  font-size: 12px;
  font-weight: 750;
}

.vault-security-state.is-unlocked {
  color: #08734b;
  border-color: #a9ddca;
  background: var(--green-soft);
}

.vault-security-state.is-error {
  color: #b32d31;
  border-color: #f4bec0;
  background: var(--red-soft);
}

.vault-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 280px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: #3b4554;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.vault-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #d7eee8;
  border-top-color: #116457;
  border-radius: 50%;
  animation: vault-spin 800ms linear infinite;
}

@keyframes vault-spin {
  to {
    transform: rotate(360deg);
  }
}

.vault-auth-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  align-items: center;
  gap: 34px;
  width: min(920px, 100%);
  margin: 20px auto;
  padding: 34px;
  border: 1px solid #cfe4de;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(17, 100, 87, 0.12);
}

.vault-error-card {
  grid-template-columns: minmax(0, 1fr) auto;
  border-color: #f2c4c6;
}

.vault-auth-copy {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.vault-auth-copy h2 {
  margin-top: 3px;
  font-size: clamp(22px, 2.5vw, 30px);
}

.vault-auth-copy p:last-child {
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.vault-auth-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  color: #ffffff;
  background: #116457;
  box-shadow: 0 12px 28px rgba(17, 100, 87, 0.22);
}

.vault-auth-icon .icon {
  width: 25px;
  height: 25px;
}

.vault-auth-form {
  padding: 20px;
  border: 1px solid #dbe8e4;
  border-radius: 18px;
  background: #f8fcfb;
}

.vault-recovery-warning {
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #f2c4c6;
  border-radius: 12px;
  color: #8f272b;
  background: #fff6f6;
  cursor: pointer;
}

.vault-recovery-warning input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 1px 0 0;
  padding: 0;
  accent-color: #c33135;
}

.vault-recovery-warning strong,
.vault-recovery-warning small {
  display: block;
}

.vault-recovery-warning small {
  margin-top: 4px;
  color: #8a5557;
  line-height: 1.45;
}

.vault-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.vault-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(130px, auto) minmax(130px, auto) auto;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.vault-search {
  position: relative;
  display: block;
}

.vault-search > span {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 12px;
  color: var(--muted);
  transform: translateY(-50%);
}

.vault-search input {
  padding-left: 40px;
}

.vault-layout {
  display: grid;
  grid-template-columns: minmax(310px, 370px) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.vault-list-panel,
.vault-editor {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.vault-list-panel {
  padding: 14px;
}

.vault-list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 12px;
}

.vault-list-head span,
.vault-list-head strong {
  display: block;
}

.vault-list-head span,
.vault-list-head small {
  color: var(--muted);
  font-size: 11px;
}

.vault-list-head strong {
  margin-top: 3px;
  font-size: 15px;
}

.vault-list-head small {
  max-width: 150px;
  text-align: right;
  line-height: 1.4;
}

.vault-list {
  display: grid;
  gap: 9px;
  max-height: 670px;
  overflow: auto;
}

.vault-card {
  display: block;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #ffffff;
  text-align: left;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    transform 140ms ease;
}

.vault-card:hover {
  transform: translateY(-1px);
  border-color: #8fcbbd;
  background: #f8fcfb;
}

.vault-card.is-selected {
  border-color: #116457;
  background: #f0faf7;
  box-shadow: 0 0 0 3px rgba(17, 100, 87, 0.1);
}

.vault-card.is-corrupt {
  border-color: #f2c4c6;
  background: #fff8f8;
  opacity: 1;
}

.vault-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.vault-type,
.vault-card-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}

.vault-type.type-account {
  color: #0c5c50;
  background: #dff5ef;
}

.vault-type.type-template {
  color: #55409c;
  background: #eee8ff;
}

.vault-type.type-memo {
  color: #7a4d00;
  background: #fff1c7;
}

.vault-type.type-corrupt {
  color: #b32d31;
  background: var(--red-soft);
}

.vault-card-date {
  color: var(--muted);
  font-size: 10px;
}

.vault-card > strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vault-card > p {
  display: -webkit-box;
  min-height: 34px;
  margin: 6px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: pre-wrap;
}

.vault-card-tags {
  display: flex;
  gap: 5px;
  margin-top: 10px;
  overflow: hidden;
}

.vault-card-tags span {
  min-height: 20px;
  color: #5c6674;
  background: var(--surface-2);
  font-size: 10px;
  white-space: nowrap;
}

.vault-list-empty,
.vault-editor-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.vault-list-empty {
  min-height: 220px;
  padding: 24px;
}

.vault-list-empty p,
.vault-editor-empty p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.5;
}

.vault-editor {
  position: sticky;
  top: 18px;
  padding: 22px;
}

.vault-editor-empty {
  min-height: 560px;
}

.vault-editor-empty .icon {
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  color: #116457;
}

.vault-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.vault-editor-head h2 {
  margin-top: 3px;
}

.vault-encrypted-badge {
  min-height: 32px;
  color: #08734b;
  border-color: #a9ddca;
  background: var(--green-soft);
  white-space: nowrap;
}

.vault-input-action {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.vault-input-action input {
  min-width: 0;
}

.vault-input-action button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #495362;
  background: #ffffff;
  font-size: 11px;
}

.vault-input-action button:hover {
  color: #116457;
  border-color: #9ed2c6;
  background: #f0faf7;
}

.vault-copy-body {
  justify-self: end;
  min-height: 34px;
  margin-top: 8px;
}

.vault-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.danger-ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #f0bfc1;
  border-radius: var(--radius);
  color: #b32d31;
  background: #fff8f8;
}

.danger-ghost-button:hover {
  background: var(--red-soft);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 44px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-rail {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    padding: 14px 18px;
  }

  .calendar-panel {
    grid-column: 1 / -1;
  }

  .nav-stack {
    grid-auto-flow: column;
    overflow: auto;
  }

  .nav-item {
    min-width: 130px;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .operations-policy-card {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  }

  .operations-policy-card nav {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-hero {
    grid-template-columns: 1fr;
  }

  .report-layout {
    grid-template-columns: 1fr;
  }

  .cafe-lead-hero,
  .cafe-lead-layout {
    grid-template-columns: 1fr;
  }

  .cafe-lead-detail {
    position: static;
  }

  .project-layout {
    grid-template-columns: 1fr;
  }

  .project-sidebar {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }

  .project-detail {
    position: static;
  }

  .vault-layout {
    grid-template-columns: minmax(290px, 0.75fr) minmax(0, 1.25fr);
  }

  .vault-editor {
    position: static;
  }
}

@media (max-width: 1280px) and (min-width: 1121px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .right-stack {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .cafe-lead-hero,
  .cafe-lead-layout {
    grid-template-columns: 1fr;
  }

  .cafe-lead-detail {
    position: static;
  }

  .project-layout {
    grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr);
  }

  .vault-layout {
    grid-template-columns: minmax(290px, 0.72fr) minmax(0, 1.28fr);
  }
}

@media (max-width: 720px) {
  .side-rail {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 18px 14px;
  }

  .nav-stack {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .nav-item {
    min-width: 0;
  }

  .main {
    padding: 18px 14px 28px;
  }

  .topbar,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-controls {
    justify-content: stretch;
  }

  .select-wrap {
    flex: 1;
  }

  .top-actions,
  .segmented {
    width: 100%;
  }

  .top-actions > *,
  .segmented button {
    flex: 1;
  }

  .segmented {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-flow: row;
  }

  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .operations-policy-card {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .operations-policy-card nav {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .report-hero {
    padding: 18px;
  }

  .target-form {
    grid-template-columns: 1fr;
  }

  .report-metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cafe-lead-hero {
    padding: 18px;
  }

  .cafe-lead-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cafe-lead-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .cafe-lead-filter-grid {
    grid-template-columns: 1fr;
  }

  .cafe-lead-scope-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .cafe-lead-scope-summary .ghost-button {
    width: 100%;
  }

  .cafe-lead-list-footer {
    align-items: stretch;
    flex-direction: column;
    text-align: center;
  }

  .cafe-lead-list-footer .ghost-button {
    width: 100%;
  }

  .cafe-lead-status-control > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  .project-hero .ghost-button {
    width: 100%;
  }

  .project-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-sidebar {
    grid-template-columns: 1fr;
  }

  .project-detail {
    padding: 16px;
  }

  .project-date-grid,
  .project-update-controls {
    grid-template-columns: 1fr;
  }

  .project-update-controls .primary-button {
    width: 100%;
  }

  .vault-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  .vault-hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vault-security-state {
    grid-column: 1 / -1;
  }

  .vault-auth-card,
  .vault-error-card {
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 0;
    padding: 20px;
  }

  .vault-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vault-toolbar,
  .vault-layout {
    grid-template-columns: 1fr;
  }

  .vault-toolbar .primary-button {
    width: 100%;
  }

  .vault-list {
    max-height: 420px;
  }

  .vault-editor {
    padding: 16px;
  }

  .vault-editor-head,
  .vault-editor-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .vault-encrypted-badge {
    align-self: flex-start;
  }

  .vault-input-action {
    flex-wrap: wrap;
  }

  .vault-input-action input {
    flex: 1 1 100%;
  }

  .vault-editor-actions > * {
    width: 100%;
  }

  .report-metric strong {
    font-size: 17px;
  }

  .customer-report-head,
  .report-feed-head {
    align-items: stretch;
    flex-direction: column;
  }

  .customer-report-copy {
    width: 100%;
  }

  .customer-report-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .customer-report-actions .customer-report-copy {
    grid-column: 1 / -1;
  }

  .report-visual-copy {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-visual-copy span {
    text-align: left;
  }

  .report-visual-grid {
    grid-template-columns: 1fr;
  }

  .task-card {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .task-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-row.compact-3 {
    grid-template-columns: 1fr;
  }

  .form-row.compact-4 {
    grid-template-columns: 1fr;
  }
}
