/* Writer typography must stay identical to the main AIKIT site. */
html,
body,
button,
input,
textarea {
  font-family: var(--font-text);
}

body {
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.1px;
}

.writer-global-nav > nav > a:not(.brand-logo),
.writer-global-nav .writer-nav-search input,
.writer-image-link {
  font-family: var(--font-text) !important;
  letter-spacing: -0.26px !important;
}

.writer-hero {
  display: grid;
  min-height: 420px;
  padding-top: clamp(58px, 6vw, 86px);
  padding-bottom: clamp(58px, 6vw, 86px);
}

.writer-eyebrow {
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.writer-hero h1 {
  max-width: 780px;
  color: var(--writer-ink);
  font-family: var(--font-display);
  font-size: clamp(46px, 5.2vw, 76px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.055em;
  -webkit-text-stroke: 0;
  text-shadow: none;
}

.writer-hero-copy > p {
  max-width: 720px;
  margin: 24px 0 26px;
  color: rgba(28, 36, 32, 0.78);
  font-family: var(--font-text);
  font-size: clamp(17px, 1.4vw, 20px);
  font-weight: 400;
  line-height: 1.68;
  letter-spacing: -0.2px;
  text-shadow: none;
}

.writer-hero-meta span {
  font-family: var(--font-text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.writer-hero-meta strong {
  font-size: 14px;
  font-weight: 700;
}

.writer-hero-note > span {
  font-family: var(--font-text);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.writer-hero-note li {
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.writer-hero-note b {
  font-size: 11px;
  font-weight: 700;
}

.writer-category-scroll button {
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 850;
  letter-spacing: -0.2px;
}

.writer-category-scroll button b,
.writer-category-scroll button em {
  font-weight: 600;
}

.writer-library-heading span {
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.writer-library-heading h2 {
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.writer-library-heading > p {
  font-family: var(--font-text);
  font-weight: 400;
}

.writer-library-heading > p strong {
  font-size: 20px;
  font-weight: 700;
}

.writer-card-image > .writer-card-number {
  font-family: var(--font-text);
  font-weight: 700;
}

.writer-card-image > .writer-card-title-reveal {
  top: auto;
  bottom: 14px;
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.28;
  letter-spacing: -0.1px;
}

.writer-detail-heading > span,
.writer-detail-heading > p#writer-detail-number {
  font-family: var(--font-text);
  font-weight: 700;
  letter-spacing: 0;
}

.writer-detail-heading h2 {
  color: var(--writer-ink);
  font-family: var(--font-display);
  font-size: clamp(34px, 4.2vw, 56px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.05em;
  -webkit-text-stroke: 0;
  text-shadow: none;
}

.writer-detail-heading > p#writer-detail-role {
  color: rgba(28, 36, 32, 0.76);
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.68;
}

.writer-section-heading span {
  font-family: var(--font-text);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.writer-section-heading h3 {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.writer-section-heading button,
.writer-parts-guide,
.writer-part-field span,
.writer-output-actions button,
.writer-output-actions a,
.writer-copy-status {
  font-family: var(--font-text);
}

.writer-section-heading button,
.writer-parts-guide,
.writer-part-field span,
.writer-copy-status {
  font-weight: 600;
}

.writer-output-actions button,
.writer-output-actions a {
  font-weight: 700;
}

.writer-part-field textarea {
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.1px;
}

#writer-final-prompt {
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: 0;
}

.writer-library {
  padding-top: 10px;
}

/* Keep the frame quiet and color each category like the main AIKIT feed. */
.writer-category-strip {
  position: relative;
  top: auto;
  z-index: 2;
  width: min(1500px, calc(100% - 44px));
  margin: 20px auto 28px;
  padding: 18px 20px;
  border: 2px solid rgba(28, 36, 32, 0.92);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.88);
  box-shadow: 5px 5px 0 rgba(28, 36, 32, 0.88);
  backdrop-filter: blur(8px);
}

.writer-category-scroll {
  width: 100%;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  overflow: visible;
}

.writer-category-scroll button {
  min-height: auto;
  padding: 7px 11px;
  border: 1.5px solid rgba(28, 36, 32, 0.76);
  border-radius: 999px;
  background: #fff6cb;
  color: var(--aikit-ink);
  box-shadow: 2px 2px 0 rgba(28, 36, 32, 0.34);
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
}

.writer-category-scroll button:nth-child(5n + 2) {
  background: #e8f4eb;
}

.writer-category-scroll button:nth-child(5n + 3) {
  background: #e8f1f8;
}

.writer-category-scroll button:nth-child(5n + 4) {
  background: #f8e3d9;
}

.writer-category-scroll button:nth-child(5n) {
  background: #eadff2;
}

.writer-category-scroll button:nth-child(5n + 1) {
  background: #fff6cb;
}

.writer-category-scroll button b {
  color: rgba(28, 36, 32, 0.48);
  font-weight: 700;
}

.writer-category-scroll button:hover {
  color: var(--aikit-ink);
  border-color: rgba(28, 36, 32, 0.72);
  filter: saturate(1.12) brightness(0.98);
  box-shadow: 3px 3px 0 rgba(28, 36, 32, 0.52);
  transform: translate(-1px, -1px);
}

.writer-category-scroll button.active,
.writer-category-scroll button.active:hover {
  color: var(--aikit-ink);
  border-color: rgba(28, 36, 32, 0.9);
  background: #ffe27a;
  box-shadow: 2px 2px 0 rgba(28, 36, 32, 0.82);
}

.writer-category-scroll button.active b {
  color: rgba(28, 36, 32, 0.58);
}

@media (max-width: 860px) {
  .writer-hero h1 {
    font-size: clamp(42px, 10vw, 66px);
    -webkit-text-stroke: 0;
    text-shadow: none;
  }

  .writer-detail-heading h2 {
    -webkit-text-stroke: 0;
    text-shadow: none;
  }

  .writer-category-strip {
    top: auto;
    width: calc(100% - 24px);
    margin: 14px auto 24px;
    padding: 14px;
  }
}

@media (max-width: 600px) {
  .writer-hero h1 {
    font-size: clamp(38px, 12vw, 56px);
  }

  .writer-category-strip {
    top: auto;
  }

  .writer-category-scroll {
    gap: 8px;
  }
}

/* Keep every thumbnail title visible without covering the artwork. */
.writer-card-image::after {
  inset: auto 0 0;
  height: 22%;
  background: linear-gradient(
    180deg,
    rgba(20, 28, 24, 0) 0%,
    rgba(20, 28, 24, 0.14) 34%,
    rgba(20, 28, 24, 0.68) 100%
  );
  opacity: 1;
}

.writer-card-image > .writer-card-title-reveal,
.writer-card:hover .writer-card-title-reveal,
.writer-card:focus-visible .writer-card-title-reveal {
  opacity: 1;
  transform: none;
}

/* Compact two-line WriterKit banner. */
.writer-hero {
  min-height: 0;
  display: flex;
  align-items: center;
  padding: clamp(28px, 3vw, 44px) clamp(24px, 5vw, 96px);
}

.writer-hero::after {
  display: none;
}

.writer-hero-copy {
  width: 100%;
}

.writer-hero h1,
.writer-hero-copy > p {
  max-width: none;
  margin: 0;
  color: var(--writer-ink);
  font-family: var(--font-display);
  font-size: clamp(25px, 2.3vw, 50px);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: -0.045em;
  white-space: nowrap;
  -webkit-text-stroke: 0;
  text-shadow: none;
}

.writer-hero-copy > p {
  margin-top: 6px;
}

@media (max-width: 980px) {
  .writer-hero {
    padding: 28px 24px;
  }

  .writer-hero h1,
  .writer-hero-copy > p {
    font-size: clamp(22px, 3.5vw, 32px);
    white-space: normal;
  }
}

@media (max-width: 600px) {
  .writer-hero {
    padding: 24px 18px;
  }

  .writer-hero h1,
  .writer-hero-copy > p {
    font-size: clamp(21px, 6.5vw, 29px);
    line-height: 1.3;
  }

  .writer-hero-copy > p {
    margin-top: 9px;
  }
}

.writer-detail-heading > p.writer-detail-reference-note {
  max-width: 760px;
  margin: 8px 0 0;
  color: rgba(28, 36, 32, 0.68);
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: -0.14px;
}

@media (max-width: 600px) {
  .writer-detail-heading > p.writer-detail-reference-note {
    margin-top: 7px;
    font-size: 12px;
    line-height: 1.58;
  }
}

.writer-card:hover .writer-card-image::after,
.writer-card:focus-visible .writer-card-image::after {
  opacity: 1;
}

.writer-outline-placeholder {
  display: grid;
  gap: 10px;
  padding: 22px;
  border: 1px solid rgba(28, 36, 32, 0.16);
  border-radius: 14px;
  background: rgba(255, 253, 247, 0.72);
  color: var(--writer-ink);
}

.writer-outline-placeholder strong {
  font-family: var(--font-text);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
}

.writer-outline-placeholder p {
  margin: 0;
  color: rgba(28, 36, 32, 0.68);
  font-family: var(--font-text);
  font-size: 14px;
  line-height: 1.65;
}

#writer-final-prompt:disabled,
#writer-copy:disabled,
#writer-reset:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

/* Workbook-level rules appear once on the page, not inside every prompt. */
.writer-common-rules {
  width: min(1500px, calc(100% - 44px));
  margin: 0 auto 34px;
  overflow: hidden;
  border: 2px solid rgba(28, 36, 32, 0.9);
  border-radius: 16px;
  background: rgba(255, 250, 240, 0.9);
  box-shadow: 4px 4px 0 rgba(28, 36, 32, 0.82);
}

.writer-common-rules summary {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  color: var(--writer-ink);
}

.writer-common-rules summary::-webkit-details-marker {
  display: none;
}

.writer-common-rules summary > span {
  display: flex;
  align-items: center;
  gap: 12px;
}

.writer-common-rules summary b {
  padding: 5px 8px;
  border: 1.5px solid var(--writer-ink);
  border-radius: 999px;
  background: var(--writer-yellow);
  font-family: var(--font-text);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.writer-common-rules summary strong {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: -0.025em;
}

.writer-common-rules summary small {
  margin-left: auto;
  color: rgba(28, 36, 32, 0.62);
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 600;
}

.writer-common-rules summary::after {
  content: "+";
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--writer-ink);
  border-radius: 999px;
  background: #e8f4eb;
  font-family: var(--font-text);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.writer-common-rules[open] summary::after {
  content: "−";
}

.writer-common-rules ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 18px;
  border-top: 1.5px solid rgba(28, 36, 32, 0.35);
  list-style: none;
}

.writer-common-rules li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 13px;
  border: 1px solid rgba(28, 36, 32, 0.16);
  border-radius: 10px;
  background: rgba(255, 253, 247, 0.78);
}

.writer-common-rules li > b {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #dceee2;
  color: var(--writer-ink);
  font-family: var(--font-text);
  font-size: 10px;
}

.writer-common-rules li span,
.writer-common-rules li small {
  display: block;
  font-family: var(--font-text);
}

.writer-common-rules li span {
  color: var(--writer-ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
}

.writer-common-rules li span strong {
  font-weight: 850;
}

.writer-common-rules li small {
  margin-top: 5px;
  color: rgba(28, 36, 32, 0.62);
  font-size: 11px;
  line-height: 1.5;
}

.writer-common-rules li small.writer-common-rule-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
}

.writer-common-rule-flow code {
  padding: 2px 5px;
  color: #8f4840;
  border: 1px solid rgba(143, 72, 64, 0.28);
  border-radius: 5px;
  background: rgba(143, 72, 64, 0.06);
  font-family: var(--font-text);
  font-size: 10px;
  font-weight: 700;
}

.writer-common-rule-flow i {
  color: rgba(143, 72, 64, 0.7);
  font-family: var(--font-text);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.writer-part-field > span strong {
  font: inherit;
}

.writer-part-field > span em {
  margin-left: auto;
  padding: 3px 7px;
  border: 1px solid rgba(28, 36, 32, 0.42);
  border-radius: 999px;
  background: #f4eadf;
  color: rgba(28, 36, 32, 0.68);
  font-family: var(--font-text);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

@media (max-width: 860px) {
  .writer-common-rules {
    width: calc(100% - 24px);
  }

  .writer-common-rules ol {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .writer-common-rules summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .writer-common-rules summary > span {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .writer-common-rules summary small {
    width: calc(100% - 42px);
    margin-left: 0;
  }

  .writer-common-rules summary::after {
    margin-left: auto;
  }
}
