:root {
  --forest-900: #063f31;
  --forest-800: #075343;
  --forest-700: #0a6a55;
  --forest-100: #e6f3ee;
  --lake-600: #0b8c9e;
  --orange-600: #ff6a1a;
  --orange-100: #fff1e8;
  --red-600: #d84d3f;
  --paper: #fffdf9;
  --surface: #ffffff;
  --surface-soft: #f7faf8;
  --line: #dde8e2;
  --text: #17231f;
  --muted: #6d7a74;
  --shadow: 0 14px 35px rgba(24, 58, 45, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  color: var(--text);
  background: var(--paper);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(244, 250, 247, 0.88), rgba(255, 253, 249, 1) 42%),
    var(--paper);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 330px 1fr;
  align-items: center;
  min-height: 64px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(14, 66, 48, 0.12);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

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

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

.brand strong {
  display: block;
  font-size: 19px;
  line-height: 1.2;
}

.brand span,
.section-title p,
.soft-copy {
  color: var(--muted);
  font-size: 13px;
}

.main-nav {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.nav-tab {
  height: 42px;
  padding: 0 13px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #26352f;
  background: transparent;
  font-weight: 650;
}

.nav-tab.active {
  color: var(--forest-700);
  border-color: var(--forest-700);
}

.hero {
  height: 168px;
  padding: 34px 64px;
  color: white;
  background:
    linear-gradient(90deg, rgba(2, 48, 37, 0.82), rgba(2, 48, 37, 0.48) 42%, rgba(2, 48, 37, 0.08)),
    url("./assets/base-render-crop.jpg") center 52% / cover;
}

.hero-copy {
  width: 720px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.88;
}

.hero h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1.05;
  font-weight: 850;
}

.hero p {
  margin: 9px 0 0;
  font-size: 18px;
}

.hero-proof {
  display: flex;
  gap: 18px;
  margin-top: 18px;
  font-size: 13px;
}

.page {
  display: none;
  padding: 22px;
}

.page.active {
  display: block;
}

.copy-layout,
.calendar-layout,
 .library-layout {
  display: grid;
  gap: 22px;
}

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

.copy-layout {
  grid-template-columns: 300px minmax(560px, 1fr) 328px;
}

.calendar-layout {
  grid-template-columns: minmax(680px, 1fr) 320px;
}

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

.span-2 {
  grid-column: span 2;
}

.home-card,
.side-panel,
.composer-panel,
.right-panel,
.drawer-section,
.calendar-panel,
.task-editor,
.prices-page,
.template-card,
.result-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
}

.home-card,
.side-panel,
.composer-panel,
.drawer-section,
.calendar-panel,
.task-editor,
.prices-page {
  padding: 18px;
}

.right-panel {
  display: grid;
  align-content: start;
  gap: 15px;
  border: 0;
  background: transparent;
}

.section-title,
.result-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

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

h2 {
  margin-bottom: 4px;
  font-size: 19px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

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

.quick-actions button {
  min-height: 76px;
  padding: 14px;
  border: 1px solid rgba(10, 106, 85, 0.2);
  border-radius: 8px;
  color: var(--forest-900);
  background: #f1f8f4;
  font-weight: 750;
  text-align: left;
}

.check-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li,
.safety li {
  position: relative;
  padding-left: 22px;
  line-height: 1.5;
}

.check-list li::before,
.safety li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--forest-700);
}

.safety li.warn::before {
  background: var(--red-600);
}

.fact-stack {
  display: grid;
  gap: 10px;
}

.fact-stack b {
  display: block;
  padding: 10px 12px;
  border: 1px solid rgba(10, 106, 85, 0.16);
  border-radius: 8px;
  color: var(--forest-800);
  background: #f4faf7;
  font-size: 14px;
}

.task-list {
  display: grid;
  gap: 10px;
}

.task-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.task-item strong {
  display: inline-block;
  margin-left: 8px;
  color: var(--forest-800);
}

.task-item p {
  margin: 6px 0 0;
  color: #344840;
  font-size: 13px;
}

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

.task-item select {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
}

.task-actions {
  display: grid;
  grid-template-columns: 82px 42px 42px;
  align-items: center;
  gap: 4px;
}

.task-actions .text-button {
  padding: 0;
}

select.done,
.calendar-task.done {
  border-color: rgba(10, 106, 85, 0.28);
  color: var(--forest-800);
  background: #eaf6f1;
}

select.todo,
.calendar-task.todo {
  border-color: rgba(216, 77, 63, 0.24);
  color: #ad3a30;
  background: #fff3f0;
}

.composer-form {
  display: grid;
  gap: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: 86px 1fr;
  align-items: start;
  gap: 16px;
}

