:root {
  color-scheme: light;
  --canvas: #f5f7f5;
  --paper: #fff;
  --ink: #142420;
  --muted: #5b6e65;
  --line: #dae4de;
  --pine: #1f6d58;
  --pine-dark: #14533f;
  --mist: #e5f1eb;
  --warm: #d9a26a;
  --red: #a83d38;
  --shadow: 0 12px 40px rgba(30, 65, 50, 0.055);
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    sans-serif;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
html {
  background: var(--canvas);
}
body {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
a {
  color: var(--pine);
}
:focus-visible {
  outline: 3px solid #8ac4a9;
  outline-offset: 2px;
}
#app {
  min-height: 100dvh;
}
.shell {
  max-width: 1020px;
  margin: auto;
  padding: 0 20px 96px;
}
.topbar {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--pine);
  color: white;
  font:
    700 22px Georgia,
    serif;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pine);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
h2 {
  font-size: 20px;
  letter-spacing: -0.02em;
  margin-bottom: 0;
}
h3 {
  font-size: 16px;
  margin-bottom: 12px;
}
p {
  color: var(--muted);
}
.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 42px 0 26px;
}
.hero p {
  margin: 8px 0 0;
}
.hero.compact {
  padding: 26px 0;
}
.hero-actions,
.inline-actions,
.section-title,
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.hero-actions,
.inline-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}
.stack {
  display: grid;
  gap: 16px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 23px;
  box-shadow: var(--shadow);
}
.card.soft {
  background: #fbfcfb;
  box-shadow: none;
}
.section-title {
  margin-bottom: 17px;
}
.section-title p {
  margin: 3px 0 0;
}
.btn {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 11px;
  min-height: 40px;
  padding: 8px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 600;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.15s,
    box-shadow 0.15s;
}
.btn:hover {
  background: #f5f9f6;
  border-color: #b8d6c5;
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn.primary {
  background: var(--pine);
  color: #fff;
  border-color: var(--pine);
}
.btn.primary:hover {
  background: var(--pine-dark);
  box-shadow: 0 5px 14px rgba(31, 109, 88, 0.17);
}
.btn.danger {
  color: var(--red);
  border-color: #efd5d2;
}
.btn.text {
  border-color: transparent;
  background: transparent;
  color: var(--pine);
  padding: 6px 8px;
}
.btn.small {
  min-height: 34px;
  font-size: 13px;
  padding: 5px 11px;
}
.btn.icon {
  width: 40px;
  padding: 0;
}
.muted {
  color: var(--muted);
}
.tiny {
  font-size: 12px;
}
.strong {
  font-weight: 700;
}
.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 7px;
  padding: 4px 9px;
  background: var(--mist);
  color: var(--pine-dark);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.chip.gray {
  color: var(--muted);
  background: #eef1ef;
}
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 17px;
}
.field {
  display: grid;
  gap: 7px;
}
.field > label,
.field-label {
  font-size: 13px;
  font-weight: 650;
  color: #42554b;
}
.input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 44px;
  outline: none;
}
.input:focus,
textarea:focus,
select:focus {
  border-color: var(--pine);
  box-shadow: 0 0 0 3px #d8eee3;
}
textarea {
  min-height: 95px;
  resize: vertical;
}
.toolbar .input {
  flex: 1;
}
.toolbar select {
  width: auto;
  min-width: 130px;
}
.list {
  display: grid;
  gap: 10px;
}
.customer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  text-decoration: none;
  color: inherit;
  padding: 18px 19px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 15px;
  transition:
    border-color 0.15s,
    transform 0.15s;
}
.customer-row:hover {
  border-color: #a5c9b5;
  transform: translateY(-1px);
}
.row-main {
  min-width: 0;
}
.row-main strong {
  display: block;
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-main small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.row-side {
  text-align: right;
  flex: none;
}
.row-side small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}
.empty {
  text-align: center;
  padding: 55px 24px;
  color: var(--muted);
}
.empty-mark {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  background: var(--mist);
  border-radius: 19px;
  color: var(--pine);
  font:
    32px Georgia,
    serif;
}
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
  padding: 9px max(18px, env(safe-area-inset-right))
    calc(9px + env(safe-area-inset-bottom));
}
.bottom-nav .nav-inner {
  display: flex;
  justify-content: center;
  gap: 8px;
  max-width: 1020px;
  margin: auto;
}
.bottom-nav a {
  display: grid;
  place-items: center;
  gap: 2px;
  min-width: 110px;
  padding: 5px 16px;
  border-radius: 11px;
  text-decoration: none;
  color: var(--muted);
  font-size: 12px;
}
.bottom-nav a.active {
  background: var(--mist);
  color: var(--pine-dark);
  font-weight: 700;
}
.nav-icon {
  font-size: 21px;
  line-height: 1;
}
.back {
  font-size: 13px;
  color: var(--pine);
  text-decoration: none;
  font-weight: 600;
}
.summary {
  border-left: 3px solid var(--warm);
  padding-left: 15px;
  white-space: pre-wrap;
  color: var(--ink);
}
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
}
.fact {
  min-width: 0;
}
.fact span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.fact strong {
  font-size: 14px;
  font-weight: 550;
  word-break: break-word;
}
.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}
.person-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.demand-row {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.demand-row:first-child {
  border: 0;
}
.timeline {
  position: relative;
  display: grid;
  gap: 15px;
  padding-left: 24px;
}
.timeline:before {
  content: "";
  position: absolute;
  left: 6px;
  top: 12px;
  bottom: 15px;
  width: 2px;
  background: #c7ddcf;
}
.timeline-item {
  position: relative;
}
.timeline-item:before {
  content: "";
  position: absolute;
  left: -25px;
  top: 16px;
  width: 12px;
  height: 12px;
  border-radius: 100%;
  background: var(--pine);
  border: 3px solid var(--canvas);
  box-sizing: content-box;
}
.timeline-item .card {
  padding: 17px;
}
.timeline-item p {
  margin: 10px 0 0;
  white-space: pre-wrap;
  color: var(--ink);
}
.timeline-item time {
  font-size: 12px;
  color: var(--muted);
}
.tabs {
  display: flex;
  gap: 5px;
  background: #e8efea;
  padding: 4px;
  width: max-content;
  border-radius: 12px;
  margin-bottom: 20px;
}
.tabs button {
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 7px 18px;
  color: var(--muted);
  font-weight: 600;
}
.tabs button.active {
  background: #fff;
  color: var(--pine-dark);
  box-shadow: 0 2px 8px #224d3515;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.form-grid .full {
  grid-column: 1/-1;
}
.form-section {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 22px;
}
.form-section:first-of-type {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}
.field-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.demand-editor {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr auto;
  gap: 9px;
  align-items: end;
  margin-top: 10px;
}
.photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 11px;
}
.photo {
  position: relative;
  width: 80px;
  height: 80px;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: #eff4f0;
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
}
.photo button {
  position: absolute;
  top: 0;
  right: 0;
  background: #fff;
  color: var(--red);
  border: 0;
  border-radius: 0 0 0 8px;
  width: 25px;
  height: 25px;
}
.upload-label {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  border: 1px dashed #95b7a4;
  border-radius: 11px;
  background: #f9fcfa;
  color: var(--pine);
  cursor: pointer;
  font-size: 12px;
  text-align: center;
}
.upload-label input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.service-image {
  margin-top: 10px;
  width: 96px;
  height: 76px;
  object-fit: cover;
  border-radius: 8px;
  cursor: zoom-in;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(17, 30, 25, 0.82);
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal img {
  max-width: min(100%, 1000px);
  max-height: 88vh;
  object-fit: contain;
}
.modal button {
  position: absolute;
  top: 18px;
  right: 18px;
}
.login-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(100%, 410px);
  padding: 36px;
}
.login-card .brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  margin-bottom: 28px;
}
.login-card h1 {
  font-size: 28px;
}
.login-card p {
  margin-bottom: 28px;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  border-radius: 11px;
  padding: 9px 16px;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  max-width: calc(100vw - 35px);
  text-align: center;
}
#toast.show {
  opacity: 1;
}
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #cce5d8;
  border-top-color: var(--pine);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 30px auto;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 680px) {
  .shell {
    padding: 0 14px 100px;
  }
  .topbar {
    height: 64px;
  }
  .topbar .top-actions .muted {
    display: none;
  }
  .hero {
    display: block;
    padding: 29px 0 21px;
  }
  .hero h1 {
    font-size: 29px;
  }
  .hero-actions {
    justify-content: flex-start;
    margin-top: 18px;
  }
  .card {
    padding: 17px;
    border-radius: 17px;
  }
  .grid,
  .form-grid,
  .facts {
    grid-template-columns: 1fr;
  }
  .form-grid .full {
    grid-column: auto;
  }
  .demand-editor {
    grid-template-columns: 1fr 1fr;
  }
  .demand-editor .field:nth-child(3) {
    grid-column: 1/-1;
  }
  .demand-editor .btn {
    justify-self: end;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .toolbar .input {
    flex-basis: 100%;
  }
  .toolbar select {
    flex: 1;
  }
  .btn {
    min-height: 42px;
  }
  .customer-row {
    padding: 14px;
  }
  .summary {
    font-size: 14px;
  }
  .login-card {
    padding: 27px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
/* Native CRM browser styling. */
