:root {
  --ink: #17332f;
  --muted: #70807c;
  --paper: #f3f7f6;
  --card: #ffffff;
  --line: #dce7e4;
  --mint: #dff0eb;
  --teal: #176f63;
  --teal-dark: #10564e;
  --gold: #c88c28;
  --rose: #b55358;
  --blue: #426f96;
  --shadow: 0 16px 44px rgba(25, 65, 58, .10);
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 100% 0, rgba(128, 190, 173, .18), transparent 30rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }

.app-shell { width: min(100%, 960px); margin: 0 auto; padding: 0 18px 88px; }
.topbar { min-height: 84px; display: flex; align-items: center; justify-content: space-between; padding-top: env(safe-area-inset-top); }
.eyebrow, .section-label, .hero-kicker { margin: 0; color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.topbar h1 { margin: 3px 0 0; font-size: 25px; letter-spacing: -.04em; }
.avatar { width: 43px; height: 43px; border: 0; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; box-shadow: 0 8px 20px rgba(23, 51, 47, .18); }

.hero { position: relative; overflow: hidden; display: flex; justify-content: space-between; min-height: 178px; padding: 24px; border-radius: 28px; color: #fff; background: linear-gradient(135deg, #17332f, #1b7166); box-shadow: var(--shadow); }
.hero h2 { max-width: 430px; margin: 9px 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(29px, 6vw, 43px); font-weight: 500; line-height: .98; letter-spacing: -.035em; }
.hero p:last-child { max-width: 520px; margin: 0; color: rgba(255,255,255,.72); font-size: 14px; line-height: 1.5; }
.hero-kicker { color: #a6d9cc; }
.hero-mark { position: absolute; right: -18px; bottom: -50px; width: 180px; height: 180px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; }
.hero-mark span { position: absolute; display: block; background: rgba(255,255,255,.15); border-radius: 999px; transform: rotate(-35deg); }
.hero-mark span:first-child { width: 22px; height: 125px; left: 60px; top: 22px; }
.hero-mark span:last-child { width: 22px; height: 92px; left: 96px; top: 50px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 22px; }
.stat { padding: 15px 13px; border: 1px solid rgba(220,231,228,.8); border-radius: 18px; background: rgba(255,255,255,.78); backdrop-filter: blur(12px); }
.stat strong { display: block; margin-bottom: 3px; font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
.stat span { color: var(--muted); font-size: 11px; line-height: 1.2; }

.tabs { display: flex; gap: 5px; padding: 4px; border-radius: 16px; background: #e4eeeb; }
.tab { flex: 1; padding: 11px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 700; cursor: pointer; }
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 4px 12px rgba(30,75,67,.08); }
.view { display: none; }
.view.active { display: block; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin: 27px 2px 13px; }
.section-head.compact { margin-top: 24px; }
.section-head h3, .drawer-head h3 { margin: 4px 0 0; font-size: 21px; letter-spacing: -.03em; }
.month-nav { display: flex; gap: 7px; }
.month-nav button, .close-button { display: grid; place-items: center; width: 37px; height: 37px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }

.calendar-card { padding: 13px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); box-shadow: 0 9px 28px rgba(28,70,62,.05); }
.weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.weekdays { padding-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 700; text-align: center; text-transform: uppercase; }
.calendar-day { position: relative; min-height: 64px; padding: 7px 5px; border: 1px solid transparent; border-radius: 12px; background: #f8faf9; font-size: 12px; }
.calendar-day.empty { background: transparent; }
.calendar-day.today { border-color: #8abbb0; }
.calendar-day.has-posts { cursor: pointer; }
.calendar-day .day-number { font-weight: 700; }
.calendar-day .day-count { display: grid; place-items: center; width: 21px; height: 21px; margin-top: 6px; border-radius: 50%; background: var(--teal); color: #fff; font-size: 10px; font-weight: 800; }

.count-badge { display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 9px; border-radius: 20px; background: var(--mint); color: var(--teal-dark); font-size: 12px; font-weight: 800; }
.post-list { display: grid; gap: 10px; }
.post-card { display: grid; grid-template-columns: 72px minmax(0,1fr) 24px; gap: 13px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 19px; background: #fff; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.post-card:hover { transform: translateY(-1px); box-shadow: 0 9px 24px rgba(26,67,59,.08); }
.post-card img { width: 72px; height: 72px; object-fit: cover; border-radius: 13px; background: #edf2f0; }
.post-meta { min-width: 0; }
.post-meta h4 { overflow: hidden; margin: 5px 0 6px; font-size: 14px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.post-meta p { margin: 0; color: var(--muted); font-size: 11px; }
.post-arrow { color: #9aaba7; font-size: 20px; }
.status { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.status::before { width: 7px; height: 7px; border-radius: 50%; background: currentColor; content: ""; }
.status-draft { color: #82908d; }.status-review { color: var(--gold); }.status-changes,.status-failed { color: var(--rose); }.status-approved { color: var(--teal); }.status-scheduled { color: var(--blue); }.status-published { color: #6b5b97; }
.empty-state { padding: 30px 18px; border: 1px dashed #c9d8d4; border-radius: 20px; color: var(--muted); text-align: center; }

.search-wrap { margin: 22px 0 12px; }
.search-wrap input { width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 15px; outline: none; background: #fff; color: var(--ink); }
.search-wrap input:focus { border-color: #83b5aa; box-shadow: 0 0 0 3px rgba(23,111,99,.08); }
.filters { display: flex; gap: 7px; overflow-x: auto; margin: 0 -18px 14px; padding: 0 18px 3px; scrollbar-width: none; }
.filter { flex: 0 0 auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.filter.active { border-color: var(--teal); background: var(--teal); color: #fff; }

.drawer-backdrop { position: fixed; z-index: 20; inset: 0; background: rgba(11,32,29,.45); backdrop-filter: blur(3px); }
.drawer { position: fixed; z-index: 21; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; max-height: 94dvh; border-radius: 27px 27px 0 0; background: var(--paper); box-shadow: 0 -20px 60px rgba(11,32,29,.2); transform: translateY(105%); transition: transform .26s ease; }
.drawer.open { transform: translateY(0); }
.drawer-handle { width: 38px; height: 4px; margin: 9px auto 1px; border-radius: 4px; background: #becbc8; }
.drawer-head { display: flex; justify-content: space-between; gap: 18px; padding: 15px 19px 13px; }
.drawer-head h3 { max-width: 650px; font-size: 19px; }
.drawer-body { overflow-y: auto; padding: 0 19px 25px; }
.drawer-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 9px; padding: 12px 19px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }
.drawer-actions button { min-height: 48px; border-radius: 14px; font-weight: 800; cursor: pointer; }
.primary { border: 0; background: var(--teal); color: #fff; }.secondary { border: 1px solid var(--line); background: #fff; }
.image-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.image-option { position: relative; overflow: hidden; padding: 0; border: 2px solid transparent; border-radius: 15px; background: #fff; cursor: pointer; }
.image-option.selected { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(23,111,99,.12); }
.image-option img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.image-option span { position: absolute; right: 5px; bottom: 5px; left: 5px; padding: 5px; border-radius: 8px; background: rgba(16,40,36,.72); color: #fff; font-size: 9px; font-weight: 700; text-align: center; backdrop-filter: blur(5px); }
.field { display: grid; gap: 7px; margin: 13px 0; }
.field > span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.field select, .field input, .field textarea { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; outline: none; background: #fff; color: var(--ink); resize: vertical; }
.post-copy { margin-top: 20px; padding: 18px; border-radius: 18px; background: #fff; color: #344d48; font-size: 14px; line-height: 1.58; white-space: pre-wrap; }
.toast { position: fixed; z-index: 30; right: 20px; bottom: 20px; left: 20px; max-width: 420px; margin: auto; padding: 13px 16px; border-radius: 13px; background: var(--ink); color: #fff; font-size: 13px; text-align: center; opacity: 0; pointer-events: none; transform: translateY(12px); transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (min-width: 720px) {
  .app-shell { padding-right: 28px; padding-left: 28px; }
  .stats { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .post-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drawer { top: 0; right: 0; bottom: 0; left: auto; width: min(560px, 95vw); max-height: none; border-radius: 25px 0 0 25px; transform: translateX(105%); }
  .drawer.open { transform: translateX(0); }
  .drawer-handle { display: none; }
  .drawer-head { padding-top: 25px; }
  .calendar-day { min-height: 82px; }
}

@media (max-width: 420px) {
  .hero { padding: 21px; }
  .stats { gap: 7px; }
  .stat { padding: 13px 10px; }
  .calendar-card { padding: 8px; }
  .calendar-day { min-height: 55px; padding: 6px 4px; }
}
