/* Stable feedback, bounded editor and shared dialog exit. */
.letter-mirror{bottom:0;height:auto;overflow:hidden;contain:layout paint}
#toast.notice-host{scrollbar-width:none}#toast.notice-host::-webkit-scrollbar{display:none;width:0;height:0}.notice-button{overflow:hidden}
dialog::backdrop{transition:background-color .18s ease,backdrop-filter .18s ease}dialog.is-closing{pointer-events:none}dialog.is-closing::backdrop{background-color:transparent;backdrop-filter:blur(0)}
.letter-editor .compose-text{height:clamp(160px,30dvh,240px);min-height:160px;max-height:none;overflow-y:auto;overflow-x:hidden;resize:none;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:#b7c1d7 transparent;overscroll-behavior:contain}.letter-editor .compose-text::-webkit-scrollbar{width:7px}.letter-editor .compose-text::-webkit-scrollbar-track{background:transparent}.letter-editor .compose-text::-webkit-scrollbar-thumb{background:#b7c1d7;border:2px solid transparent;border-radius:10px;background-clip:padding-box}.letter-editor .compose-text:hover{scrollbar-color:#96a5c2 transparent}
#compose-form .compose-footer{align-items:center;gap:16px}#compose-form .compose-options{align-items:center;min-height:48px;flex-wrap:nowrap}#compose-form .compose-options>.icon-button{display:grid;place-items:center;width:40px;min-width:40px;height:40px;padding:0}#compose-form .select-trigger{min-height:40px;align-items:center}#compose-form .publish-actions{display:flex;align-items:center!important;justify-content:flex-end;flex:1 1 auto;flex-wrap:nowrap;gap:14px!important;min-width:0;width:auto}#compose-form .letter-meter{height:48px;align-items:center}#compose-form .hold-wrap{height:48px;min-width:0;flex:0 1 220px;gap:0;margin:0;max-width:220px;width:220px;align-items:center}#compose-form .hold-stage{height:48px;width:100%;align-items:center}#compose-form .hold-publish{max-width:100%}
@media(max-width:760px){.letter-editor .compose-text{height:clamp(140px,25dvh,220px);min-height:140px}#compose-form .compose-footer{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}#compose-form .compose-options{grid-column:1;min-height:40px}#compose-form .publish-actions{grid-column:1;justify-content:space-between;width:100%;gap:10px!important;flex-wrap:nowrap}#compose-form .letter-meter{flex-basis:auto}#compose-form .hold-wrap{align-items:center;margin-left:auto}#compose-form .hold-stage{justify-content:flex-end}}
@media(max-width:380px){#compose-form .hold-publish{font-size:12px}#compose-form .publish-actions{gap:8px!important}}
@media(max-height:650px){.letter-editor .compose-text{height:clamp(110px,25dvh,180px);min-height:110px}.letter-editor{padding-bottom:20px}#compose-form .compose-author{margin-bottom:12px}}
@media(prefers-reduced-motion:reduce){dialog::backdrop{transition:none}}

.feed-controls { gap: 8px; }
.feed-controls .tabs { flex: none; }
.feed-order { position: relative; min-width: 0; }
.feed-order .feed-sort {
  min-height: 44px; padding: 6px 10px; gap: 7px; text-align: start;
  font-size: 12px; line-height: 1.3; font-weight: 700; color: #53617a;
  border-radius: 10px; transition: color .15s, background-color .15s;
}
.feed-order .feed-sort:hover, .feed-order .feed-sort[aria-expanded="true"] {
  background: var(--soft); color: var(--blue);
}
.feed-order .feed-sort[aria-disabled="true"] { cursor: progress; }
.feed-sort > .icon { flex: none; transition: transform .18s ease; }
.feed-sort[aria-expanded="true"] > .icon { transform: rotate(180deg); }
.feed-sort-menu {
  position: absolute; z-index: 5; inset-block-start: calc(100% + 5px); inset-inline-end: 0;
  width: min(234px, calc(100vw - 28px)); padding: 5px;
  background: var(--surface); border: 1px solid #e2e6f0; border-radius: 14px;
  box-shadow: 0 10px 28px #19254d1c, 0 2px 5px #19254d0b;
  transform-origin: top right; animation: feed-order-open .18s var(--spring) both;
}
.feed-sort-menu button {
  display: grid; grid-template-columns: 16px minmax(0, 1fr) 16px; place-items: center start;
  gap: 10px; width: 100%; min-height: 44px; padding: 7px 10px;
  text-align: start; font-size: 13px; line-height: 1.4; font-weight: 700; border-radius: 9px;
}
.feed-sort-menu button > .icon { width: 16px; height: 16px; color: #65738e; }
.feed-sort-menu button[aria-checked="true"] { color: #3648bc; background: var(--soft); }
.feed-sort-menu button[aria-checked="true"] > .icon { color: currentColor; }
.feed-sort-menu button[aria-checked="false"] > .icon:last-child { visibility: hidden; }
.feed-sort-menu button[aria-checked="false"]:is(:hover,:focus-visible) { background: var(--canvas); }
.feed-sort-menu button:focus-visible { outline-offset: -2px; }
@keyframes feed-order-open {
  from { opacity: 0; transform: translateY(-4px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 380px) {
  .feed-order .feed-sort { padding-inline: 6px; gap: 4px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .feed-sort-menu { animation: none; }
  .feed-order .feed-sort, .feed-sort > .icon { transition: none; }
}
