.story-comments { margin: 3rem 0; padding-top: 1.5rem; border-top: 1px solid currentColor; overflow-wrap: anywhere; }
.story-comments [hidden], .story-comments-tray[hidden] { display: none !important; }
.story-comments label { display: block; margin: 1rem 0; }
.story-comments input, .story-comments textarea, .story-comment-editor textarea { display: block; box-sizing: border-box; max-width: 100%; width: 100%; font: inherit; color: inherit; background: var(--bg, white); border: 1px solid currentColor; padding: .5rem; }
.story-comments button, .story-comment-editor button, .story-comment-standalone, .story-comments-tray { font: inherit; cursor: pointer; padding: .5rem; color: inherit; background: var(--bg, white); border: 1px solid currentColor; }
.story-comments button[type="submit"] { min-height: 44px; }
.story-comments button:disabled { cursor: default; opacity: .6; }
.story-comments .story-comment-honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.story-comment-editor { position: relative; z-index: 4; padding: 1rem; margin: 1rem 0; border: 1px solid currentColor; background: var(--bg, white); }
.story-comment-editor textarea { margin: .5rem 0; }
.story-comment-editor button { margin-right: .5rem; }
.story-comment-note, .story-comment-shown { margin: 1.5rem 0; padding-bottom: 1rem; border-bottom: 1px solid currentColor; }
.story-comments blockquote, .story-comment-editor blockquote { margin: .5rem 0; border-left: 3px solid currentColor; padding-left: .75rem; }
.story-comment-shown p { white-space: pre-wrap; }
.story-comment-reply { margin: 1rem 0 0 1rem; padding-left: 1rem; border-left: 3px solid currentColor; }
.story-comment-reply h4 { font-size: 1rem; }
.story-comments-has-notes { box-sizing: border-box; }
.story-comments-tray { position: fixed; z-index: 6; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + var(--story-comments-footer-clearance, 0px) + env(safe-area-inset-bottom, 0px)); box-sizing: border-box; width: 224px; max-width: calc(100vw - 32px - env(safe-area-inset-right, 0px)); min-height: 44px; margin: 0; padding: 8px; white-space: nowrap; overflow-wrap: normal; border: 2px solid var(--rule); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.4; font-family: Arial, Helvetica, sans-serif; font-weight: 400; border-radius: 0; }
.story-comments-tray:focus-visible, .story-comment-standalone:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.story-comment-standalone { position: relative; display: flex; align-items: center; justify-content: center; box-sizing: border-box; width: 48px; height: 48px; margin: 0 -8px 6px auto; padding: 0; background: transparent; border: 0; color: var(--muted); font: 700 18px/1 var(--mono); }
.story-comment-standalone::before { content: ""; position: absolute; box-sizing: border-box; inset: 8px; border: 2px solid var(--rule); transform: rotate(-4deg); }
.story-comment-standalone::after { content: ""; position: absolute; inset: -3px; }
.story-comment-standalone:hover { color: var(--signal); }
.story-comment-standalone:hover::before { border-color: var(--signal); }
.story-comments .story-comment-delete { border-color: var(--muted); min-height: 44px; }
@media (min-width: 701px) { body:has(.story-comments) > footer.site { padding-bottom: 24px; } }

.story-comments, .story-comment-editor { scroll-margin-top: 1rem; }
@media print { .story-comments-tray, .story-comment-editor, .story-comment-standalone { display: none; } .story-comments-has-notes { padding-right: 0; } }
/* Panels participate in paragraph flow, including at desktop widths. Nothing can
   float over the following paragraph's reaction controls. Opening is by click. */
.para > .rx { position: relative; left: auto; top: auto; display: flex; flex-wrap: wrap; width: 100%; min-height: 44px; margin: 0 0 6px; }
.para > .rx .rx-set { position: static; left: auto; top: auto; width: 100%; grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) 44px; }
.para > .rx .rx-hint { position: static; width: 100%; text-align: right; }
.para > .rx .rx-set .rx-close { display: block; }
.para > .rx[data-state="open"] .rx-open { display: none; }
.para > .rx:not([data-state="open"]):not([data-quiet]):hover .rx-set { display: none; }
.para > .rx:not([data-state="open"]):not([data-quiet]):hover .rx-open { visibility: visible; }

