:root {
  color-scheme: light;
  --brand: #e63138;
  --brand-strong: #bd171f;
  --violet: #8b2cff;
  --cyan: #12bde3;
  --amber: #ffb33d;
  --rose: #ff5d7d;
  --ink: #101114;
  --ink-2: #2a2d34;
  --muted: #687083;
  --muted-2: #9aa2b4;
  --bg: #f7f4ef;
  --surface: #ffffff;
  --surface-soft: #fff9f1;
  --line: #e8e4dc;
  --line-strong: #d8d2c6;
  --success: #0f766e;
  --warning: #b45309;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 17, 20, 0.06);
  --shadow-md: 0 18px 44px rgba(24, 23, 21, 0.10);
  --shadow-lg: 0 28px 80px rgba(61, 43, 24, 0.15);
  --ease-enter: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-move: cubic-bezier(0.25, 1, 0.5, 1);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  background:
    linear-gradient(110deg, #fffaf0 0%, #fff6f9 38%, #f7f8ff 72%, #f7f4ef 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0;
}

body.viewer-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto minmax(260px, 1fr);
  gap: 20px;
  align-items: center;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid rgba(232, 228, 220, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: var(--radius);
  background: var(--brand);
  color: #ffffff;
  font-size: 14px;
  font-weight: 850;
  box-shadow: 0 10px 24px rgba(230, 49, 56, 0.24);
}

h1 {
  font-size: 18px;
  line-height: 1.22;
  font-weight: 820;
}

.brand p,
.eyebrow,
.panel-head p,
.library-title p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.brand p {
  margin-top: 2px;
}

.nav-tabs {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.nav-tabs button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 16px;
  font-weight: 760;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    transform 160ms var(--ease-enter);
}

.nav-tabs button.is-active {
  color: #ffffff;
  background: var(--ink);
}

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

.status-pill {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 999px;
  background: rgba(240, 253, 250, 0.92);
  color: var(--success);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.product-app {
  max-width: 1540px;
  margin: 0 auto;
  padding: 28px;
}

.hero {
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(420px, 1.05fr);
  gap: 32px;
  align-items: center;
  padding: 34px 0 42px;
}

.product-app[data-active-view="create"] .hero {
  display: none;
}

.hero-copy {
  display: grid;
  gap: 22px;
}

.eyebrow {
  color: var(--brand);
  text-transform: uppercase;
}

h2 {
  max-width: 720px;
  font-size: 52px;
  line-height: 1.12;
  font-weight: 880;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 620px;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1.72;
  font-weight: 580;
}

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

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 680px;
}

.feature-grid article {
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 4px;
  border-radius: var(--radius);
  color: #ffffff;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.feature-grid article:nth-child(1) {
  background: linear-gradient(135deg, #ffb84d, #ff8a3d);
}

.feature-grid article:nth-child(2) {
  background: linear-gradient(135deg, #20c4e8, #1d8cff);
}

.feature-grid article:nth-child(3) {
  background: linear-gradient(135deg, #ff6587, #f04462);
}

.feature-grid article:nth-child(4) {
  background: linear-gradient(135deg, #8f8cff, #6f67f7);
}

.feature-grid strong {
  font-size: 18px;
  line-height: 1.25;
}

.feature-grid span {
  color: rgba(255, 255, 255, 0.84);
  font-size: 13px;
  font-weight: 650;
}

.hero-showcase {
  position: relative;
  isolation: isolate;
  min-height: 470px;
  display: grid;
  place-items: center;
}

.poster-carousel {
  position: relative;
  z-index: 2;
  width: min(500px, 94%);
  display: grid;
  gap: 14px;
  border: 3px solid rgba(139, 44, 255, 0.92);
  border-radius: 18px;
  background: #ffffff;
  box-shadow:
    0 34px 90px rgba(80, 55, 140, 0.20),
    0 0 0 10px rgba(255, 255, 255, 0.58);
  padding: 16px;
  animation: carouselIn 260ms var(--ease-enter) both;
}

.poster-carousel-head,
.poster-carousel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.poster-carousel-head span,
.poster-carousel-foot span {
  color: var(--violet);
  font-size: 12px;
  font-weight: 820;
}

.poster-carousel-head strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.15;
}

.carousel-controls {
  display: inline-flex;
  gap: 6px;
}

.carousel-controls button {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(139, 44, 255, 0.18);
  border-radius: 50%;
  background: #ffffff;
  color: var(--violet);
  font-size: 22px;
  line-height: 1;
  font-weight: 820;
}

.hero-poster-frame {
  position: relative;
  height: 520px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 179, 61, 0.08), rgba(139, 44, 255, 0.06)),
    #ffffff;
}

.hero-poster-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: 1;
  filter: none;
  display: block;
  animation: imageIn 260ms var(--ease-enter);
}

.hero-poster-frame img[hidden],
.hero-poster-empty[hidden] {
  display: none;
}

.hero-poster-empty {
  color: var(--muted);
  text-align: center;
  padding: 24px;
  font-weight: 720;
}

.carousel-dots {
  display: inline-flex;
  gap: 6px;
}

.carousel-dots button {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(139, 44, 255, 0.24);
  padding: 0;
}

.carousel-dots button.is-active {
  width: 22px;
  background: var(--violet);
}

.app-view {
  display: none;
}

.app-view.is-active {
  display: block;
  animation: surfaceIn 240ms var(--ease-enter) both;
}

.creator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  grid-template-areas:
    "input poster"
    "progress poster";
  gap: 18px;
  align-items: start;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.creator-panel {
  grid-area: input;
}

.progress-panel {
  grid-area: progress;
}

.poster-panel {
  grid-area: poster;
  position: sticky;
  top: 96px;
}

.detail-layout > .panel:first-child {
  grid-row: span 3;
}

.panel {
  min-width: 0;
  border: 1px solid rgba(232, 228, 220, 0.95);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}

.panel-head,
.library-title {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-head p,
.library-title p {
  margin-bottom: 4px;
  color: var(--brand);
}

h3 {
  font-size: 20px;
  line-height: 1.25;
  font-weight: 830;
}

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

label,
.search {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.body-label {
  margin-top: 12px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(230, 49, 56, 0.13);
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(230, 49, 56, 0.24);
  outline-offset: 2px;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  padding: 0 16px;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 150ms var(--ease-enter),
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    opacity 180ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--brand), var(--violet));
  border-color: transparent;
  color: #ffffff;
  font-weight: 830;
  box-shadow: 0 14px 28px rgba(230, 49, 56, 0.18);
}

.secondary-button {
  background: #ffffff;
  color: var(--ink);
  font-weight: 760;
}

@media (hover: hover) and (pointer: fine) {
  .primary-button:hover,
  .secondary-button:hover,
  .nav-tabs button:hover,
  .poem-item:hover {
    transform: translateY(-1px);
  }

  .secondary-button:hover {
    border-color: var(--line-strong);
    background: var(--surface-soft);
  }
}

.primary-button:active,
.secondary-button:active,
.nav-tabs button:active,
.poem-item:active {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.62;
  cursor: wait;
}

button.is-busy {
  position: relative;
  padding-left: 38px;
}

button.is-busy::before {
  content: "";
  position: absolute;
  left: 14px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.46);
  border-top-color: #ffffff;
  animation: spin 720ms linear infinite;
}

