:root {
  --bg: #f7f3ea;
  --panel: #fffdf8;
  --ink: #1f1b16;
  --muted: #756b5d;
  --line: #eadfcd;
  --gold: #b27a2b;
  --green: #2f7d5b;
  --blue: #3f6f9f;
  --red: #a84f3f;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(247,243,234,.94), rgba(247,243,234,1)),
    url("assets/default-course-cover-JYQ-6GtO.jpg") center top / cover fixed;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

.site-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(234,223,205,.82);
  background: rgba(255,253,248,.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: #1f1b16;
}

.nav-main,
.nav-actions,
.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.nav-main {
  flex: 1;
}

.nav-main a,
.nav-actions a,
.nav-links a {
  padding: 8px 10px;
  border-radius: 8px;
}

.nav-main a:hover,
.nav-actions a:hover,
.nav-links a:hover {
  color: var(--ink);
  background: #f1e8d8;
}

.nav-actions a {
  border: 1px solid transparent;
  font-weight: 800;
}

.nav-actions a.primary {
  color: #fff;
  border-color: #1f1b16;
  background: #1f1b16;
}

.nav-actions a.primary:hover {
  color: #fff;
  background: #1f1b16;
}

.shell {
  width: min(1180px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 28px;
  align-items: stretch;
  margin-bottom: 34px;
}

.hero-main, .hero-side, .section, .card {
  border: 1px solid var(--line);
  background: rgba(255,253,248,.94);
  box-shadow: 0 18px 45px rgba(84,63,32,.08);
}

.hero-main {
  min-height: 310px;
  padding: 42px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border: 1px solid #e5d3b4;
  border-radius: 8px;
  color: #8a6123;
  background: #fff5df;
  font-size: 13px;
  font-weight: 700;
}

h1 {
  max-width: 780px;
  margin: 18px 0 14px;
  font-size: 48px;
  line-height: 1.08;
  letter-spacing: 0;
}

.lead {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-actions a, .card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fffaf0;
  font-weight: 800;
}

.hero-actions a.primary, .card-action.primary {
  color: #fff;
  border-color: #1f1b16;
  background: #1f1b16;
}

.hero-side {
  padding: 26px;
  border-radius: 8px;
}

.metric-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.metric {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.metric:last-child { border-bottom: 0; }
.metric span { color: var(--muted); }
.metric strong { white-space: nowrap; }

.section {
  margin-top: 24px;
  padding: 28px;
  border-radius: 8px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.section-head h2 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: 0;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.search-box {
  width: min(320px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  outline: none;
  background: #fff;
}

body.essence-mode {
  background: #f7f3ea;
}

.essence-shell {
  width: min(1080px, calc(100vw - 40px));
  padding-top: 34px;
}

.essence-head {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: flex-end;
  padding: 20px 0 24px;
  border-bottom: 1px solid var(--line);
}

.essence-head h1 {
  margin: 16px 0 8px;
  font-size: 42px;
}

.essence-head p,
.essence-head-side span {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.essence-head-side {
  width: min(260px, 100%);
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,253,248,.86);
}

.essence-head-side strong {
  font-size: 16px;
}

.essence-feed-section {
  padding: 24px 0 0;
}

.essence-feed-bar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.feed-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feed-tabs button {
  min-height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: default;
  font-weight: 800;
}

.feed-tabs button.active {
  color: #287460;
  background: #e7f3ef;
}

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

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

.course-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,253,248,.94);
  box-shadow: 0 18px 45px rgba(84,63,32,.08);
  display: flex;
  flex-direction: column;
  min-height: 340px;
}

.course-cover {
  display: block;
  aspect-ratio: 16 / 9;
  background: #efe4d1;
  overflow: hidden;
}

.course-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .18s ease;
}

.course-card:hover .course-cover img { transform: scale(1.03); }

.course-body {
  flex: 1;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.card {
  min-height: 230px;
  padding: 20px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.tag {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 8px;
  color: #7c561d;
  background: #fff3da;
  font-size: 12px;
  font-weight: 800;
}

.tag.green { color: var(--green); background: #eaf7f0; }
.tag.blue { color: var(--blue); background: #eaf2fb; }
.tag.red { color: var(--red); background: #fff0ec; }

.card h3, .course-card h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
  letter-spacing: 0;
}

.card p, .course-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #8a6123;
  font-size: 13px;
  font-weight: 700;
}

.card-action {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.published-card {
  min-height: 300px;
}

.feed-list {
  display: grid;
  gap: 14px;
}

.feed-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,253,248,.94);
  box-shadow: 0 12px 32px rgba(84,63,32,.07);
  padding: 22px;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease;
}

.feed-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(84,63,32,.1);
}

.feed-card:not(:has(.feed-cover)) {
  grid-template-columns: 1fr;
}

.feed-main {
  min-width: 0;
}

.feed-author {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: #657797;
  font-size: 13px;
}

.feed-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #8a6123;
  background: #f2e7d0;
  font-size: 12px;
  font-weight: 900;
}

.feed-author strong {
  color: #526b91;
}

.feed-author em {
  color: var(--muted);
  font-style: normal;
}

.feed-author b {
  padding: 3px 8px;
  border-radius: 999px;
  color: #8a6123;
  background: #fff3da;
  font-size: 12px;
}

.feed-card h3 {
  margin: 14px 0 9px;
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: 0;
}

.feed-card p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.feed-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 14px;
  color: #8d8579;
  font-size: 13px;
}

.feed-readmore {
  display: inline-flex;
  width: fit-content;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: #8a6123;
  background: #fffaf0;
  font-size: 13px;
  font-weight: 900;
}

.feed-cover {
  width: 220px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  background: #efe4d1;
}

.locked-note {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid #e5d3b4;
  border-radius: 8px;
  background: #fff8ea;
}

.locked-note strong {
  color: #8a6123;
}

.locked-note span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.published-card details,
.feed-card details {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 10px;
}

.published-card summary,
.feed-card summary {
  color: #8a6123;
  cursor: pointer;
  font-weight: 900;
}

.post-tags,
.post-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-tags span,
.post-link,
.post-links a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  background: #fffaf0;
  color: #8a6123;
  font-size: 12px;
  font-weight: 800;
}

