#options-panel-prompt-book { padding: 22px; min-width: 0; }
#options-panel-prompt-book [hidden] { display: none; }
.prompt-book-heading, .prompt-book-toolbar, .prompt-book-entry-heading, .prompt-book-actions { display: flex; align-items: center; gap: 12px; }
.prompt-book-heading { justify-content: space-between; align-items: flex-start; }
.prompt-book-heading h2 { margin: 0; font-size: calc(19px + var(--app-font-increase, 1pt)); letter-spacing: -.03em; }
.prompt-book-heading p, .prompt-book-footnote { color: var(--muted); font-size: calc(12px + var(--app-font-increase, 1pt)); line-height: 1.7; margin: 7px 0 0; }
.prompt-book-toolbar { margin: 18px 0 12px; flex-wrap: wrap; }
#options-panel-prompt-book button, #options-panel-prompt-book input, #options-panel-prompt-book select { min-height: 36px; padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface-raised); color: var(--text); font: inherit; font-size: calc(12px + var(--app-font-increase, 1pt)); }
#options-panel-prompt-book button { cursor: pointer; }
#options-panel-prompt-book button:disabled { opacity: .45; cursor: default; }
#options-panel-prompt-book :is(button, input, textarea, select, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.prompt-book-scopes { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-raised); }
#options-panel-prompt-book .prompt-book-scopes button { border-color: transparent; background: transparent; }
#options-panel-prompt-book .prompt-book-scopes button[aria-pressed="true"] { background: var(--panel); border-color: var(--line); color: var(--accent); }
.prompt-book-toolbar input { flex: 1; width: 130px; min-width: 100px; }
.prompt-book-status, .prompt-book-pending { margin: 8px 0; font-size: calc(12px + var(--app-font-increase, 1pt)); line-height: 1.6; color: var(--accent); }
.prompt-book-status:empty { display: none; }
.prompt-book-status.is-error { color: var(--danger, #c43c35); }
.prompt-book-pending { color: var(--muted); }
.prompt-book-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: var(--panel); }
.prompt-book-list { padding: 12px 9px; border-right: 1px solid var(--line); max-height: min(560px, 62dvh); overflow: auto; overscroll-behavior: contain; background: var(--surface-raised); }
.prompt-book-list h3 { margin: 15px 9px 7px; color: var(--muted); font-size: calc(11px + var(--app-font-increase, 1pt)); font-weight: 500; }
.prompt-book-list h3:first-child { margin-top: 2px; }
#options-panel-prompt-book .prompt-book-list button { display: flex; align-items: center; width: 100%; gap: 10px; border-color: transparent; background: transparent; text-align: left; padding: 10px 9px; }
#options-panel-prompt-book .prompt-book-list button[aria-pressed="true"] { border-color: var(--line-strong); background: var(--panel); color: var(--accent); }
.prompt-book-list small { display: block; font-size: calc(10px + var(--app-font-increase, 1pt)); font-weight: 400; color: var(--muted); margin-top: 4px; }
.prompt-book-icon { flex: 0 0 23px; display: grid; place-items: center; width: 23px; height: 23px; }
.prompt-book-icon svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.35; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.prompt-book-detail { min-width: 0; padding: 22px; max-height: min(560px, 62dvh); overflow: auto; overscroll-behavior: contain; }
.prompt-book-entry-heading h3 { font-size: calc(17px + var(--app-font-increase, 1pt)); margin: 4px 0 0; letter-spacing: -.02em; }
.prompt-book-entry-heading > div > span { font-size: calc(11px + var(--app-font-increase, 1pt)); color: var(--muted); }
.prompt-book-badge { margin-left: auto; font-size: calc(10px + var(--app-font-increase, 1pt)); color: var(--muted); white-space: nowrap; }
.prompt-book-summary { font-size: calc(12px + var(--app-font-increase, 1pt)); line-height: 1.7; color: var(--text); margin: 18px 0 10px; overflow-wrap: anywhere; }
.prompt-book-condition { font-size: calc(11px + var(--app-font-increase, 1pt)); line-height: 1.7; padding: 11px 13px; border-radius: 9px; background: var(--surface-raised); color: var(--muted); margin-bottom: 20px; }
.prompt-book-field { display: block; font-size: calc(12px + var(--app-font-increase, 1pt)); font-weight: 500; margin: 15px 0; }
.prompt-book-field textarea { display: block; width: 100%; min-height: 100px; margin-top: 8px; padding: 12px; resize: vertical; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel); color: var(--text); font: inherit; font-weight: 400; line-height: 1.75; }
.prompt-book-field small { display: block; margin-top: 6px; text-align: right; color: var(--muted); font-size: calc(10px + var(--app-font-increase, 1pt)); font-weight: 400; font-variant-numeric: tabular-nums; }
.prompt-book-actions { flex-wrap: wrap; gap: 8px; }
.prompt-book-actions small { color: var(--muted); font-size: calc(10px + var(--app-font-increase, 1pt)); margin-right: auto; }
#options-panel-prompt-book .prompt-book-save { background: var(--accent); border-color: var(--accent); color: #fff; }
.prompt-book-raw { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 13px; }
.prompt-book-raw summary { cursor: pointer; color: var(--muted); font-size: calc(12px + var(--app-font-increase, 1pt)); line-height: 1.7; padding: 4px 0; }
.prompt-book-raw button { margin-top: 12px; }
.prompt-book-raw pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: calc(11px + var(--app-font-increase, 1pt)); line-height: 1.8; color: var(--muted); user-select: text; }
.prompt-book-empty { font-size: calc(13px + var(--app-font-increase, 1pt)); line-height: 1.8; color: var(--muted); }
.prompt-book-footnote { font-size: calc(10px + var(--app-font-increase, 1pt)); margin-top: 13px; }
@media (hover: hover) { #options-panel-prompt-book button:not(:disabled):hover { filter: brightness(.96); } }
@media (max-width: 660px) {
  #options-panel-prompt-book { padding: 14px; }
  .prompt-book-heading { flex-wrap: wrap; }
  .prompt-book-layout { grid-template-columns: minmax(0, 1fr); }
  .prompt-book-list { max-height: 180px; border-right: 0; border-bottom: 1px solid var(--line); }
  .prompt-book-detail { padding: 16px; max-height: none; }
  .prompt-book-toolbar { gap: 8px; }
  .prompt-book-scopes { width: 100%; }
  .prompt-book-scopes button { flex: 1; }
}