/* The corner pill keeps the column intact. Clearance includes its full height,
   its 16px inset, the safe area and 24px of readable space above it. Lifting above
   the footer does not remove the reservation or change document flow. */
@media (max-width: 700px) {
 .story-comments-has-notes { padding-right: 0; padding-bottom: max(72px, calc(var(--story-comments-bar-height, 44px) + 40px + env(safe-area-inset-bottom, 0px))); scroll-padding-bottom: max(72px, calc(var(--story-comments-bar-height, 44px) + 40px + env(safe-area-inset-bottom, 0px))); }
 html.story-comments-docked { scroll-padding-bottom: max(72px, calc(var(--story-comments-bar-height, 44px) + 40px + env(safe-area-inset-bottom, 0px))); }
}

.story-comments [data-comment-status]:focus-visible { outline: 2px solid currentColor; outline-offset: .25rem; }
.story-comments [data-comment-retry] { scroll-margin-bottom: 24px; }
@media print { body.story-comments-has-notes { padding-right: 0; padding-bottom: 0; } html.story-comments-docked { scroll-padding-bottom: 0; } }

.story-comment-quote { display: inline-block; color: var(--muted); background: var(--panel); border: 1px solid var(--rule); border-radius: 4px; padding: 4px 8px; font-size: .9em; }

.story-comments blockquote, .story-comment-editor blockquote { color: var(--muted); background: var(--panel); border: 1px solid var(--rule); border-radius: 4px; padding: 4px 8px; }

/* Look fixes from the designer's recheck. Hit areas reach 11px past each drawn square on all four sides (the click test
   is 8px outside the rotated square, which itself overshoots by about 1px). The 48px box hangs 8px (10px at 1280, where the
   square is 28px) into the margin so the square's right edge sits on the column edge, as Playful's does.
   Playful's own "+" (.rx-open) is scoped to Playful: Never Been Busier loads the ledger look, whose controls stay as they were. */
body:has(.story-comments[data-story-comments="playful"]) .rx[data-choice=""] .rx-open::after { inset: -13px; }
body:has(.story-comments[data-story-comments="playful"]) .para .rx-open:hover, body:has(.story-comments[data-story-comments="playful"]) .para:hover .rx-open:hover { border-color: var(--signal); }
/* Below 1200px Playful's row sits directly under the paragraph (no paragraph margin), and its "+" is 32px in a 44px row, so
   the 54px hit area, tilted -4deg (and scaled 1.08, tilted 3deg, on hover), would reach up to 8.65px into the paragraph above.
   9px above the row keeps the whole rotated hit area, hovered or not, below the paragraph's bottom edge. At 1200px and wider
   the paragraph keeps its 1em bottom margin (17px or more), which is already more than the 6.37px the hovered hit area needs. */
@media (max-width: 1199.98px) {
 body:has(.story-comments[data-story-comments="playful"]) .para > .rx { margin-top: 9px; }
}
.story-comments textarea:focus-visible, .story-comment-editor textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (min-width: 1200px) {
 .story-comment-standalone { margin-right: -10px; }
 .story-comment-standalone::before { inset: 10px; }
 .story-comment-standalone::after { inset: -1px; }
}
/* The body ends with its own bottom space (inside the block, so the block's bottom edge is 84px below its last line):
   bar 44 + 16 inset + 24 readable. Scoped to this sheet, which only comment pages load. One block per page carries it: the
   essay article, or on the recipe (no article) the last paragraph. The "follow the story" block that sits between the
   article and the comments on two stories does not get a second reservation. */
