/* Wishlist page. Everything reads Grimmory's own theme variables, so it follows
   the light/dark switch and the accent colour without knowing about either. */
.wl {
  position: absolute; inset: 0; overflow-y: auto; z-index: 5;
  background: var(--p-content-background, #fff); color: var(--p-text-color, #333);
  font-family: inherit; padding: 15px 18px 48px; box-sizing: border-box;
}
.wl[hidden] { display: none; }
.wl *, .wl *::before, .wl *::after { box-sizing: border-box; }

.wl-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.wl-title { margin: 0 0 4px; font-size: 21px; font-weight: 800; line-height: 1.2; display: flex; align-items: center; gap: 10px; }
.wl-count { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  color: var(--p-primary-color); background: color-mix(in srgb, var(--p-primary-color) 14%, transparent); }
.wl-sub { margin: 0; font-size: 13px; color: var(--p-text-muted-color, #777); }

.wl-search { position: relative; width: min(100%, 320px); }
.wl-search i, .wl-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--p-text-muted-color, #777); pointer-events: none; }

.wl-input {
  width: 100%; height: 35px; padding: 7px 10px; font: inherit; font-size: 12.6px; color: inherit;
  background: var(--p-form-field-background, var(--p-content-background, #fff));
  border: 1px solid var(--p-form-field-border-color, var(--p-content-border-color, #ddd));
  border-radius: 6px; outline: none; transition: border-color .12s, box-shadow .12s;
}
.wl-search .wl-input { padding-left: 31px; }
.wl-input::placeholder { color: var(--p-text-muted-color, #999); }
.wl-input:hover { border-color: color-mix(in srgb, var(--p-primary-color) 45%, var(--p-content-border-color, #ddd)); }
.wl-input:focus { border-color: var(--p-primary-color); box-shadow: 0 0 0 1px var(--p-primary-color); }

.wl-card, .wl-form {
  background: color-mix(in srgb, var(--p-content-background, #fff) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--p-content-border-color, #ddd) 60%, transparent);
  border-radius: 12px;
}
.wl-form { display: grid; grid-template-columns: 1.4fr 1fr 1.6fr auto; gap: 10px; align-items: end; padding: 14px; margin-bottom: 8px; }
.wl-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.wl-field label { font-size: 12px; font-weight: 600; }
.wl-field label span { font-weight: 400; color: var(--p-text-muted-color, #777); }

.wl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 35px; padding: 0 14px;
  font: inherit; font-size: 12.6px; font-weight: 600; border-radius: 6px; cursor: pointer; white-space: nowrap;
  border: 1px solid transparent; transition: background .12s, opacity .12s, border-color .12s;
}
.wl-btn svg { width: 15px; height: 15px; }
.wl-btn-primary { background: var(--p-primary-color); color: var(--p-primary-contrast-color, #fff); }
.wl-btn-primary:hover:not(:disabled) { background: var(--p-primary-hover-color, var(--p-primary-color)); filter: brightness(.94); }
.wl-btn:disabled { opacity: .45; cursor: not-allowed; }
.wl-btn-quiet { background: transparent; color: var(--p-text-muted-color, #777); border-color: var(--p-content-border-color, #ddd); }
.wl-btn-quiet:hover { color: var(--p-text-color); border-color: var(--p-text-muted-color, #999); }
.wl-btn-danger { background: #dc2626; color: #fff; }
.wl-btn-danger:hover { filter: brightness(.92); }
.wl-btn:focus-visible, .wl-icon-btn:focus-visible { outline: 2px solid var(--p-primary-color); outline-offset: 2px; }

.wl-msg { min-height: 20px; margin: 0 2px 8px; font-size: 12.6px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.wl-msg[data-kind="error"] { color: #dc2626; }
.wl-msg[data-kind="info"] { color: var(--p-text-muted-color, #777); }
.wl-msg .wl-btn { height: 28px; padding: 0 10px; }

.wl-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.wl-card { padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; transition: border-color .12s, transform .12s; }
.wl-card:hover { border-color: color-mix(in srgb, var(--p-primary-color) 40%, transparent); }
.wl-book { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.wl-author { margin: 0; font-size: 12.6px; color: var(--p-text-muted-color, #777); overflow-wrap: anywhere; }
.wl-note { margin: 6px 0 0; padding: 6px 9px; font-size: 12.6px; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-line;
  background: color-mix(in srgb, var(--p-text-color, #333) 5%, transparent); border-radius: 6px; }
.wl-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; font-size: 12px; color: var(--p-text-muted-color, #777); }
.wl-avatar { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700;
  color: var(--p-primary-color); background: color-mix(in srgb, var(--p-primary-color) 16%, transparent); }
.wl-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-you { font-weight: 600; color: var(--p-primary-color); }
.wl-spacer { flex: 1; }
.wl-icon-btn { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 6px; cursor: pointer;
  background: transparent; color: var(--p-text-muted-color, #777); }
.wl-icon-btn:hover { color: #dc2626; background: color-mix(in srgb, #dc2626 10%, transparent); }
.wl-icon-btn svg { width: 15px; height: 15px; }
.wl-confirm { display: inline-flex; gap: 6px; align-items: center; }
.wl-confirm .wl-btn { height: 26px; padding: 0 9px; font-size: 12px; }

.wl-empty { margin: 40px auto; max-width: 360px; text-align: center; color: var(--p-text-muted-color, #777); }
.wl-empty svg { width: 38px; height: 38px; margin-bottom: 8px; opacity: .55; }
.wl-empty strong { display: block; margin-bottom: 4px; color: var(--p-text-color); font-size: 14px; }
.wl-empty p { margin: 0; font-size: 13px; line-height: 1.5; }

.wl-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); z-index: 60; max-width: calc(100vw - 32px);
  padding: 9px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; opacity: 0; pointer-events: none;
  color: var(--p-content-background, #fff); background: var(--p-text-color, #222); box-shadow: 0 6px 22px rgba(0,0,0,.25);
  transition: opacity .18s, transform .18s; }
.wl-toast[data-on="1"] { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) { .wl-form { grid-template-columns: 1fr 1fr; } .wl-form .wl-btn { grid-column: 1 / -1; } }
@media (max-width: 560px) { .wl { padding: 12px 12px 48px; } .wl-form { grid-template-columns: 1fr; } .wl-list { grid-template-columns: 1fr; } .wl-search { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .wl *, .wl-toast { transition: none !important; } }

/* Search-as-you-type, picked book, series badge, covers */
.wl-form { position: relative; }
.wl-thumb { flex: none; width: 46px; height: 66px; border-radius: 5px; overflow: hidden; display: grid; place-items: center;
  color: var(--p-primary-color); background: color-mix(in srgb, var(--p-primary-color) 10%, transparent); }
.wl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wl-thumb svg { width: 19px; height: 19px; opacity: .8; }
.wl-thumb-sm { width: 30px; height: 44px; }
.wl-thumb-sm svg { width: 15px; height: 15px; }
.wl-row { display: flex; gap: 12px; align-items: flex-start; }
.wl-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.wl-badge { flex: none; display: inline-block; font-size: 11px; font-weight: 600; line-height: 1; padding: 4px 8px; border-radius: 999px; white-space: nowrap;
  color: var(--p-primary-color); background: color-mix(in srgb, var(--p-primary-color) 13%, transparent); }

.wl-pick { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 10px; border-radius: 8px;
  background: color-mix(in srgb, var(--p-primary-color) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--p-primary-color) 30%, transparent); }
.wl-pick[hidden] { display: none; }
.wl-pick .wl-opt-main { flex: 1; }

.wl-suggest { position: absolute; z-index: 20; top: 72px; left: 14px; right: 14px; max-height: min(380px, 60vh); overflow-y: auto;
  background: var(--p-overlay-select-background, var(--p-content-background, #fff)); color: var(--p-text-color);
  border: 1px solid var(--p-content-border-color, #ddd); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); padding: 6px; }
.wl-suggest[hidden] { display: none; }
.wl-suggest-list { list-style: none; margin: 0; padding: 0; }
.wl-suggest-h { padding: 8px 8px 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--p-text-muted-color, #777); }
.wl-opt { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 7px; cursor: pointer; }
.wl-opt:hover, .wl-opt[aria-selected="true"] { background: color-mix(in srgb, var(--p-primary-color) 12%, transparent); }
.wl-opt-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.wl-opt-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-opt-sub { font-size: 12px; color: var(--p-text-muted-color, #777); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-suggest-note, .wl-suggest-foot { margin: 0; padding: 7px 8px 3px; font-size: 11.5px; color: var(--p-text-muted-color, #777); }

/* Status badges, requester filter, "now in the library" section, arrival notices */
.wl-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.wl-select { width: auto; min-width: 140px; padding-right: 24px; }
.wl-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.wl-badge-off { color: var(--p-text-muted-color, #777); background: color-mix(in srgb, var(--p-text-color, #333) 9%, transparent); }
.wl-badge-warn { color: color-mix(in srgb, #d97706 62%, var(--p-text-color, #222)); background: color-mix(in srgb, #f59e0b 20%, transparent); }
.wl-badge-ok { color: color-mix(in srgb, #16a34a 68%, var(--p-text-color, #222)); background: color-mix(in srgb, #22c55e 18%, transparent); }
.wl-opt-off { opacity: .55; cursor: not-allowed; }
.wl-opt-off:hover, .wl-opt-off[aria-selected="true"] { background: transparent; }
.wl-name { font-weight: 600; color: var(--p-text-color); }
.wl-icon-btn.wl-ok:hover { color: #16a34a; background: color-mix(in srgb, #16a34a 12%, transparent); }
.wl-section { margin: 30px 0 0; font-size: 15px; font-weight: 700; }
.wl-section + .wl-list { margin-top: 10px; }
.wl-done-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 30px; }
.wl-done-head .wl-section { margin: 0; }
.wl-done-head + .wl-list { margin-top: 10px; }

.wl-notices { position: fixed; z-index: 70; top: 14px; right: 14px; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 28px)); }
.wl-notice { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 12px; font-size: 13px; box-sizing: border-box;
  background: var(--p-content-background, #fff); color: var(--p-text-color, #222);
  border: 1px solid color-mix(in srgb, var(--p-primary-color) 45%, var(--p-content-border-color, #ddd)); box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.wl-notice-icon { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  color: var(--p-primary-color); background: color-mix(in srgb, var(--p-primary-color) 14%, transparent); }
.wl-notice-icon svg { width: 17px; height: 17px; }
.wl-notice-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wl-notice-text strong { overflow-wrap: anywhere; }
.wl-notice-text span { color: var(--p-text-muted-color, #777); font-size: 12.5px; }
.wl-notice .wl-btn { height: 30px; padding: 0 12px; }
@media (max-width: 560px) { .wl-tools { justify-content: stretch; width: 100%; } .wl-tools .wl-search { flex: 1; } }
.wl-tools { flex-wrap: nowrap; }
.wl-tools .wl-search { width: min(100%, 260px); flex: 1 1 200px; }
.wl-select { flex: none; }
.wl-who { display: flex; flex-direction: column; line-height: 1.3; white-space: normal; }
.wl-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-when { font-size: 11.5px; opacity: .85; }
@media (max-width: 560px) { .wl-tools { flex-wrap: wrap; } .wl-tools .wl-search { flex-basis: 100%; width: 100%; } .wl-select { width: 100%; } }

/* Grimmory's global styles make every svg a block; keep icons centred where we centre them */
.wl-empty svg { margin-left: auto; margin-right: auto; }

/* Phones: comfortable touch targets, 16px inputs (stops iOS zooming in on focus), tighter spacing */
@media (max-width: 560px) {
  .wl { padding-left: 14px; padding-right: 14px; }
  .wl-head { gap: 8px; margin-bottom: 10px; }
  .wl-title { font-size: 20px; }
  .wl-sub { font-size: 12.5px; }
  .wl-tools { flex-wrap: nowrap; width: 100%; gap: 8px; }
  .wl-tools .wl-search { flex: 1 1 0; width: auto; min-width: 0; }
  .wl-select { flex: 0 0 38%; width: 38%; min-width: 0; }
  .wl-input { font-size: 16px; height: 42px; }
  .wl-search .wl-input { padding-left: 34px; }
  .wl-btn { height: 42px; font-size: 14px; }
  .wl-form { gap: 10px; padding: 12px; }
  .wl-field label { font-size: 12.5px; }
  .wl-list { gap: 10px; margin-top: 12px; }
  .wl-card { padding: 12px; }
  .wl-thumb { width: 38px; height: 56px; }
  .wl-thumb-sm { width: 30px; height: 44px; }
  .wl-icon-btn { width: 40px; height: 40px; }
  .wl-icon-btn svg { width: 18px; height: 18px; }
  .wl-confirm .wl-btn, .wl-msg .wl-btn { height: 36px; }
  .wl-suggest { left: 8px; right: 8px; max-height: min(340px, 42vh); }
  .wl-opt { padding: 8px; }
  .wl-notices { top: 64px; }
  .wl-toast { bottom: 88px; }
}
.wl-msg:empty { display: none; }
@media (max-width: 560px) {
  .wl-opt { flex-wrap: wrap; row-gap: 4px; }
  .wl-opt-main { flex: 1 1 130px; }              /* the badge drops to its own line only when it must */
  .wl-opt .wl-badge { margin-left: auto; }
  .wl-list { margin-top: 10px; }
}

/* release dates: a past one is quiet, an upcoming one keeps the accent colour */
.wl-badge-date { color: var(--p-text-muted-color, #777);
  background: color-mix(in srgb, var(--p-text-muted-color, #777) 12%, transparent); font-weight: 500; }
.wl-badge-soon { font-weight: 700; }
.wl-badge-lib { text-decoration: none; color: var(--p-text-muted-color, #777);
  background: color-mix(in srgb, var(--p-text-muted-color, #777) 12%, transparent); font-weight: 500; }
a.wl-badge-lib:hover { text-decoration: underline; }
.wl-badge-free { color: var(--p-green-600, #16a34a); background: color-mix(in srgb, var(--p-green-600, #16a34a) 15%, transparent); font-weight: 700; }

/* Collapsible filters: a toggle in the header, the panel drops in as its own full-width row */
.wl-head { align-items: center; }
.wl-filter-btn { flex: none; }
.wl-filter-btn svg:last-child { width: 14px; height: 14px; transition: transform .15s; }
.wl-filter-btn[aria-expanded="true"] svg:last-child { transform: rotate(180deg); }
.wl-filter-btn[aria-expanded="true"] { color: var(--p-text-color); border-color: var(--p-text-muted-color, #999); }
.wl-filter-dot { display: none; width: 7px; height: 7px; border-radius: 50%; background: var(--p-primary-color); }
.wl-filter-on .wl-filter-dot { display: inline-block; }
.wl-filter-on { color: var(--p-primary-color); border-color: color-mix(in srgb, var(--p-primary-color) 55%, transparent); }
#wl-filters { flex: 1 0 100%; width: 100%; justify-content: flex-start; }
#wl-filters[hidden] { display: none; }
#wl-filters .wl-search { width: min(100%, 320px); flex: 0 1 320px; }
@media (max-width: 560px) {
  #wl-filters .wl-search { flex: 1 1 0; width: auto; }
  .wl-filter-btn { height: 42px; }
}

/* missing from your series */
.wl-push { margin: 0 0 18px; padding: 12px 14px; border: 1px solid var(--p-content-border-color, #ddd); border-radius: 10px; display: flex; flex-direction: column; gap: 6px; }
.wl-push .wl-done-head { margin-top: 0; }
.wl-push .wl-msg { margin: 4px 0 0; }
.wl-gaps { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; }
.wl-gap-head { display: flex; align-items: flex-start; gap: 10px; }
.wl-gap-head .wl-body { flex: 1; min-width: 0; }
.wl-gap-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wl-gap-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wl-gap-row .wl-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wl-gap-title { font-size: 13px; overflow-wrap: anywhere; }
.wl-gap-done { overflow-wrap: anywhere; }
.wl-gap-head > .wl-body { cursor: pointer; }
.wl-icon-btn.wl-fold:hover { color: var(--p-text-color); background: color-mix(in srgb, currentColor 10%, transparent); }
.wl-fold svg { transition: transform .15s; }
.wl-gap-shut .wl-fold svg { transform: rotate(-90deg); }
.wl-hidden-btn { align-self: flex-start; }
.wl-hidden { margin: 0; }
.wl-hidden .wl-author { font-size: 12px; }