.hint,
.empty {
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid #f0dfc8;
  border-radius: var(--radius);
  padding: 11px 12px;
  margin-top: 12px;
}

.progress-panel .panel-head strong {
  color: var(--brand);
  font-size: 26px;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.progress-card {
  display: grid;
  gap: 14px;
}

.progress-card.is-active {
  animation: surfaceIn 180ms var(--ease-enter) both;
}

.progress-main {
  display: grid;
  gap: 11px;
  border: 1px solid rgba(230, 49, 56, 0.16);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff 0%, #fff2f4 100%);
  padding: 13px;
}

.progress-main p {
  color: var(--ink);
  font-weight: 820;
}

.progress-main span {
  display: block;
  margin-top: 3px;
  color: var(--warning);
  font-size: 13px;
  font-weight: 720;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(230, 49, 56, 0.12);
}

.progress-track span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--amber), var(--violet));
  transition: width 260ms var(--ease-move);
}

.stage-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stage-list li {
  min-height: 84px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  border: 1px solid rgba(232, 228, 220, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  padding: 10px;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.stage-list li::before {
  content: "";
  margin-top: 5px;
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
  transition:
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.stage-list strong,
.stage-list small {
  display: block;
  grid-column: 2;
  min-width: 0;
  overflow-wrap: anywhere;
}

.stage-list strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 820;
}

.stage-list small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 620;
}

.stage-list li.is-active {
  border-color: rgba(230, 49, 56, 0.32);
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(230, 49, 56, 0.10);
}

.stage-list li.is-active::before {
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(230, 49, 56, 0.13);
}

.stage-list li.is-done {
  border-color: rgba(15, 118, 110, 0.18);
  background: rgba(255, 255, 255, 0.9);
}

.stage-list li.is-done::before {
  background: var(--success);
}

.poster-panel {
  min-height: 640px;
}

.poster-frame {
  position: relative;
  min-height: 540px;
  aspect-ratio: 2 / 3;
  display: grid;
  place-items: center;
  background:
    linear-gradient(45deg, #faf8f3 25%, transparent 25%),
    linear-gradient(-45deg, #faf8f3 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #faf8f3 75%),
    linear-gradient(-45deg, transparent 75%, #faf8f3 75%),
    #ffffff;
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.poster-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  animation: imageIn 260ms var(--ease-enter);
}

.poster-frame img.is-previewable {
  cursor: zoom-in;
}

.poster-frame img.is-partial {
  opacity: 0.92;
  filter: saturate(0.96);
}

.partial-badge {
  position: absolute;
  z-index: 1;
  top: 10px;
  left: 10px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(16, 17, 20, 0.78);
  color: #ffffff;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 780;
  backdrop-filter: blur(8px);
}

.empty-poster {
  color: var(--muted);
  text-align: center;
  padding: 28px;
}

.structured {
  display: grid;
  gap: 10px;
}

.structured-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #ffffff;
}

.structured-title span {
  color: rgba(255, 255, 255, 0.72);
}

.line-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(16, 17, 20, 0.04);
}

.line-card strong,
.line-card span,
.line-card p {
  display: block;
}

.line-card strong {
  font-size: 17px;
}

.line-card span {
  color: var(--brand);
  margin: 5px 0;
  font-size: 13px;
  font-weight: 760;
}

.line-card p {
  color: var(--muted);
}

.reminder {
  border: 1px solid #fed7aa;
  border-left: 4px solid var(--brand);
  background: #fff7ed;
  border-radius: var(--radius);
  padding: 11px 12px;
  color: #7c2d12;
  font-weight: 780;
}

.version-list {
  display: grid;
  gap: 8px;
}

.version-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  background: #ffffff;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    transform 180ms var(--ease-enter);
}

.version-item.is-active {
  border-color: var(--brand);
  background: #fff2f4;
}

.version-item button {
  border: 0;
  background: transparent;
  text-align: left;
  display: grid;
  gap: 2px;
  color: var(--ink);
}

.version-item span {
  color: var(--muted);
  font-size: 13px;
}

.workflow-note {
  display: grid;
  gap: 10px;
  border-color: rgba(139, 44, 255, 0.16);
  background: linear-gradient(135deg, #fff, #f7f2ff);
}

.workflow-note > p {
  color: var(--muted);
}

.library-panel {
  margin-top: 10px;
}

.search-box {
  position: relative;
}

.search-box input {
  padding-right: 44px;
}

.search-box button {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(16, 17, 20, 0.08);
  color: var(--muted);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scale(0.92);
  transition:
    opacity 160ms ease,
    transform 160ms var(--ease-enter),
    background-color 160ms ease;
}

.search-box button.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

.library-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 38px;
  margin-top: 16px;
}

.library-head span {
  min-width: 34px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.poem-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.poem-item {
  min-height: 260px;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: inherit;
  padding: 10px;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms var(--ease-enter);
}

.poem-item.is-active {
  border-color: var(--brand);
  box-shadow: 0 18px 36px rgba(230, 49, 56, 0.12);
}

.poem-thumb {
  min-height: 156px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 179, 61, 0.2), rgba(139, 44, 255, 0.14)),
    #fff9ef;
  border: 1px solid rgba(232, 228, 220, 0.92);
}

