:root {
  color-scheme: light;
  --ink: #1f2a2e;
  --muted: #66777d;
  --paper: #fbfaf6;
  --panel: #ffffff;
  --line: #dfe5df;
  --teal: #0f7f7a;
  --teal-dark: #0c5f5b;
  --coral: #d9573d;
  --gold: #d6a642;
  --mint: #e3f4ea;
  --rose: #f8e7e1;
  --shadow: 0 18px 45px rgba(31, 42, 46, 0.1);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(15, 127, 122, 0.1), transparent 32%),
    linear-gradient(315deg, rgba(217, 87, 61, 0.1), transparent 28%),
    var(--paper);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 284px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-weight: 800;
}

.brand span,
small,
.eyebrow {
  color: var(--muted);
}

.brand strong,
.brand span {
  display: block;
}

.tabs {
  display: grid;
  gap: 8px;
}

.tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.tab span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.tab.is-active {
  border-color: rgba(15, 127, 122, 0.25);
  background: var(--mint);
  box-shadow: inset 3px 0 0 var(--teal);
}

.rail-card {
  margin-top: 32px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.rail-card strong {
  display: block;
  margin: 7px 0;
  font-size: 30px;
  line-height: 1;
}

.rail-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 24px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 7px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.2;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(94px, 1fr));
  overflow: hidden;
  min-width: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.stat-strip div {
  padding: 14px 16px;
  border-left: 1px solid var(--line);
}

.stat-strip div:first-child {
  border-left: 0;
}

.stat-strip span {
  display: block;
  font-size: 24px;
  font-weight: 800;
}

.view {
  display: none;
}

.view.is-visible {
  display: grid;
  gap: 18px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.workspace-grid.equal {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.form-grid,
.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label,
.textarea-label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  outline: none;
}

textarea {
  min-height: 128px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 127, 122, 0.14);
}

.primary-button,
.ghost-button,
.mini-button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
}

.primary-button {
  padding: 0 16px;
  background: var(--teal);
  color: white;
}

.primary-button:hover {
  background: var(--teal-dark);
}

.ghost-button,
.mini-button {
  padding: 0 14px;
  border-color: var(--line);
  background: white;
  color: var(--ink);
}

.mini-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.compliance-row {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 14px;
  border-radius: 8px;
  background: var(--mint);
}

.compliance-row p {
  margin: 0;
  color: var(--teal-dark);
  font-size: 13px;
  line-height: 1.45;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.toggle input {
  position: absolute;
  opacity: 0;
}

.toggle span {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #b8c8c2;
  transition: 160ms ease;
}

.toggle span::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  content: "";
  transition: 160ms ease;
}

.toggle input:checked + span {
  background: var(--teal);
}

.toggle input:checked + span::after {
  transform: translateX(18px);
}

.asset-panel {
  display: grid;
}

.review-card {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  min-height: 460px;
  overflow: hidden;
  padding: 34px 26px 24px;
  border: 1px solid #cbd7d0;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(227, 244, 234, 0.9), rgba(255, 255, 255, 0.95)),
    white;
  text-align: center;
}

.card-band {
  position: absolute;
  inset: 0 0 auto;
  height: 10px;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--coral));
}

.review-card h3 {
  margin: 12px 0 8px;
  font-size: 28px;
  line-height: 1.05;
}

.review-card p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 18px;
}

.review-card img {
  width: min(220px, 70vw);
  height: min(220px, 70vw);
  margin: 4px 0 20px;
  border: 10px solid white;
  border-radius: 8px;
  background: white;
  box-shadow: 0 12px 26px rgba(31, 42, 46, 0.12);
}

.review-card strong {
  max-width: 280px;
  font-size: 20px;
  line-height: 1.25;
}

.review-card small {
  overflow-wrap: anywhere;
  margin-top: 10px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.timeline-item {
  min-height: 152px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.timeline-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--rose);
  color: var(--coral);
  font-weight: 900;
}

.timeline-item p,
.template-card p,
.report-card p,
.pitch-text p {
  color: var(--muted);
  line-height: 1.55;
}

.template-stack {
  display: grid;
  gap: 12px;
}

.template-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.template-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.template-card h3 {
  margin-bottom: 0;
  font-size: 15px;
}

.template-card p {
  margin-bottom: 0;
  white-space: pre-wrap;
}

.customer-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.request-table {
  display: grid;
  gap: 8px;
}

.request-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 102px;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.request-row strong,
.request-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  justify-self: start;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 14px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f7f4;
}

.segment {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segment.is-active {
  background: white;
  color: var(--teal-dark);
  box-shadow: 0 2px 8px rgba(31, 42, 46, 0.08);
}

.response-box,
.report-card,
.pitch-text {
  min-height: 160px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  line-height: 1.6;
}

.report-card {
  margin-top: 14px;
}

.metric-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.metric {
  padding: 12px;
  border-radius: 8px;
  background: #f7f3e8;
}

.metric strong {
  display: block;
  font-size: 22px;
}

.slider-list {
  display: grid;
  gap: 22px;
}

.slider-list label {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.slider-list input {
  grid-column: 1 / -1;
  padding: 0;
  accent-color: var(--teal);
}

.slider-list span {
  color: var(--ink);
  font-weight: 900;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  padding: 11px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-weight: 800;
  transition: 180ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    height: auto;
    padding: 18px;
  }

  .tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .rail-card {
    display: none;
  }

  .topbar,
  .workspace-grid,
  .workspace-grid.equal {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .stat-strip {
    min-width: 0;
  }

  .timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  main {
    padding: 16px;
  }

  .rail {
    padding: 16px;
  }

  .tabs,
  .form-grid,
  .report-grid,
  .customer-form,
  .timeline,
  .stat-strip,
  .metric-list {
    grid-template-columns: 1fr;
  }

  .tab {
    min-height: 40px;
  }

  .request-row {
    grid-template-columns: 1fr;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

.panel-head button {
    width: 100%;
  }
}

.sync-pill {
  justify-self: end;
  min-width: 150px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.sync-pill.is-live {
  border-color: rgba(15, 127, 122, 0.28);
  background: var(--mint);
  color: var(--teal-dark);
}

.sync-pill.is-offline {
  border-color: rgba(217, 87, 61, 0.28);
  background: var(--rose);
  color: var(--coral);
}

.crm-panel {
  margin-bottom: 18px;
}

.client-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(140px, 0.7fr) minmax(190px, 1.2fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.client-list,
.followup-list {
  display: grid;
  gap: 8px;
}

.client-row,
.followup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.client-row.is-active {
  border-color: rgba(15, 127, 122, 0.35);
  background: var(--mint);
}

.client-row strong,
.followup-row strong {
  display: block;
}

.client-row small,
.followup-row small {
  display: block;
  overflow-wrap: anywhere;
}

.compact-textarea {
  min-height: 74px;
  margin-bottom: 14px;
}

.request-row {
  grid-template-columns: minmax(0, 1fr) 112px 132px 102px;
}

.due-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 1040px) {
  .topbar,
  .client-form {
    grid-template-columns: 1fr;
  }

  .sync-pill {
    justify-self: stretch;
  }
}

@media (max-width: 680px) {
  .client-row,
  .followup-row {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: white;
  }

  body * {
    visibility: hidden;
  }

  #reviewCard,
  #reviewCard * {
    visibility: visible;
  }

  #reviewCard {
    position: absolute;
    top: 24px;
    left: 24px;
    width: 420px;
    min-height: 560px;
    box-shadow: none;
  }
}
