:root {
  --ink: #27211c;
  --text: #463e36;
  --muted: #766d63;
  --paper: #f4f7f5;
  --panel: #ffffff;
  --line: rgba(43, 36, 27, 0.14);
  --accent: #187869;
  --accent-dark: #0f5a4e;
  --shadow: 0 16px 54px rgba(37, 30, 20, 0.12);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
}

a {
  color: inherit;
}

.published-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 14px clamp(16px, 4vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(244, 247, 245, 0.9);
  backdrop-filter: blur(16px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.published-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 850;
  text-decoration: none;
}

.published-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  box-shadow: 0 8px 24px rgba(6, 16, 14, 0.16);
}

.published-header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.published-share {
  position: relative;
  display: inline-flex;
}

.published-share-button,
.published-share-menu button,
.published-share-menu a {
  font: inherit;
}

.published-share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.published-share-button:hover,
.published-share-button[aria-expanded="true"] {
  border-color: rgba(15, 90, 78, 0.34);
  background: #eef8f6;
}

.published-share-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  display: grid;
  min-width: 168px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 16px 46px rgba(37, 30, 20, 0.16);
}

.published-share-menu[hidden] {
  display: none;
}

.published-share-menu a,
.published-share-menu button {
  display: flex;
  align-items: center;
  min-height: 38px;
  width: 100%;
  padding: 0 13px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.published-share-menu a:last-child,
.published-share-menu button:last-child {
  border-bottom: 0;
}

.published-share-menu a:hover,
.published-share-menu button:hover {
  background: #f3faf8;
  color: var(--accent-dark);
}

.published-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--accent-dark);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.published-story {
  width: min(940px, calc(100% - 28px));
  margin: 24px auto 70px;
}

.published-hero {
  position: relative;
  display: grid;
  min-height: 390px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #2d261f;
  box-shadow: var(--shadow);
}

.published-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.62;
}

.published-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(30, 24, 18, 0.88), rgba(30, 24, 18, 0.46) 58%, rgba(30, 24, 18, 0.15));
}

.published-hero-copy {
  position: relative;
  z-index: 1;
  align-self: end;
  max-width: 680px;
  padding: clamp(24px, 5vw, 52px);
  color: #ffffff;
}

.published-hero-copy p,
.published-hero-copy span {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.published-hero-copy h1 {
  margin: 10px 0 14px;
  font-size: 72px;
  line-height: 0.98;
  letter-spacing: 0;
}

.published-chapter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.published-chapter-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.published-chapter {
  margin-top: 22px;
  padding: clamp(18px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 10px 36px rgba(37, 30, 20, 0.08);
}

.published-chapter h2 {
  margin: 0 0 24px;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: 0;
}

.published-story-content {
  color: var(--text);
  font-size: 20px;
  line-height: 1.76;
}

.published-story-content::after {
  content: "";
  display: block;
  clear: both;
}

.published-story-content p,
.published-story-content blockquote,
.published-story-content ul,
.published-story-content ol {
  margin: 0 0 1.2em;
}

.published-story-content blockquote {
  padding-left: 18px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.story-dialog-turn {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
  max-width: 820px;
  margin: 18px 0;
}

.story-dialog-avatar {
  width: 58px;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  object-fit: cover;
  background: #efe7dc;
}

.story-dialog-body {
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f4ed;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.58;
}

.story-dialog-name {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-dark);
  font-size: 13px;
  letter-spacing: 0;
}

.story-dialog-body p:last-child {
  margin-bottom: 0;
}

.story-float-image {
  display: block;
  width: min(34vw, 180px);
  max-width: min(100%, 420px);
  height: auto;
  margin: 8px auto 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4ede3;
  box-shadow: 0 12px 36px rgba(37, 30, 20, 0.12);
}

.story-float-image.is-left {
  float: left;
  margin: 7px 22px 14px 0;
}

.story-float-image.is-right {
  float: right;
  margin: 7px 0 14px 22px;
}

.story-float-image.is-center {
  clear: both;
  margin: 22px auto;
}

@media (max-width: 680px) {
  .published-header {
    align-items: flex-start;
    gap: 10px;
  }

  .published-brand {
    min-height: 38px;
  }

  .published-header-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .published-share-menu {
    right: auto;
    left: 0;
  }

  .published-story {
    width: calc(100% - 20px);
    margin-top: 10px;
  }

  .published-hero {
    min-height: 320px;
  }

  .published-hero-copy h1 {
    font-size: 44px;
  }

  .published-chapter h2 {
    font-size: 28px;
  }

  .published-story-content {
    font-size: 18px;
  }

  .published-chapter {
    padding: 16px;
  }

  .story-dialog-turn {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 9px;
  }

  .story-dialog-avatar {
    width: 46px;
  }

  .story-float-image.is-left,
  .story-float-image.is-right {
    float: none;
    width: min(100%, 360px);
    margin: 18px auto;
  }
}
