/* Local interaction styles; the approved static pages keep app.css unchanged. */
.compose-page [hidden] { display: none !important; }
.compose-page a { color: inherit; text-decoration: none; }
.compose-page a.button-primary { color: white; }
.developer-notice { width: min(100%, 640px); margin: 0 auto; padding: 9px 16px; background: var(--pink-soft); color: #a33150; font-size: 12px; text-align: center; }
.compose-page button:not(:disabled), .compose-page summary { cursor: pointer; }
.compose-page button:disabled { opacity: .5; cursor: not-allowed; }
.compose-page button:focus-visible, .compose-page summary:focus-visible {
  outline: 2px solid var(--pink-strong);
  outline-offset: 3px;
}
.compose-page .copy-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.compose-page .copy-actions .button { flex: 1; padding-inline: 10px; }
.compose-page #result-summary { margin-bottom: 12px; }
.compose-page #issues ul { padding-left: 18px; }
.compose-page [data-state="error"] { color: #a33150; }
.compose-page details summary { margin: 12px 0; color: #656772; font-size: 12px; }
.compose-page dialog.copy-sheet {
  position: fixed;
  inset: auto 0 0;
  width: min(100%, 640px);
  max-width: 640px;
  max-height: 88svh;
  margin: 0 auto;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  border: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--ink);
}
.compose-page dialog::backdrop { background: #24252b68; }
.compose-page .sheet-title h2 { font-size: 23px; }
.compose-page .selection-item { cursor: pointer; }
.compose-page .selection-item > span { min-width: 0; overflow-wrap: anywhere; }
.compose-page .selection-item input {
  appearance: none;
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  margin: 0;
  border: 1px solid #d8d9e3;
  border-radius: 50%;
  background: white;
}
.compose-page .selection-item input:checked { background: var(--pink); box-shadow: inset 0 0 0 4px white; border-color: var(--pink); }
.compose-page .selection-item:has(input:checked) { border-color: #ffd6e6; background: #fff7fa; }
.compose-page .selection-item:focus-within { outline: 2px solid #ffc5dc; outline-offset: 2px; }
.compose-page .selection-item small { font-size: 11px; white-space: pre-wrap; }
.compose-page .copy-preview { user-select: text; }
.compose-page .archive-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.compose-page .library-list { display: grid; gap: 16px; }
.compose-page .card-heading h3, .compose-page .saved-title { overflow-wrap: anywhere; }
.compose-page .card-footer { display: block; margin-top: 18px; }
.compose-page .card-footer .timestamp { display: block; margin-bottom: 12px; }
.compose-page .archive-card-actions { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.compose-page .archive-card-actions .button { min-height: 42px; padding: 9px 16px; border-radius: 99px; font-size: 13px; font-weight: 500; }
.compose-page .archive-card-actions .button-primary { box-shadow: none; }
.compose-page #save-panel .action-bar { margin-bottom: 0; }
.compose-page .saved-times { display: grid; gap: 4px; margin-top: 12px; }
.compose-page .plain-fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
.compose-page .filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compose-page .filter-grid .field, .compose-page .field-control { min-width: 0; }
.compose-page .filter-grid .field { margin: 0; }
.compose-page select { font: inherit; }
.compose-page .organization-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0; }
.compose-page .organization-fields { margin-top: 18px; }
.compose-page .tag-input { min-height: 80px; resize: vertical; }
.compose-page .saved-tags { margin-block: 10px; gap: 6px; }
.compose-page .saved-tags:empty { display: none; }
.compose-page .badge { overflow-wrap: anywhere; white-space: normal; }
.compose-page .category-row { gap: 12px; flex-wrap: wrap; }
.compose-page .category-row > div { min-width: 0; flex: 1; }
.compose-page .category-row h3, .compose-page .category-card h3 { overflow-wrap: anywhere; }
.compose-page .category-create { margin-top: 22px; }
.compose-page #category-dialog .action-bar { margin-bottom: 0; }
.compose-page .hero-bottom { flex-wrap: wrap; gap: 10px; }
.compose-page .button-danger { background: #fff3f5; border-color: #f4c8d3; color: #a33150; }
.compose-page .edit-row { margin: 16px 0; padding: 16px; border: 1px solid var(--line, #ececf1); border-radius: 16px; overflow-wrap: anywhere; }
.compose-page .edit-row-title { margin: 0 0 12px; font-size: 14px; }
.compose-page .edit-entry { padding-block: 12px; border-bottom: 1px solid var(--line, #ececf1); }
.compose-page .edit-entry > .field + .field { margin-top: 10px; }
.compose-page .edit-row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.compose-page .edit-row textarea { min-height: 72px; resize: vertical; }
.compose-page .edit-group > .field { margin-top: 16px; }
.compose-page #delete-name { margin: 16px 0; overflow-wrap: anywhere; }
.compose-page #edit-status { overflow-wrap: anywhere; }
.compose-page #edit-status:empty { margin: 0; }
.compose-page #reload-item { flex-shrink: 0; }
.saved-item-page .saved-item-header { margin-top: 18px; padding: 22px; }
.saved-item-page .saved-item-header .saved-title { margin-bottom: 12px; }
.saved-item-page .saved-times { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 18px; font-size: 11px; }
.saved-item-page .saved-item-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.saved-item-page .saved-item-actions .button { min-height: 40px; padding: 8px 16px; border-radius: 99px; font-size: 13px; }
.saved-item-page .saved-item-actions .saved-delete { margin-left: auto; padding-inline: 10px; color: #916674; }
.saved-item-page .archive-toolbar { margin: 12px 2px; gap: 10px; }
.saved-item-page .archive-toolbar:has(#item-status:empty) { justify-content: flex-end; margin-block: 0 10px; }
.saved-item-page #reload-item { min-height: 32px; padding: 4px 8px; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.saved-item-page #body-preview { padding: 0; border: 0; background: transparent; }
.saved-item-page .move-sheet { padding: 24px; }
.saved-item-page .move-sheet .field { margin-top: 22px; }
.saved-item-page .move-sheet .action-bar { margin-bottom: 0; }
.compose-page a.button:focus-visible { outline: 2px solid var(--pink-strong); outline-offset: 3px; }

/* Keep native select semantics, validation and keyboard behavior. The picker
   itself is styled in browsers supporting customizable select (base-select). */
@supports (appearance: base-select) {
  .compose-page select.field-control,
  .compose-page select.field-control::picker(select) { appearance: base-select; }
  .compose-page select.field-control { display: flex; align-items: center; gap: 12px; cursor: pointer; }
  .compose-page select.field-control::picker-icon { color: #aa7287; transition: rotate 160ms ease; }
  .compose-page select.field-control:open::picker-icon { rotate: 180deg; }
  .compose-page select.field-control::picker(select) {
    margin-block: 7px;
    padding: 6px;
    border: 1px solid #f1dbe4;
    border-radius: 16px;
    background: #fff;
    color: #444754;
    box-shadow: 0 12px 36px #6b34591a;
    font: inherit;
    max-height: min(320px, 48svh);
    overflow-y: auto;
  }
  .compose-page select.field-control option { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 14px; border-radius: 10px; font-size: 14px; white-space: normal; overflow-wrap: anywhere; cursor: pointer; }
  .compose-page select.field-control option:hover,
  .compose-page select.field-control option:focus { background: #fff4f8; color: #9f3d63; outline: none; }
  .compose-page select.field-control option:checked { background: #ffeef5; color: #a23661; font-weight: 600; }
  .compose-page select.field-control option::checkmark { color: #d65085; order: 1; margin-left: auto; }
  .compose-page select.field-control:disabled,
  .compose-page select.field-control option:disabled { cursor: not-allowed; opacity: .55; }
}
@media (max-width: 360px) {
  .saved-item-page .saved-times { grid-template-columns: 1fr; }
  .saved-item-page .saved-item-actions { gap: 6px; }
  .saved-item-page .saved-item-actions .button { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .compose-page select.field-control::picker-icon { transition: none; }
}