.poem-thumb strong {
  color: var(--brand);
  font-size: 46px;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
}

.poem-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 220ms var(--ease-enter);
}

.poem-thumb.has-poster {
  cursor: zoom-in;
}

@media (hover: hover) and (pointer: fine) {
  .poem-thumb.has-poster:hover img {
    transform: scale(1.025);
  }
}

.poem-meta {
  display: grid;
  gap: 3px;
}

.poem-meta strong {
  font-size: 18px;
  line-height: 1.25;
}

.poem-meta em,
.poem-meta small {
  color: var(--muted);
  font-style: normal;
}

.poem-action {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--ink);
  color: #ffffff;
  font-size: 13px;
  font-weight: 820;
}

mark {
  border-radius: 4px;
  background: rgba(255, 179, 61, 0.35);
  color: inherit;
  padding: 0 2px;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(54px, 1fr) minmax(280px, auto) minmax(54px, 1fr);
  align-items: center;
  justify-items: center;
  gap: 14px;
  padding: 24px;
  background: rgba(16, 17, 20, 0.78);
  backdrop-filter: blur(18px);
  animation: viewerFade 180ms var(--ease-enter) both;
}

.image-viewer[hidden] {
  display: none;
}

.viewer-sheet {
  grid-column: 2;
  width: min(700px, 80vw);
  max-height: calc(100dvh - 48px);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  margin: 0;
  animation: viewerZoom 220ms var(--ease-enter) both;
}