.post-body {
  margin: 12px 0;
  color: #4c4438;
  font-size: 14px;
  line-height: 1.75;
  max-height: 360px;
  overflow: auto;
}

.post-detail-shell {
  width: min(1080px, calc(100% - 40px));
}

.post-detail {
  margin: 30px 0 70px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,253,248,.96);
  box-shadow: 0 18px 48px rgba(84,63,32,.08);
  padding: clamp(22px, 4vw, 46px);
}

.post-back {
  display: inline-flex;
  margin-bottom: 22px;
  color: #8a6123;
  font-weight: 900;
}

.post-detail h1 {
  max-width: 900px;
  margin: 10px 0 16px;
  font-size: 38px;
  line-height: 1.22;
  letter-spacing: 0;
}

.post-hero-image {
  display: block;
  width: min(520px, 100%);
  max-height: 360px;
  object-fit: cover;
  border-radius: 8px;
  margin: 28px 0;
  background: #efe4d1;
}

.post-detail-body {
  display: grid;
  gap: 12px;
  margin-top: 28px;
  color: #3f382f;
  font-size: 17px;
  line-height: 1.85;
}

.post-detail-body p,
.post-detail-body h2,
.post-detail-body blockquote,
.post-detail-body ul {
  margin: 0;
}

.post-detail-body h2 {
  padding-top: 14px;
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: 0;
}

.post-detail-body ul {
  padding-left: 22px;
}

.post-detail-body blockquote {
  border-left: 4px solid #d4b987;
  padding: 10px 14px;
  color: #6a5740;
  background: #fff8ea;
}

.post-detail-body a {
  color: #8a6123;
  font-weight: 800;
}

.post-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.post-image-grid img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
}

.detail-links {
  margin-top: 22px;
}

.detail-lock {
  margin-top: 24px;
}

.detail-summary {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 160px;
  gap: 18px;
  align-items: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
}

.timeline-row strong { font-size: 17px; }
.timeline-row p { margin: 6px 0 0; color: var(--muted); line-height: 1.65; }
.timeline-row em { color: var(--gold); font-style: normal; font-weight: 800; text-align: right; }

.empty {
  padding: 38px;
  border: 1px dashed #dcc8a8;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: #fffaf0;
}

