:root {
  --ink: #18312f;
  --muted: #657876;
  --paper: #f6f3ec;
  --panel: #fffdf8;
  --green: #2f6b5f;
  --green-2: #4f8f80;
  --mint: #dcebe5;
  --lime: #d7e36a;
  --orange: #e98b56;
  --line: #d9ded8;
  --shadow: 0 18px 55px rgba(31, 58, 53, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Be Vietnam Pro", sans-serif;
  font-size: 15px;
  line-height: 1.65;
}
button, textarea { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 290px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 28px 22px;
  background: #173b36; color: white; overflow-y: auto;
  display: flex; flex-direction: column; gap: 22px;
}
.brand { color: white; text-decoration: none; display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--lime); color: var(--ink); font-weight: 800; }
.brand strong, .brand small { display: block; line-height: 1.25; }
.brand small { color: #b9d0ca; font-size: 11px; margin-top: 3px; }
.program-card { padding: 18px; border: 1px solid rgba(255,255,255,.13); border-radius: 20px; background: rgba(255,255,255,.06); }
.pill { display: inline-flex; padding: 4px 9px; border-radius: 99px; background: var(--lime); color: var(--ink); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.program-card h2 { font-size: 17px; margin: 12px 0 4px; }
.program-card > p { color: #b9d0ca; font-size: 12px; margin: 0 0 18px; }
.progress-row { display: flex; align-items: center; gap: 13px; }
.progress-ring { --progress: 0deg; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--lime) var(--progress), rgba(255,255,255,.12) 0); position: relative; }
.progress-ring::after { content: ""; position: absolute; inset: 5px; background: #21443f; border-radius: 50%; }
.progress-ring span { position: relative; z-index: 1; font-size: 10px; font-weight: 700; }
.progress-row strong, .progress-row small { display: block; }
.progress-row strong { font-size: 13px; }
.progress-row small { font-size: 10px; color: #a9c1bb; }
.day-nav { display: flex; flex-direction: column; gap: 6px; }
.day-link { width: 100%; border: 0; background: transparent; color: #c6d8d4; padding: 10px 12px; border-radius: 12px; display: grid; grid-template-columns: 30px 1fr 18px; align-items: center; gap: 8px; text-align: left; cursor: pointer; transition: .2s ease; }
.day-link:hover { background: rgba(255,255,255,.07); }
.day-link.active { background: white; color: var(--ink); box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.day-number { width: 28px; height: 28px; border-radius: 9px; border: 1px solid currentColor; display: grid; place-items: center; font-size: 11px; font-weight: 700; opacity: .9; }
.day-link strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-link small { display: block; font-size: 9px; opacity: .7; }
.day-check { width: 17px; height: 17px; border-radius: 50%; border: 1px solid currentColor; display: grid; place-items: center; font-size: 9px; }
.day-link.done .day-check { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.sidebar-actions { margin-top: auto; display: grid; gap: 8px; }
.btn { border: 0; border-radius: 12px; padding: 11px 14px; cursor: pointer; font-weight: 650; }
.btn-accent { background: var(--lime); color: var(--ink); }
.btn-secondary { background: rgba(255,255,255,.12); color: white; }
.text-btn { border: 0; background: transparent; color: #9fb8b2; cursor: pointer; font-size: 11px; }
.admin-link, .logout-link { display: block; text-align: center; text-decoration: none; }
.logout-link { padding: 4px 10px; }
.data-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.data-actions .btn { padding-inline: 7px; font-size: 10px; }
.viewer-mode .owner-only { display: none !important; }
.editor-mode .viewer-only { display: none !important; }

.content { max-width: 1260px; width: 100%; margin: 0 auto; padding: 34px 48px 80px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.mode-badge { display: inline-flex; align-items: center; min-height: 32px; padding: 7px 12px; border: 1px solid #cbd8d3; border-radius: 999px; background: rgba(255,255,255,.62); color: var(--green); font-size: 10px; font-weight: 700; white-space: nowrap; }
.editor-mode .mode-badge { border-color: #c7d45f; background: var(--lime); color: var(--ink); }
.eyebrow { margin: 0 0 5px; font-size: 10px; font-weight: 700; letter-spacing: .18em; color: var(--green-2); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(25px, 3vw, 38px); letter-spacing: -.04em; }
h2 { letter-spacing: -.03em; }
.hero { min-height: 390px; overflow: hidden; position: relative; display: grid; grid-template-columns: 1.35fr 1fr; border-radius: 30px; background: var(--green); color: white; box-shadow: var(--shadow); }
.hero-copy { padding: 48px; position: relative; z-index: 2; }
.section-tag { display: inline-block; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--lime); margin-bottom: 15px; }
.hero h2 { font-family: "DM Serif Display", serif; font-weight: 400; font-size: clamp(36px, 5vw, 62px); line-height: 1.03; margin-bottom: 18px; max-width: 720px; }
.hero-copy > p { color: #d5e2df; max-width: 650px; }
.hero-metrics { display: flex; gap: 34px; margin-top: 30px; }
.hero-metrics div { display: grid; }
.hero-metrics strong { font-family: "DM Serif Display", serif; color: var(--lime); font-size: 25px; line-height: 1; }
.hero-metrics span { font-size: 10px; color: #c1d3ce; margin-top: 6px; }
.hero-visual { position: relative; min-height: 360px; }
.orbit { position: absolute; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; }
.orbit-one { width: 330px; height: 330px; right: -20px; top: 25px; }
.orbit-two { width: 230px; height: 230px; right: 30px; top: 74px; }
.visual-card { position: absolute; width: 150px; padding: 16px; border-radius: 18px; color: var(--ink); box-shadow: 0 20px 35px rgba(0,0,0,.18); transform: rotate(var(--r)); }
.visual-card span { display: block; font-family: "DM Serif Display", serif; font-size: 30px; }
.visual-card b { font-size: 11px; }
.card-a { --r: -7deg; background: var(--lime); top: 54px; right: 145px; }
.card-b { --r: 6deg; background: #fff9ee; top: 145px; right: 28px; }
.card-c { --r: -3deg; background: #e7a078; top: 240px; right: 158px; }

.safety-note { margin: 26px 0 50px; display: flex; gap: 15px; align-items: flex-start; padding: 20px 22px; background: #fff3e9; border: 1px solid #efd4c2; border-radius: 18px; }
.safety-icon { flex: 0 0 30px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--orange); color: white; font-weight: 800; }
.safety-note strong { display: block; font-size: 13px; margin-bottom: 3px; }
.safety-note p { margin: 0; font-size: 12px; color: #7d5b48; }

.day-detail { scroll-margin-top: 24px; }
.day-head { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: end; margin-bottom: 24px; }
.day-kicker { display: flex; align-items: center; gap: 12px; color: var(--orange); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.day-kicker::before { content: ""; width: 34px; height: 2px; background: currentColor; }
.day-head h2 { font-family: "DM Serif Display", serif; font-weight: 400; font-size: clamp(34px, 4vw, 52px); margin: 8px 0 10px; }
.day-head p { color: var(--muted); max-width: 760px; margin: 0; }
.complete-day { min-width: 155px; background: var(--ink); color: white; }
.complete-day.done { background: var(--lime); color: var(--ink); }
.objective-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.objective-chip { background: var(--mint); color: var(--green); padding: 7px 12px; border-radius: 99px; font-size: 10px; font-weight: 600; }
.task-board { background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 28px; box-shadow: 0 10px 35px rgba(26,51,47,.04); }
.task-board-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; padding-bottom: 20px; border-bottom: 1px solid #e5e9e4; }
.task-board-head span { display: block; margin-bottom: 5px; color: var(--orange); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.task-board-head h3 { margin: 0; font-family: "DM Serif Display", serif; font-size: 26px; font-weight: 400; letter-spacing: -.02em; }
.task-board-head > strong { flex: 0 0 auto; color: var(--green-2); font-size: 11px; }
.daily-task-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 34px; }
.daily-task { display: grid; grid-template-columns: 42px 1fr; gap: 13px; align-items: start; padding: 18px 0; border-bottom: 1px solid #e8ebe7; }
.task-index { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; background: var(--mint); color: var(--green); font-size: 10px; font-weight: 700; }
.daily-task h4 { margin: 0 0 5px; font-size: 13px; }
.daily-task p { margin: 0; color: var(--muted); font-size: 11px; }
.video-blueprint { margin-top: 20px; padding: 30px; border-radius: 26px; background: #213f3a; color: white; overflow: hidden; position: relative; }
.video-blueprint::after { content: ""; position: absolute; width: 240px; height: 240px; right: -130px; top: -130px; border: 1px solid rgba(215,227,106,.28); border-radius: 50%; }
.blueprint-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; margin-bottom: 24px; position: relative; z-index: 1; }
.blueprint-head span { display: block; margin-bottom: 6px; color: var(--lime); font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.blueprint-head h3 { margin: 0; font-family: "DM Serif Display", serif; font-size: 30px; font-weight: 400; }
.blueprint-head > p { margin: 0; color: #b8ceca; font-size: 10px; }
.blueprint-flow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; position: relative; z-index: 1; }
.blueprint-step { display: grid; grid-template-columns: 44px 1fr; gap: 13px; padding: 18px; border-radius: 18px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); }
.step-no { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--lime); color: var(--ink); font-size: 11px; font-weight: 800; }
.step-title h4 { margin: 0; font-size: 14px; }
.step-title span { display: block; margin: 2px 0 10px; color: #a9c6c0; font-size: 9px; }
.step-body p { margin: 6px 0 0; color: #d6e2df; font-size: 10px; }
.step-body p strong { color: white; }
.video-checklist { margin-top: 14px; padding: 20px; border-radius: 18px; background: var(--lime); color: var(--ink); position: relative; z-index: 1; }
.video-checklist h4 { margin: 0 0 12px; font-size: 13px; }
.video-checklist div { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px 18px; }
.video-checklist span { font-size: 10px; font-weight: 600; }
.day-bottom { display: grid; grid-template-columns: 1fr .9fr; gap: 18px; margin-top: 18px; }
.deliverables, .notes-card { border-radius: 22px; padding: 24px; }
.deliverables { background: var(--ink); color: white; }
.deliverables h3, .notes-card h3 { font-size: 15px; margin-bottom: 16px; }
.check-list { display: grid; gap: 10px; }
.check-item { display: flex; gap: 10px; align-items: flex-start; font-size: 11px; color: #d5e1df; cursor: pointer; }
.check-item input { accent-color: var(--lime); margin-top: 3px; }
.notes-card { background: #e7efe9; }
.notes-card p { font-size: 10px; color: var(--muted); }
.notes-card textarea { width: 100%; min-height: 142px; resize: vertical; border: 1px solid #c5d5ce; border-radius: 14px; padding: 13px; background: rgba(255,255,255,.65); outline: none; color: var(--ink); }
.notes-card textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(79,143,128,.12); }
.save-note { margin-top: 10px; background: var(--green); color: white; }

.editor-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(12,31,28,.66); backdrop-filter: blur(5px); padding: 18px; }
.editor-backdrop[hidden] { display: none; }
.editor-panel { width: min(880px, 100%); height: calc(100vh - 36px); margin-left: auto; background: #f8f6ef; border-radius: 24px; box-shadow: -20px 0 70px rgba(8,31,27,.25); display: grid; grid-template-rows: auto auto 1fr auto; overflow: hidden; }
.editor-header { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; padding: 24px 28px 17px; border-bottom: 1px solid var(--line); }
.editor-header p { margin: 0 0 4px; color: var(--orange); font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.editor-header h2 { margin: 0; font-family: "DM Serif Display", serif; font-size: 29px; font-weight: 400; }
.icon-btn { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--ink); color: white; cursor: pointer; font-size: 24px; line-height: 1; }
.editor-tools { display: flex; justify-content: space-between; gap: 10px; padding: 12px 28px; background: #eef1ea; border-bottom: 1px solid var(--line); }
.small-btn { border: 1px solid #cbd5cf; border-radius: 9px; background: white; padding: 7px 10px; color: var(--green); font-size: 10px; font-weight: 700; cursor: pointer; }
.small-btn:hover { border-color: var(--green-2); }
.small-btn.danger { color: #a34b3e; }
.editor-scroll { overflow-y: auto; padding: 24px 28px 34px; }
.editor-fields { display: grid; gap: 14px; margin-bottom: 14px; }
.editor-fields.two-col { grid-template-columns: 1fr 1fr; }
.editor-fields label, .toggle-field { display: grid; gap: 6px; }
.editor-fields label > span:first-child { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.editor-fields input[type="text"], .editor-fields textarea, .edit-row input, .edit-row textarea { width: 100%; border: 1px solid #cad3ce; border-radius: 11px; background: white; padding: 10px 12px; color: var(--ink); outline: none; }
.editor-fields input:focus, .editor-fields textarea:focus, .edit-row input:focus, .edit-row textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(79,143,128,.12); }
.toggle-field > span:last-child { min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid #cad3ce; border-radius: 11px; background: white; font-size: 11px; }
.toggle-field input { accent-color: var(--green); }
.edit-section { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.edit-section-head { display: flex; justify-content: space-between; gap: 15px; align-items: flex-start; margin-bottom: 12px; }
.edit-section-head span { display: block; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.edit-section-head p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.editor-list { display: grid; gap: 10px; }
.edit-row { display: grid; grid-template-columns: 30px 1fr 32px; gap: 9px; align-items: start; padding: 12px; border: 1px solid #d9dfda; border-radius: 14px; background: rgba(255,255,255,.54); }
.edit-row.multi { grid-template-columns: 30px 1fr 32px; }
.edit-row-number { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--mint); color: var(--green); font-size: 9px; font-weight: 700; }
.edit-row-fields { display: grid; gap: 8px; }
.edit-row-fields.two { grid-template-columns: 1fr 1fr; }
.edit-row textarea { min-height: 58px; resize: vertical; font-size: 11px; }
.edit-row input { font-size: 11px; }
.remove-row { width: 30px; height: 30px; border: 0; border-radius: 9px; background: #f3dfd8; color: #9c4e42; cursor: pointer; font-size: 15px; }
.editor-list.compact .edit-row { align-items: center; }
.editor-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 28px; border-top: 1px solid var(--line); background: white; }
.editor-footer > span { color: var(--muted); font-size: 9px; }
.editor-footer > div { display: flex; gap: 8px; }
.editor-cancel { background: #edf0ec; }
.editor-save { background: var(--green); color: white; min-width: 140px; }
body.editor-open { overflow: hidden; }

.toast { position: fixed; right: 24px; bottom: 24px; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: white; font-size: 11px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s ease; z-index: 20; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; padding: 18px; }
  .program-card { display: none; }
  .day-nav { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .day-link { min-width: 155px; }
  .sidebar-actions { margin-top: 0; grid-template-columns: 1fr 1fr; }
  .sidebar-actions .data-actions { grid-column: 1 / -1; }
  .sidebar-actions .text-btn { display: none; }
  .content { padding: 28px 22px 60px; }
  .hero { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .hero-copy { padding: 34px; }
}
@media (max-width: 700px) {
  .topbar, .day-head { grid-template-columns: 1fr; display: grid; }
  .hero-metrics { gap: 20px; }
  .daily-task-list, .day-bottom, .blueprint-flow, .video-checklist div { grid-template-columns: 1fr; }
  .task-board { padding: 22px; }
  .task-board-head { align-items: flex-start; }
  .result-scale { grid-template-columns: 1fr; }
  .complete-day { width: 100%; }
  .editor-backdrop { padding: 0; }
  .editor-panel { height: 100vh; border-radius: 0; }
  .editor-fields.two-col, .edit-row-fields.two { grid-template-columns: 1fr; }
  .editor-header, .editor-tools, .editor-scroll, .editor-footer { padding-left: 18px; padding-right: 18px; }
  .editor-footer { align-items: stretch; flex-direction: column; }
  .editor-footer > div { display: grid; grid-template-columns: 1fr 1fr; }
}
@media print {
  body { background: white; }
  .sidebar, .topbar, .hero-visual, .sidebar-actions, .complete-day, .notes-card, .toast { display: none !important; }
  .app-shell { display: block; }
  .content { max-width: none; padding: 0; }
  .hero { min-height: 0; display: block; box-shadow: none; print-color-adjust: exact; }
  .day-detail { break-before: page; }
  .daily-task, .blueprint-step, .deliverables { break-inside: avoid; }
}