.field-row label {
  padding-top: 8px;
  color: #41554e;
  font-size: 14px;
  font-weight: 650;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.chip,
.small-button,
.secondary-button,
.text-button,
.project-option,
.title-options button {
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #334640;
  background: white;
}

.chip {
  min-height: 34px;
  padding: 0 14px;
}

.chip.active {
  border-color: rgba(10, 106, 85, 0.42);
  color: var(--forest-900);
  background: #eaf6f1;
  box-shadow: inset 0 0 0 1px rgba(10, 106, 85, 0.08);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #22352f;
  background: white;
}

input,
select {
  height: 38px;
  padding: 0 12px;
}

textarea {
  min-height: 118px;
  padding: 12px;
  resize: vertical;
  line-height: 1.6;
}

input[type="range"] {
  height: 6px;
  padding: 0;
  accent-color: var(--forest-700);
}

.duration-control {
  display: grid;
  gap: 8px;
}

.duration-topline {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 82px;
  align-items: center;
  gap: 12px;
}

.duration-topline strong {
  color: var(--forest-800);
  text-align: right;
  white-space: nowrap;
}

.duration-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.project-tools,
.table-tools,
.inline-add {
  display: grid;
  grid-template-columns: 1fr 180px auto;
  gap: 10px;
  margin-bottom: 10px;
}

.inline-add {
  grid-template-columns: 1fr auto;
  margin: 10px 0 0;
}

.selected-summary {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.project-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}

.project-option {
  min-height: 80px;
  padding: 10px;
  text-align: left;
}

.project-option span,
.template-card span {
  color: var(--muted);
  font-size: 12px;
}

.project-option strong {
  display: block;
  margin: 4px 0;
  color: #243a32;
  font-size: 14px;
}

.project-option em {
  color: var(--orange-600);
  font-style: normal;
  font-weight: 750;
}

.project-option.active {
  border-color: rgba(10, 106, 85, 0.5);
  background: #eef8f4;
}

.counter {
  display: block;
  margin-top: 5px;
  color: #9ba8a2;
  font-size: 12px;
  text-align: right;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-left: 102px;
}

.primary-button {
  min-width: 124px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--orange-600);
  font-weight: 800;
  box-shadow: 0 12px 22px rgba(255, 106, 26, 0.18);
}

.small-primary {
  min-width: 96px;
  height: 36px;
  box-shadow: none;
}

.secondary-button,
.small-button {
  min-height: 38px;
  padding: 0 14px;
}

.danger-button {
  border-color: rgba(216, 77, 63, 0.36);
  color: var(--red-600);
  background: #fff5f2;
}

.text-button {
  min-height: 30px;
  padding: 0 8px;
  border-color: transparent;
  color: var(--forest-700);
  background: transparent;
}

.danger {
  color: var(--red-600);
}

.result-panel {
  margin-top: 18px;
  padding: 16px;
  border-color: rgba(10, 106, 85, 0.44);
}

.result-heading {
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.result-heading h3 {
  margin: 0;
}

.result-heading span {
  margin-left: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.title-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 2px;
}

.title-options button {
  min-height: 52px;
  padding: 10px;
  text-align: left;
  color: var(--forest-800);
  background: #f5faf7;
}

.title-request {
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px solid rgba(10, 106, 85, 0.18);
  border-radius: 8px;
  background: #f5faf7;
}

.title-request b {
  display: block;
  margin-bottom: 6px;
  color: var(--forest-800);
}

.title-request p {
  margin: 0;
  color: #344840;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.result-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.result-row:last-child {
  border-bottom: 0;
}

.result-row b {
  color: #395148;
}

.result-row p {
  margin: 0;
  line-height: 1.7;
  white-space: pre-wrap;
}

.compact p {
  color: #1d6baf;
}

.price-list {
  display: grid;
}

.price-list p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: #3d4b47;
}

.price-list p:last-child {
  border-bottom: 0;
}

.price-list b {
  white-space: nowrap;
}

.safety {
  border-color: rgba(216, 77, 63, 0.26);
  background: linear-gradient(180deg, #fff8f4, #ffffff);
}

.safety ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.calendar-panel {
  min-height: 650px;
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: auto 1fr 150px auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.calendar-toolbar strong {
  color: var(--forest-900);
  font-size: 18px;
}

.calendar-toolbar input {
  height: 38px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-weekday {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.calendar-day {
  min-height: 100px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.calendar-empty {
  border-style: dashed;
  background: #f7faf8;
  opacity: 0.55;
}

.calendar-day b {
  display: block;
  margin-bottom: 8px;
}

.calendar-day span {
  display: block;
}

.calendar-task {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
}

.calendar-task small {
  display: block;
  color: var(--muted);
  font-weight: 500;
}

.has-task {
  border-color: rgba(10, 106, 85, 0.34);
}

.task-editor {
  display: grid;
  align-content: start;
  gap: 10px;
}

.task-editor label {
  color: #41554e;
  font-size: 13px;
  font-weight: 700;
}

.prices-page {
  max-width: 1320px;
  margin: 0 auto;
}

.editable-table {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.table-row {
  display: grid;
  grid-template-columns: 128px 1.15fr 118px 125px 1.1fr 1.7fr 64px;
  gap: 0;
  border-bottom: 1px solid var(--line);
}

.table-row:last-child {
  border-bottom: 0;
}

.table-row > * {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
}

.table-row > *:last-child {
  border-right: 0;
}

.table-head {
  color: var(--forest-900);
  background: #eef8f4;
  font-weight: 800;
}

.table-head span {
  padding: 12px;
}

.table-row textarea {
  min-height: 58px;
  padding: 10px 12px;
}

.template-card {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.template-card p {
  margin: 0;
  color: #344840;
  line-height: 1.7;
}

.card-actions {
  display: flex;
  gap: 10px;
}

.is-hidden {
  display: none !important;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  transform: translateY(20px);
  opacity: 0;
  padding: 12px 18px;
  border-radius: 8px;
  color: white;
  background: var(--forest-800);
  box-shadow: var(--shadow);
  transition: 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1180px) {
  body {
    min-width: 0;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }

  .main-nav {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .hero {
    height: auto;
    padding: 28px 22px;
  }

  .hero-copy {
    width: min(100%, 720px);
  }

  .home-grid,
  .copy-layout,
  .calendar-layout,
  .library-layout {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .quick-actions,
  .project-picker,
  .title-options {
    grid-template-columns: 1fr;
  }

  .field-row,
  .project-tools,
  .table-tools,
  .calendar-toolbar,
  .table-row {
    grid-template-columns: 1fr;
  }

  .actions {
    margin-left: 0;
  }
}