.footer-note {
  margin-top: 24px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.account-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.account-summary div,
.account-platform,
.account-panel,
.account-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,253,248,.94);
  box-shadow: 0 12px 28px rgba(84,63,32,.06);
}

.account-summary div {
  padding: 18px;
}

.account-summary span,
.account-platform span,
.account-meta-line,
.account-history-row,
.account-panel p {
  color: var(--muted);
}

.account-summary strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  letter-spacing: 0;
}

.account-platform-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.account-platform {
  padding: 18px;
}

.account-platform-title {
  display: grid;
  gap: 5px;
}

.account-platform-title strong {
  font-size: 18px;
}

.account-platform-title span {
  font-size: 12px;
}

.account-platform-number {
  margin: 18px 0 6px;
  color: var(--gold);
  font-size: 34px;
  font-weight: 900;
}

.account-platform p {
  margin: 0;
  line-height: 1.6;
}

.account-panel {
  margin-top: 18px;
  padding: 22px;
}

.account-panel-head {
  margin-bottom: 14px;
}

.account-panel h3,
.account-item h3 {
  margin: 0;
  letter-spacing: 0;
}

.account-panel p {
  margin: 6px 0 0;
}

.account-form,
.account-metric-form {
  display: grid;
  gap: 10px;
}

.account-form {
  grid-template-columns: 160px repeat(2, minmax(0, 1fr));
}

.account-form textarea {
  grid-column: 1 / -2;
  min-height: 76px;
  resize: vertical;
}

.account-form input,
.account-form select,
.account-form textarea,
.account-metric-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  outline: none;
  color: var(--ink);
  background: #fff;
}

.account-form input:focus,
.account-form select:focus,
.account-form textarea:focus,
.account-metric-form input:focus {
  border-color: #d1a866;
  box-shadow: 0 0 0 3px rgba(178,122,43,.12);
}

.account-form button,
.account-metric-form button {
  min-height: 44px;
  border: 1px solid #1f1b16;
  border-radius: 8px;
  color: #fff;
  background: #1f1b16;
  font-weight: 900;
}

.account-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.account-item {
  padding: 20px;
}

.account-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.account-item-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.account-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 14px 0;
  font-size: 13px;
}

.account-metrics-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.account-metrics-row span {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
}

.account-metrics-row strong {
  display: block;
  font-size: 22px;
}

.account-metrics-row em {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.account-details {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.account-details summary {
  cursor: pointer;
  color: #8a6123;
  font-weight: 900;
}

.account-metric-form {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 14px;
}

.account-metric-form input[name="evidence_url"] {
  grid-column: span 2;
}

.account-history {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.account-history-row {
  display: grid;
  grid-template-columns: 100px repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fffaf0;
  font-size: 13px;
}

.account-empty {
  padding: 22px;
  border: 1px dashed #dcc8a8;
  border-radius: 8px;
  color: var(--muted);
  background: #fffaf0;
}

@media (max-width: 920px) {
  .site-nav { height: auto; padding: 14px 18px; align-items: flex-start; flex-direction: column; }
  .nav-main, .nav-actions, .nav-links { justify-content: flex-start; }
  .shell { width: min(100% - 28px, 720px); padding-top: 28px; }
  .essence-shell { width: min(100% - 28px, 720px); }
  .essence-head,
  .essence-feed-bar {
    align-items: stretch;
    flex-direction: column;
  }
  .essence-head h1 { font-size: 36px; }
  .essence-head-side { width: 100%; }
  .hero { grid-template-columns: 1fr; }
  h1 { font-size: 36px; }
  .hero-main { min-height: 0; padding: 28px; }
  .section-head { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .grid, .grid.two { grid-template-columns: 1fr; }
  .feed-card,
  .feed-card:not(:has(.feed-cover)) {
    grid-template-columns: 1fr;
  }
  .feed-cover {
    width: 100%;
  }
  .account-summary,
  .account-platform-grid,
  .account-metrics-row,
  .account-metric-form,
  .account-history-row {
    grid-template-columns: 1fr;
  }
  .account-form { grid-template-columns: 1fr; }
  .account-form textarea,
  .account-metric-form input[name="evidence_url"] {
    grid-column: auto;
  }
  .account-item-head {
    flex-direction: column;
  }
  .timeline-row { grid-template-columns: 1fr; }
  .timeline-row em { text-align: left; }
}