.viewer-sheet img {
  min-width: 0;
  max-width: 100%;
  max-height: calc(100dvh - 130px);
  justify-self: center;
  object-fit: contain;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.34);
}

.viewer-sheet figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  padding: 9px 12px;
}

.viewer-sheet strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  line-height: 1.2;
}

.viewer-sheet span {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 760;
}

.viewer-close,
.viewer-nav {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  transition:
    transform 160ms var(--ease-enter),
    background-color 160ms ease,
    color 160ms ease;
}

.viewer-close {
  position: absolute;
  top: 22px;
  right: 22px;
  font-size: 30px;
  line-height: 1;
}

.viewer-nav {
  color: var(--violet);
  font-size: 34px;
  line-height: 1;
  font-weight: 820;
}

.viewer-prev {
  grid-column: 1;
  justify-self: end;
}

.viewer-next {
  grid-column: 3;
  justify-self: start;
}

.viewer-nav[hidden] {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .viewer-close:hover,
  .viewer-nav:hover {
    background: #ffffff;
    transform: translateY(-1px) scale(1.02);
  }
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  min-height: 44px;
  max-width: min(380px, calc(100vw - 36px));
  background: var(--ink);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  padding: 0 14px;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition:
    opacity 180ms var(--ease-enter),
    transform 180ms var(--ease-enter);
  pointer-events: none;
  box-shadow: var(--shadow-md);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.panel,
.poem-item,
.feature-grid article {
  animation: surfaceIn 240ms var(--ease-enter) both;
}

@keyframes carouselIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes surfaceIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes imageIn {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes viewerFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes viewerZoom {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1280px) {
  .site-nav {
    grid-template-columns: 1fr auto;
  }

  .nav-tabs {
    justify-self: end;
  }

  .nav-actions {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .hero,
  .creator-layout,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .creator-layout {
    grid-template-areas:
      "input"
      "progress"
      "poster";
  }

  .detail-layout > .panel:first-child {
    grid-row: auto;
  }

  .hero-showcase {
    min-height: 660px;
  }

  .poster-panel {
    position: static;
    max-width: 560px;
  }

  .poem-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .site-nav {
    position: static;
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .nav-tabs,
  .nav-actions {
    justify-self: stretch;
  }

  .nav-tabs,
  .nav-actions,
  .hero-actions {
    width: 100%;
  }

  .nav-tabs button,
  .hero-actions button,
  .nav-actions button {
    flex: 1 1 0;
  }

  .product-app {
    padding: 14px;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 16px 0 24px;
  }

  h2 {
    font-size: 34px;
  }

  .hero-copy > p:not(.eyebrow) {
    font-size: 16px;
  }

  .feature-grid,
  .form-grid,
  .stage-list,
  .poem-list {
    grid-template-columns: 1fr;
  }

  .hero-showcase {
    display: none;
  }

  .creator-layout,
  .detail-layout {
    gap: 12px;
  }

  .panel {
    padding: 14px;
  }

  .poster-frame {
    min-height: 420px;
  }

  .version-item {
    grid-template-columns: 1fr;
  }

  .image-viewer {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 14px;
  }

  .viewer-sheet {
    grid-column: 1;
    width: 100%;
    max-height: calc(100dvh - 116px);
  }

  .viewer-sheet img {
    max-height: calc(100dvh - 190px);
  }

  .viewer-sheet figcaption {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }

  .viewer-close {
    top: 12px;
    right: 12px;
  }

  .viewer-prev,
  .viewer-next {
    grid-column: 1;
    grid-row: 2;
    align-self: center;
  }

  .viewer-prev {
    justify-self: start;
  }

  .viewer-next {
    justify-self: end;
  }
}
