:root {
  --ink: #172b32;
  --muted: #687a7d;
  --line: #cfdddc;
  --soft: #ecf3f2;
  --paper: #f7fbfa;
  --green: #176b81;
  --green-2: #2c9aae;
  --mint: #dceceb;
  --peach: #e0eff1;
  --gold: #a57c36;
  --shadow: 0 22px 60px rgba(16, 40, 49, .10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #edf3f2;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #edf3f2; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 252px; flex: 0 0 252px; padding: 28px 16px 20px; background: #fbfcfa; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 12px 38px; }
.brand-mark, .document-logo { display: grid; place-items: center; overflow: hidden; border-radius: 12px; color: white; background: var(--green); font-weight: 800; font-size: 18px; }
.brand-mark img, .document-logo img { display: block; width: 100%; height: 100%; }
.brand-mark { width: 34px; height: 34px; box-shadow: 0 6px 16px rgba(13,107,87,.2); }
.brand strong { display: block; font-size: 14px; letter-spacing: -.01em; }
.brand span { display: block; margin-top: 2px; color: #9aa59f; font-size: 10px; }
.main-nav { display: grid; gap: 5px; }
.nav-item { min-height: 42px; display: flex; align-items: center; gap: 11px; padding: 0 12px; color: #72807a; text-decoration: none; border-radius: 10px; font-size: 13px; }
.nav-item:hover { background: #f2f6f3; color: var(--ink); }
.nav-item.active { color: var(--green); background: #eaf4ef; font-weight: 700; }
.nav-icon { display: inline-block; width: 17px; color: currentColor; font-size: 17px; text-align: center; }
.nav-count { margin-left: auto; min-width: 20px; padding: 2px 6px; color: var(--green); background: #cfe8dc; border-radius: 20px; font-size: 10px; text-align: center; }
.sidebar-bottom { margin-top: auto; }
.storage-card { margin: 0 8px 20px; padding: 14px; background: #f3f6f3; border-radius: 12px; }
.storage-top { display: flex; justify-content: space-between; color: #64716b; font-size: 10px; font-weight: 700; }
.storage-track { height: 5px; margin: 10px 0 8px; overflow: hidden; background: #dfe8e2; border-radius: 10px; }
.storage-track span { display: block; width: 68%; height: 100%; background: var(--green); border-radius: inherit; }
.storage-card small { color: #98a29c; font-size: 9px; line-height: 1.3; }
.profile-row { display: flex; align-items: center; gap: 9px; padding: 16px 10px 0; margin-top: 13px; border-top: 1px solid var(--line); }
.avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: #315f76; background: #dceceb; font-size: 10px; font-weight: 800; }
.profile-row strong, .profile-row span { display: block; }
.profile-row strong { font-size: 11px; }
.profile-row span { margin-top: 2px; color: #9ba49f; font-size: 9px; }
.profile-row .more { margin-left: auto; color: #a6aea9; font-size: 11px; }

.main-content { min-width: 0; flex: 1; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(24px, 4vw, 60px); border-bottom: 1px solid var(--line); background: rgba(251,252,250,.78); }
.breadcrumbs { color: #9aa59f; font-size: 12px; }
.breadcrumbs strong { color: var(--ink); font-weight: 700; }
.crumb-separator { padding: 0 9px; color: #c1c9c4; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.saved-state { display: flex; align-items: center; gap: 7px; color: #8e9a94; font-size: 10px; }
.topbar-link { color: var(--green); font-size: 10px; font-weight: 800; text-decoration: none; }
.topbar-link:hover { color: #095946; text-decoration: underline; }
.saved-dot, .live-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: #42ad7f; box-shadow: 0 0 0 4px rgba(66,173,127,.12); }
.icon-button { width: 26px; height: 26px; border: 1px solid #dce4df; color: #68766f; background: transparent; border-radius: 50%; font-size: 12px; }
.small-avatar { border: 0; font-size: 9px; }
.page-wrap { max-width: 1520px; margin: 0 auto; padding: 46px clamp(24px, 4vw, 60px) 70px; }
.page-heading { display: flex; justify-content: space-between; gap: 30px; align-items: flex-end; margin-bottom: 38px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(30px, 3vw, 46px); line-height: 1.06; letter-spacing: -.065em; font-weight: 760; }
h1 em { color: var(--green); font-style: normal; }
.page-heading p { max-width: 390px; margin-top: 15px; color: #89948e; font-size: 13px; line-height: 1.55; }
.heading-actions { display: flex; gap: 10px; padding-bottom: 3px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 39px; padding: 0 15px; border: 1px solid transparent; border-radius: 9px; font-size: 11px; font-weight: 750; transition: .2s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--green); box-shadow: 0 8px 17px rgba(13,107,87,.16); }
.button.primary:hover { background: #095946; }
.button.secondary { color: #596861; border-color: #dce5df; background: #fff; }
.button.ghost { min-height: 34px; padding: 0 12px; color: var(--green); background: var(--mint); }

.workspace-grid { display: grid; grid-template-columns: minmax(500px, 1.05fr) minmax(400px, .95fr); gap: 26px; align-items: start; }
.panel-card { padding: 28px; background: #fff; border: 1px solid #e9eeea; border-radius: 16px; box-shadow: 0 10px 30px rgba(35,53,44,.03); }
.panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 23px; }
.section-kicker { display: block; margin-bottom: 8px; color: #a5afa9; font-size: 9px; letter-spacing: .15em; font-weight: 800; }
h2 { font-size: 18px; line-height: 1.1; letter-spacing: -.035em; }
.draft-pill { display: flex; align-items: center; gap: 6px; padding: 6px 9px; color: #9e6e39; background: var(--peach); border-radius: 20px; font-size: 9px; font-weight: 800; }
.draft-pill span:first-child { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.form-grid { display: grid; gap: 18px 14px; }
.two-col { grid-template-columns: 1fr 1fr; }
.field { display: grid; gap: 8px; min-width: 0; }
.field > span { color: #67756e; font-size: 10px; font-weight: 750; }
.field small { color: #afb8b3; font-size: 9px; font-weight: 500; }
input, select, textarea { width: 100%; color: var(--ink); border: 1px solid #e0e7e2; outline: none; border-radius: 8px; background: #fbfcfb; transition: .2s ease; }
input, select { height: 38px; padding: 0 11px; font-size: 12px; }
textarea { padding: 10px 11px; resize: vertical; font-size: 12px; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: #b4beb8; }
input:focus, select:focus, textarea:focus { border-color: #8bc2ae; box-shadow: 0 0 0 3px rgba(45,145,111,.09); background: white; }
.full-span { grid-column: 1 / -1; }
.section-divider { height: 1px; margin: 28px 0; background: var(--line); }
.compact-header { align-items: center; margin-bottom: 16px; }
.completion-label { color: #8f9b95; font-size: 10px; }
.checklist { display: grid; gap: 7px; }
.task-row { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 7px 10px; border: 1px solid #edf0ed; border-radius: 9px; background: #fcfdfc; }
.task-row.done { background: #f3faf6; border-color: #dcefe5; }
.task-check { width: 18px; height: 18px; flex: 0 0 18px; padding: 0; border: 1px solid #cbd8d0; border-radius: 5px; background: white; color: white; font-size: 11px; }
.task-row.done .task-check { border-color: var(--green); background: var(--green); }
.task-text { flex: 1; color: #51615a; font-size: 11px; }
.task-row.done .task-text { color: #99aaa0; text-decoration: line-through; }
.remove-task { border: 0; color: #b5c0ba; background: transparent; font-size: 15px; }
.add-task-row { display: flex; gap: 8px; margin-top: 9px; }
.add-task-row input { height: 34px; }
.photo-upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.upload-box { min-height: 117px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 12px; border: 1px dashed #cad9d0; border-radius: 10px; background: #fbfdfb; text-align: center; cursor: pointer; transition: .2s ease; }
.upload-box:hover { border-color: var(--green-2); background: #f3faf6; }
.upload-box input { display: none; }
.upload-icon { width: 25px; height: 25px; display: grid; place-items: center; margin-bottom: 2px; color: var(--green); background: var(--mint); border-radius: 7px; font-size: 14px; }
.upload-box strong { color: #53645b; font-size: 10px; }
.upload-box small, .upload-filename { max-width: 100%; overflow: hidden; color: #abb7b0; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.upload-filename { color: var(--green); }
.notes-field { margin-top: 18px; }

.preview-panel { min-width: 0; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; height: 42px; padding: 0 4px 12px; }
.preview-label { display: flex; align-items: center; gap: 8px; color: #7b8982; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.text-button { padding: 0; border: 0; color: var(--green); background: transparent; font-size: 10px; font-weight: 750; }
.preview-document { min-height: 690px; padding: clamp(24px, 3.5vw, 42px); overflow: hidden; color: #26332e; background: var(--paper); border: 1px solid #e8e7df; border-radius: 3px; box-shadow: var(--shadow); }
.document-topline, .document-brand-row, .document-meta, .doc-section-heading, .document-footer { display: flex; justify-content: space-between; align-items: center; }
.document-topline { color: #b2b6ac; font-size: 8px; letter-spacing: .14em; font-weight: 800; }
.document-brand-row { margin-top: 31px; justify-content: flex-start; gap: 10px; }
.document-logo { width: 29px; height: 29px; border-radius: 8px; font-size: 14px; }
.document-company { color: #60716a; font-size: 11px; font-weight: 800; }
.document-status { margin-left: auto; padding: 5px 8px; color: #a06f35; background: var(--peach); border-radius: 4px; font-size: 7px; font-weight: 900; letter-spacing: .12em; }
.document-title-block { margin-top: 45px; padding-bottom: 25px; border-bottom: 1px solid #e8e8e0; }
.document-label, .document-meta span, .doc-section-heading { color: #a0aaa1; font-size: 8px; letter-spacing: .13em; font-weight: 900; }
.document-title-block h2 { max-width: 80%; margin: 9px 0 8px; color: #1e2c26; font-size: clamp(21px, 2.1vw, 28px); letter-spacing: -.055em; }
.document-title-block p { color: #89938b; font-size: 9px; }
.document-meta { align-items: flex-start; gap: 20px; padding: 22px 0 27px; }
.document-meta > div { min-width: 0; flex: 1; }
.document-meta > div + div { text-align: right; }
.document-meta span, .document-meta strong, .document-meta small { display: block; }
.document-meta strong { margin-top: 7px; color: #405048; font-size: 10px; }
.document-meta small { margin-top: 4px; color: #9ba69e; font-size: 9px; }
.document-section { padding: 20px 0; border-top: 1px solid #e8e8e0; }
.doc-section-heading { margin-bottom: 13px; }
.document-tasks { display: grid; gap: 10px; }
.document-task { display: flex; align-items: center; gap: 9px; color: #59675f; font-size: 10px; }
.document-task-check { width: 15px; height: 15px; display: grid; place-items: center; border: 1px solid #d7ddd8; border-radius: 4px; color: white; font-size: 9px; }
.document-task.is-done .document-task-check { border-color: var(--green); background: var(--green); }
.document-task.is-done span:last-child { color: #99a69d; text-decoration: line-through; }
.document-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.document-photo { height: 115px; overflow: hidden; border-radius: 5px; background: #edf2ee; }
.document-photo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.document-photo figcaption { position: absolute; }
.empty-photo { grid-column: 1 / -1; padding: 25px 10px; color: #a8b1aa; background: #f7f9f6; border: 1px dashed #dde5df; border-radius: 5px; font-size: 10px; text-align: center; }
.note-section p { color: #78847c; font-size: 10px; line-height: 1.55; }
.document-footer { align-items: flex-end; padding-top: 30px; color: #9aa59e; }
.document-footer strong, .document-footer span { display: block; }
.document-footer strong { color: #617068; font-size: 9px; }
.document-footer span { margin-top: 4px; font-size: 8px; }
.footer-mark { color: var(--green); font-size: 9px; letter-spacing: 2px; }
.preview-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 14px; }
.full-button { width: 100%; }
.privacy-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 14px; color: #9ba69f; font-size: 9px; text-align: center; }
.privacy-note span { color: var(--gold); }

@media (max-width: 1120px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .preview-panel { max-width: 760px; }
}
@media (max-width: 760px) {
  .sidebar { display: none; }
  .topbar { height: 62px; padding: 0 18px; }
  .saved-state { display: none; }
  .page-wrap { padding: 30px 16px 45px; }
  .page-heading { display: block; margin-bottom: 28px; }
  .heading-actions { margin-top: 20px; }
  .heading-actions .button { flex: 1; }
  .panel-card { padding: 20px; }
  .two-col { grid-template-columns: 1fr; }
  .full-span { grid-column: auto; }
  .preview-document { padding: 24px; }
  .preview-actions { grid-template-columns: 1fr; }
}

@media print {
  body { background: white; }
  .sidebar, .topbar, .page-heading, .editor-panel, .preview-toolbar, .preview-actions, .privacy-note { display: none !important; }
  .app-shell, .main-content, .page-wrap, .workspace-grid, .preview-panel { display: block; width: 100%; max-width: none; padding: 0; margin: 0; }
  .preview-document { min-height: auto; padding: 30px; border: 0; border-radius: 0; box-shadow: none; }
}