@media (max-width: 700px) {
 main > article.prose, main > :not(#follow-the-story):has(+ .story-comments) { padding-bottom: max(84px, calc(var(--story-comments-bar-height, 44px) + 40px + env(safe-area-inset-bottom, 0px))); }
 /* The pill steps out of the way while the comments section is on screen, so no note, editor or button is under it. */
 .story-comments-tray { transition: opacity .15s ease-out, visibility 0s; }
 .story-comments-tray.story-comments-tray-faded { opacity: 0; pointer-events: none; visibility: hidden; transition: opacity .15s ease-out, visibility 0s linear .15s; }
}
@media (prefers-reduced-motion: reduce) { .story-comments-tray { transition: none; } .story-comments-tray.story-comments-tray-faded { transition: none; } }

/* A board wrapper inherits the card's authored position classes. The actual card
   keeps its original paint, pin and rotation. Closed markers sit on its edge. */
.board-wide .card.story-comment-card, .board-narrow .card.story-comment-card { padding: 0; border: 0; background: transparent; box-shadow: none; transform: none; min-height: 0; }
.card.story-comment-card::before, .card.story-comment-card::after { display: none; }
.board-wide .card.story-comment-card > .card { position: relative; left: auto; top: auto; width: 100%; margin: 0; }
.board-wide .story-comment-card > .card, .board-narrow .story-comment-card > .card { padding-bottom: 60px; }
.card.story-comment-card > .story-comment-standalone { position: absolute; right: 2px; bottom: -20px; margin: 0; z-index: 2; }
.story-comment-card > .card > .story-comment-standalone { position: absolute; right: 8px; bottom: 8px; margin: 0; z-index: 2; color: #14171c; }
.board-narrow .card.story-comment-card { margin-bottom: 24px; }
.card.story-comment-card > .story-comment-editor { color: var(--ink); font: 400 17px/1.55 var(--sans); }
.picture-mike main > .story-comments { max-width: 46rem; margin-left: auto; margin-right: auto; }

/* Full-width pages keep the gutter/column they already use for their text. */
.story-comments.wrap { margin-left: auto; margin-right: auto; }
.story-comment-page-column { padding-left: var(--gutter); padding-right: var(--gutter); }
/* Board editors follow the whole drawing at wide sizes; narrow editors stay in
   card flow. The opener returns to its card when the editor closes. */
.story-comment-standalone[hidden] { display: none !important; }
.story-comment-board-editor { max-width: 46rem; margin: 24px auto; color: var(--ink); font: 400 17px/1.55 var(--sans); }
.story-comment-card-quote { display: flex; flex-wrap: wrap; gap: .25rem .75rem; }
.story-comment-card-quote > span { display: block; }

/* A saved note stays attached to its paragraph until deletion or a definite send.
   Confirmations last until another editor opens; there is no dismissal timer. */
.story-comment-saved { margin: 1rem 0; color: var(--ink); font: 400 14px/1.55 var(--sans); }
.story-comment-saved button { display: inline; padding: 0; border: 0; background: transparent; color: inherit; text-decoration: underline; text-underline-offset: 3px; font: inherit; text-align: left; cursor: pointer; }
.story-comment-note-marker { display: block; min-height: 44px; margin: 0 0 6px; padding: 8px 12px; border: 1px solid var(--rule); border-left: 3px solid var(--signal, currentColor); border-radius: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.4 var(--sans); cursor: pointer; }
.story-comment-saved button:focus-visible, .story-comment-note-marker:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.card.story-comment-card > .story-comment-note-marker { position: absolute; left: 0; bottom: -20px; z-index: 3; margin: 0; }
.story-comment-card > .card > .story-comment-note-marker { position: absolute; right: 64px; bottom: 10px; z-index: 3; box-sizing: border-box; margin: 0; }
.story-comment-card > .card:has(> .story-comment-note-marker) { box-shadow: inset 3px 0 var(--signal), 0 1px 0 #0e1116; }
.card.story-comment-card > .story-comment-saved { margin: 0; padding: 10px 14px 0; text-align: left; }
@keyframes story-comment-note-saved { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.04); border-color: var(--signal); } }
.story-comments-tray-pulse { animation: story-comment-note-saved .45s ease-out 1; }
@media (prefers-reduced-motion: reduce) { .story-comments-tray { animation: none; } }
@media print { .story-comment-saved, .story-comment-note-marker { display: none; } }
