.textbook-picker { min-height: 100dvh; background: var(--canvas); color: var(--ink); padding: 28px clamp(20px,2.5%,40px); font-family: var(--font-sans); letter-spacing: 0; }
.textbook-picker[hidden] { display: none; }
.textbook-picker * { box-sizing: border-box; letter-spacing: 0; }
.tp-header { min-height: 72px; display: flex; align-items: center; justify-content: center; position: relative; }
.tp-header h1 { margin: 0; color: var(--ink); font-size: clamp(24px,2.6vw,32px); font-weight: 800; }
.tp-header h1 span { color: var(--accent); }
.tp-back { position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; padding: 0; background: none; border: 0; cursor: pointer; }
.tp-back img { width: 22px; height: 22px; object-fit: contain; filter: brightness(0); opacity: .75; }
.tp-region { background: var(--surface); border: 1px solid var(--line); min-height: calc(100dvh - 130px); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 24px 34px 32px; }
.tp-filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; column-gap: 32px; row-gap: 14px; margin-bottom: 24px; }
.tp-filters label { display: flex; align-items: center; gap: 10px; font-size: 15px; white-space: nowrap; color: var(--ink); min-width: 0; }
.tp-filters select { background-color: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 999px; width: 180px; min-width: 0; height: 42px; padding: 2px 20px; font: inherit; font-size: 15px; font-weight: 600; text-align: center; text-overflow: ellipsis; cursor: pointer; }
.tp-filters label:last-child select { width: 210px; }
.tp-filters select:disabled { color: var(--faint); cursor: default; }
.tp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 22px; align-items: start; }
.tp-book { display: flex; flex-direction: column; align-items: center; position: relative; width: 100%; min-width: 0; background: none; border: 0; padding: 0 6px; color: var(--ink); font: inherit; cursor: pointer; }
.tp-cover { width: min(190px, 100%); aspect-ratio: 208/282; display: grid; place-items: center; background: var(--surface-sunken); border-radius: var(--radius-sm); overflow: hidden; color: var(--faint); }
.tp-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tp-caption { max-width: 190px; font-size: 15px; line-height: 1.4; margin-top: 16px; color: var(--ink); overflow-wrap: anywhere; text-align: center; }
.tp-book:hover .tp-cover { outline: 2px solid var(--accent); outline-offset: 2px; }
.tp-bound { margin-top: 8px; color: var(--accent); font-size: 13px; font-weight: 600; }
.tp-empty { grid-column: 1/-1; text-align: center; padding: 50px 12px; color: var(--muted); }
.tp-status { text-align: center; color: var(--danger); padding: 14px; }
.tp-confirm { width: min(460px, 92vw); padding: 26px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); font-family: inherit; }
.tp-confirm::backdrop { background: rgba(20, 28, 42, .5); }
.tp-confirm h2 { font-size: 22px; margin: 0 0 18px; }
.tp-confirm p { line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }
.tp-content-note { color: var(--muted); font-size: 13px; }
.tp-confirm-actions { display: flex; justify-content: flex-end; gap: 14px; margin-top: 22px; }
.tp-confirm-actions button { padding: 9px 22px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
.tp-confirm-actions .tp-save { background: var(--accent); color: #fff; border-color: var(--accent); }
.tp-confirm-actions .tp-save:hover { background: var(--accent-strong); color: #fff; }
.tp-confirm-actions button:disabled { opacity: .6; cursor: wait; }
.tp-error { color: var(--danger); }
.textbook-picker :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 1400px) { .tp-filters { column-gap: 20px; } .tp-filters select { width: 160px; font-size: 14px; } .tp-filters label:last-child select { width: 180px; } }
@media (max-width: 1100px) { .tp-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } .tp-filters label { justify-content: flex-end; } .tp-filters select, .tp-filters label:last-child select { width: 100%; } .tp-region { padding: 22px; } .tp-caption { font-size: 14px; } }
@media (max-width: 640px) {
  .textbook-picker { padding: 16px 12px; } .tp-header { min-height: 58px; } .tp-header h1 { font-size: 22px; } .tp-back { width: 36px; height: 38px; } .tp-region { padding: 18px 14px 24px; min-height: calc(100dvh - 90px); border-radius: var(--radius-lg); }
  .tp-filters { column-gap: 12px; row-gap: 12px; margin-bottom: 22px; } .tp-filters label { font-size: 13px; flex-direction: column; align-items: stretch; gap: 6px; } .tp-filters select, .tp-filters label:last-child select { font-size: 14px; height: 40px; padding-left: 8px; }
  .tp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 12px; } .tp-book { padding: 0; } .tp-caption { font-size: 13px; margin-top: 12px; }
}
