/* =============================================================================
   Post formatting - an editor sheet with a toolbar beside a feed preview;
   the character limits sit under the preview.
   Paper ground: white writing sheet, ink focus, as in the breaker and templates.
   ============================================================================= */
.fm .tool__work{grid-template-columns:minmax(0,1.12fr) minmax(0,1fr)}
.fm__edit{display:flex;flex-direction:column;gap:10px;min-width:0}
.fm__edit > .label{display:block}

/* ---- the sheet: toolbar, note, textarea, footer ---- */
.fm__sheet{
  display:flex;flex-direction:column;min-width:0;
  background:#fff;border:1px solid rgba(10,10,10,.22);border-radius:var(--r-md);
  transition:border-color .2s var(--ease),box-shadow .2s var(--ease);
}
.fm__sheet:focus-within{border-color:var(--ink);box-shadow:0 0 0 3px rgba(204,211,118,.55)}

.fm__bar{display:flex;flex-wrap:wrap;align-items:center;gap:6px 0;padding:8px}
.fm__group{display:flex;flex-wrap:wrap;gap:4px;padding:0 8px}
.fm__group:first-child{padding-left:0}
.fm__group + .fm__group{border-left:1px solid rgba(10,10,10,.12)}
.fm__tool{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:40px;height:40px;padding:0 10px;border-radius:var(--r-sm);
  border:1px solid transparent;background:transparent;color:var(--ink);
  font-family:'Inter Tight',system-ui,sans-serif;font-size:17px;line-height:1;letter-spacing:0;
  transition:background .2s var(--ease),color .2s var(--ease),border-color .2s var(--ease),transform 160ms var(--ease-out);
}
.fm__tool:active{transform:scale(.94)}
.fm__tool[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:var(--bone)}
.fm__tool b{font-weight:800}
.fm__tool--i{font-style:italic}
.fm__tool--bi{font-weight:800;font-style:italic;font-size:15px}
.fm__tool--u span{text-decoration:underline;text-decoration-thickness:1.5px;text-underline-offset:3px}
.fm__tool--s span{text-decoration:line-through;text-decoration-thickness:1.5px}
.fm__tool--mono{font-family:'JetBrains Mono',ui-monospace,monospace;font-size:12.5px}
.fm__tool--num{font-size:15px;font-weight:500}
.fm__tool--text{
  padding:0 13px;border-color:rgba(10,10,10,.2);border-radius:999px;
  font-family:'JetBrains Mono',ui-monospace,monospace;font-size:11px;font-weight:500;
  letter-spacing:.1em;text-transform:uppercase;
}
@media (hover:hover) and (pointer:fine){
  .fm__tool:hover{background:var(--paper-2)}
  .fm__tool--text:hover{border-color:var(--ink)}
  .fm__tool[aria-pressed="true"]:hover{background:var(--ink-3)}
}

/* The toolbar sits straight on the writing area now. */
.fm__bar{border-bottom:1px solid rgba(10,10,10,.08)}
.fm__note{line-height:1.5;max-width:92ch}

.fm__area{
  display:block;width:100%;min-height:340px;resize:vertical;padding:18px 20px;
  border:0;outline:none;background:transparent;color:var(--ink);caret-color:var(--ink);
  font-family:'Inter Tight',system-ui,sans-serif;font-size:16px;line-height:1.6;letter-spacing:0;
}
.fm__area:focus-visible{outline:none}
.fm__area::placeholder{color:rgba(10,10,10,.52);font-style:italic}

.fm__foot{
  display:flex;align-items:center;gap:10px;min-height:52px;padding:8px 18px 8px 12px;
  border-top:1px solid rgba(10,10,10,.08);
}
.fm__count{margin-left:auto;font-size:11px;letter-spacing:.12em;color:var(--fg-3)}

.fm__status{text-align:left;min-height:1.5em}
.fm__status:empty{min-height:0;margin-top:-10px}

/* ---- preview: a neutral post card in a grey feed ---- */
.fm__panel{gap:16px}
/* The shared .pill small (opacity .7) drops to 3.9:1 on white; .85 keeps 5.8:1. */
.fm .pill small{opacity:.85}
.fm__feed{padding:18px;border-radius:var(--r-sm);background:var(--paper-2)}
.fm__card{
  max-width:552px;margin:0 auto;padding:14px 16px 16px;
  border:1px solid rgba(10,10,10,.1);border-radius:10px;background:#fff;
  transition:max-width .35s var(--ease-out);
}
.fm[data-device="mobile"] .fm__card{max-width:375px}
.fm__who{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.fm__avatar{flex:none;width:44px;height:44px;border-radius:50%;background:#d6d6cf}
.fm__id{display:flex;flex-direction:column;gap:1px;min-width:0}
.fm__name{font-size:14px;font-weight:600;line-height:1.3;color:var(--ink)}
.fm__time{font-size:12px;line-height:1.3;color:rgba(10,10,10,.62)}
/* The feed's own system font, not the site's: that is what readers will see. */
.fm__post{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  font-size:14px;line-height:1.43;letter-spacing:0;color:rgba(10,10,10,.9);
  white-space:pre-wrap;overflow-wrap:anywhere;
}
.fm__empty{color:rgba(10,10,10,.62);font-style:italic}
.fm__more{color:rgba(10,10,10,.62);font-weight:600;white-space:nowrap}
.fm__cut{font-size:11px;line-height:1.55;letter-spacing:.06em;color:var(--fg-2)}
.fm__panel .counter{margin-top:4px}

@media (max-width:980px){
  .fm .tool__work{grid-template-columns:1fr}
}
@media (max-width:560px){
  .fm__bar{padding:6px}
  .fm__group{padding:0 4px}
  .fm__group + .fm__group{border-left:0}
  .fm__tool--text{margin-left:2px}
  .fm__area{min-height:260px;padding:14px 16px}
  .fm__foot{padding:8px 14px 8px 10px}
  .fm__feed{padding:10px;margin:0 -6px}
  .fm__card{padding:12px 14px 14px}
}
@media (prefers-reduced-motion:reduce){
  .fm__card{transition:none}
}
