/* Books screen (owner, 7 November 2026): SAT's Add Website form look for the panels, SAT cards for the books. */
#books-view .books-intro { color: #4b5563; margin: 0 0 16px; line-height: 1.5; }
.books-panel {
    display: flex; flex-direction: column; gap: 10px; margin-top: 16px; padding: 24px;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
}
.books-panel > p { margin: 0; color: #4b5563; }
#books-view label { font-size: 14px; font-weight: 600; color: #1f2937; }
#books-view input[type="text"], #books-view input[type="number"], #books-view textarea {
    width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1px solid #cbd5e1; border-radius: 6px;
    background: #ffffff; color: #1f2937; font: inherit; font-size: 15px; line-height: 1.5;
}
#books-view textarea { resize: vertical; }
.books-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.books-buttons button {
    padding: 12px 16px; border: 0; border-radius: 6px; background: #16324f; color: #ffffff;
    font-size: 15px; font-weight: 600; cursor: pointer; margin: 0;
}
.books-buttons button:hover { background: #244d73; }
.books-buttons button:disabled { opacity: 0.6; cursor: not-allowed; }
.books-message, .books-result p { margin: 0; font-weight: 600; color: #16324f; }
.books-message:empty, .books-result:empty { display: none; }
.books-result { display: flex; flex-direction: column; gap: 4px; }
.books-result .books-problem { color: #b91c1c; font-weight: 400; }
#books-view .status-card h2.books-heading { margin: 32px 0 12px; color: #16324f; font-size: 20px; }
#books-empty { color: #4b5563; }
#books-empty[hidden] { display: none; }
#books-list { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
#books-detail .books-card { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 24px; align-items: start; margin: 0; }
.books-cover { width: 160px; aspect-ratio: 2 / 3; border-radius: 6px; background: #ffffff; border: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.books-cover img { width: 100%; height: 100%; object-fit: contain; }
.books-cover p { margin: 0; color: #6b7280; font-size: 14px; min-height: 0; }
.books-body { display: flex; flex-direction: column; gap: 12px; }
#books-detail .books-body p { min-height: 0; }
#books-detail .books-body p.books-status { margin: 0; font-weight: 600; }
#books-detail .books-body p.books-status-suggested { color: #92400e; }
#books-detail .books-body p.books-status-confirmed { color: #15803d; }
.books-field { display: flex; flex-direction: column; gap: 6px; }
.books-links { border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px 16px; margin: 0; background: #ffffff; display: flex; flex-direction: column; gap: 10px; }
.books-links legend { font-size: 14px; font-weight: 600; color: #1f2937; padding: 0 4px; }
.books-link { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.books-link a { color: #16324f; font-weight: 600; }
.books-format { display: flex; gap: 20px; }
#books-view .books-format label { font-weight: 400; display: flex; align-items: center; gap: 6px; cursor: pointer; }
#books-detail .books-card .books-buttons button + button { margin-left: 0; }
@media (max-width: 640px) {
    #books-detail .books-card { grid-template-columns: 1fr; }
    .books-cover { width: 120px; }
}

/* Add a Book (owner, 7 November 2026): screenshots list, sources on each section, ISBN on each format. */
.books-panel h3 { margin: 0; color: #16324f; font-size: 18px; }
.books-count { margin: 0; color: #4b5563; }
.books-shot-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.books-shot-list:empty { display: none; }
.books-shot-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 6px; padding: 6px 6px 6px 12px; color: #1f2937; }
.books-shot-list button { padding: 6px 12px; border: 1px solid #cbd5e1; border-radius: 6px; background: #ffffff; color: #16324f; font-weight: 600; cursor: pointer; }
.books-shot-list button:hover { background: #f1f6fb; }
#books-about-panel[hidden] { display: none; }
#books-about-status { font-weight: 600; color: #16324f; }
.books-source { font-weight: 400; color: #6b7280; font-size: 13px; }
.books-source.books-missing { color: #92400e; font-weight: 600; }
.books-link-info { display: flex; flex-direction: column; gap: 2px; }
.books-isbn { color: #4b5563; font-size: 14px; }
.books-links > p { margin: 0; color: #6b7280; }
.books-paste { display: grid; gap: 8px; padding: 18px; border: 2px dashed #94a3b8; border-radius: 8px; background: #f8fafc; color: #1f2937; line-height: 1.5; }
.books-paste:focus-within { border-color: #2563eb; background: #eff6ff; }
.books-paste > strong { color: #16324f; font-size: 16px; }
.books-paste > span { color: #4b5563; }
.books-paste .books-count { margin: 0; }
.books-shot-list img { width: 72px; height: 54px; object-fit: cover; object-position: top; border: 1px solid #e2e8f0; border-radius: 4px; flex: none; }
.books-shot-list li > span { flex: 1; }
.books-paste-area { min-height: 64px; padding: 12px 14px; border: 1px solid #cbd5e1; border-radius: 6px; background: #ffffff; color: #6b7280; cursor: text; display: flex; align-items: center; justify-content: center; caret-color: transparent; }
.books-paste-area:focus { outline: 3px solid #93c5fd; outline-offset: 1px; }
.books-paste-area:empty::before { content: attr(data-placeholder); color: #6b7280; }
.books-paste-area:focus:empty::before { content: 'Now press Ctrl+V'; color: #16324f; font-weight: 600; }

/* Three pages (owner, 7 November 2026): Add a Book, Your Books (short list) and one book's details. */
.books-nav { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; }
.books-nav button { padding: 12px 20px; border: 2px solid #16324f; border-radius: 6px; background: #ffffff; color: #16324f; font-size: 15px; font-weight: 600; cursor: pointer; margin: 0; }
.books-nav button:hover { background: #f1f6fb; }
.books-nav button[aria-current="page"] { background: #16324f; color: #ffffff; }
#books-page-add[hidden], #books-page-list[hidden], #books-page-details[hidden] { display: none; }
#books-view .status-card h2.books-heading:first-child { margin-top: 0; }
#books-page-details > .books-buttons { margin: 0 0 16px; }
#books-details-message { margin-bottom: 16px; }
#books-list { gap: 12px; }
.books-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 16px; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 10px; }
.books-thumb { width: 64px; aspect-ratio: 2 / 3; border-radius: 4px; border: 1px solid #e2e8f0; background: #f8fafc; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.books-thumb img { width: 100%; height: 100%; object-fit: contain; }
.books-thumb span { font-size: 12px; color: #6b7280; text-align: center; }
.books-row-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.books-row-info h3 { margin: 0 0 2px; font-size: 17px; color: #16324f; }
.books-row-info p { margin: 0; color: #4b5563; }
.books-row-info p.books-row-status { font-weight: 600; }
.books-row-info p.books-status-suggested { color: #92400e; }
.books-row-info p.books-status-confirmed { color: #15803d; }
.books-row .books-buttons { margin: 0; }
@media (max-width: 640px) {
    .books-row { grid-template-columns: 56px minmax(0, 1fr); }
    .books-row .books-buttons { grid-column: 1 / -1; }
    .books-row .books-buttons button { width: 100%; }
}
.books-row-info p.books-row-page { color: #15803d; }
.books-row-info p.books-row-page a { color: #16324f; font-weight: 600; margin-left: 4px; }

/* Remove on each book card (owner, 7 November 2026): the red outline used for every Remove, filled on hover. */
.books-buttons button.books-remove { background: #ffffff; color: #b42318; box-shadow: inset 0 0 0 1px #b42318; }
.books-buttons button.books-remove:hover:not(:disabled), .books-buttons button.books-remove:focus-visible { background: #b42318; color: #ffffff; }
.books-row .books-buttons button + button { margin-left: 0; }
@media (max-width: 640px) {
    .books-row .books-buttons { flex-wrap: nowrap; }
    .books-row .books-buttons button { flex: 1 1 0; }
}

/* Button roles (owner, 8 November 2026: one main action per group, others in outline, Remove set apart in red).
   Text stays readable on hover for every role. */
.books-buttons button.books-secondary { background: #ffffff; color: #16324f; box-shadow: inset 0 0 0 2px #16324f; }
.books-buttons button.books-secondary:hover:not(:disabled), .books-buttons button.books-secondary:focus-visible { background: #e5eff9; color: #16324f; }
.books-buttons button.books-danger { background: #ffffff; color: #b42318; box-shadow: inset 0 0 0 2px #b42318; }
.books-buttons button.books-danger:hover:not(:disabled), .books-buttons button.books-danger:focus-visible { background: #b42318; color: #ffffff; }
/* On the details page Remove Book sits on its own at the far end of the row, away from Save and Confirm. */
#books-detail .books-buttons { align-items: center; padding-top: 16px; border-top: 1px solid #cbd5e1; }
#books-detail .books-card .books-buttons button.books-danger { margin-left: auto; }
#books-detail .books-body .sat-suggest { margin: -4px 0 0; }
#books-view .books-panel .sat-suggest { margin: -4px 0 0; }

@media (max-width: 640px) {
    /* Details: one box, not two, so the fields have room; buttons full width and equal, Remove last after a gap. */
    #books-view .status-card:has(#books-page-details:not([hidden])) { padding: 12px; }
    #books-detail .books-card { padding: 16px; gap: 16px; }
    #books-detail .books-buttons { flex-direction: column; align-items: stretch; }
    #books-detail .books-buttons button { width: 100%; }
    #books-detail .books-card .books-buttons button.books-danger { margin: 12px 0 0; }
    .books-nav { display: grid; grid-template-columns: 1fr 1fr; }
    .books-nav button { padding: 12px 8px; }
}
@media (max-width: 640px) {
    /* Your Books: one box, not two, and button text on one line. */
    #books-view .status-card:has(#books-page-list:not([hidden])) { padding: 12px; }
    .books-row .books-buttons button { white-space: nowrap; padding: 12px 10px; }
}

/* Formats: the heading is a label above the white box, like every other section (owner, 8 November 2026). */
.books-formats { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.books-formats > legend { float: left; width: 100%; padding: 0; margin: 0 0 6px; font-size: 14px; font-weight: 600; color: #1f2937; }
.books-formats > legend + * { clear: both; }

/* Paste the Amazon page source (owner, 8 November 2026). */
.books-steps { margin: 0 0 12px; padding-left: 22px; color: #374151; line-height: 1.6; }
.books-source { width: 100%; box-sizing: border-box; min-height: 64px; padding: 12px 14px; border: 2px dashed #94a3b8; border-radius: 8px; background: #ffffff; color: #1f2937; font: inherit; font-size: 15px; resize: none; caret-color: transparent; text-align: center; }
.books-source:focus { outline: 3px solid #93c5fd; outline-offset: 1px; border-color: #2563eb; background: #eff6ff; }
.books-source::placeholder { color: #6b7280; }
.books-source:disabled { background: #f1f5f9; cursor: progress; }
#books-source-panel { margin-bottom: 16px; }

/* Covers from Canva (owner, 8 November 2026). */
#books-canva-panel { margin-top: 16px; }
.books-canva-list { display: grid; gap: 10px; margin-top: 12px; }
.books-canva-row { padding: 12px 14px; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 10px; display: grid; gap: 10px; }
.books-canva-row.is-done { background: #f0fdf4; border-color: #bbf7d0; }
.books-canva-head { display: flex; align-items: center; gap: 10px; font-weight: 600; color: #16324f; }
.books-canva-head input { width: 18px; height: 18px; flex: none; }
.books-canva-choices { display: flex; flex-wrap: wrap; gap: 12px; }
.books-canva-choice { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #4b5563; cursor: pointer; }
.books-canva-choice img { width: 150px; height: 100px; object-fit: contain; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 4px; }
.books-canva-done { color: #15803d; margin: 0; }
.books-canva-picker { display: grid; gap: 10px; padding: 14px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; }
.books-canva-search { display: flex; gap: 8px; }
.books-canva-search input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; }
.books-canva-search button { margin: 0; }
.books-canva-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.books-canva-cell { display: flex; flex-direction: column; gap: 6px; padding: 10px; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px; color: #374151; overflow-wrap: anywhere; }
.books-canva-cell img { width: 100%; height: 110px; object-fit: contain; background: #f8fafc; border-radius: 4px; }
.books-canva-cell button { margin-top: auto; width: 100%; }
@media (max-width: 640px) {
    .books-canva-choice img { width: 120px; height: 80px; }
    .books-canva-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.books-canva-picker { min-width: 0; width: 100%; box-sizing: border-box; overflow: hidden; }
.books-canva-grid > *, .books-canva-cell { min-width: 0; }
.books-canva-search button { flex: none; width: auto; }
#books-detail .books-body { min-width: 0; }
#books-detail .books-body > .books-canva-picker { max-width: 100%; }
@media (max-width: 640px) {
    #books-detail .books-canva-grid { grid-template-columns: minmax(0, 1fr); }
    #books-detail .books-canva-picker { padding: 10px; }
}
.books-canva-picker { grid-template-columns: minmax(0, 1fr); }
.books-canva-search { min-width: 0; }
/* Choose from Canva folder view (owner, 18 November 2026): path bar, folder filter, folder cells. Folder and search
   buttons in outline; Use This Design stays the one solid action on each design. */
.books-canva-path { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; font-size: 14px; color: #374151; }
.books-canva-path .books-canva-here { font-weight: 700; color: #16324f; overflow-wrap: anywhere; }
.books-canva-path .books-canva-sep { color: #94a3b8; }
.books-canva-picker button.books-canva-crumb { margin: 0; padding: 2px 0; background: none; border: none; box-shadow: none; color: #1d4ed8; font: inherit; text-decoration: underline; cursor: pointer; width: auto; }
.books-canva-picker button.books-canva-crumb:hover, .books-canva-picker button.books-canva-crumb:focus-visible { background: none; color: #16324f; }
.books-canva-picker button.books-secondary { background: #ffffff; color: #16324f; box-shadow: inset 0 0 0 2px #16324f; border: none; }
.books-canva-picker button.books-secondary:hover:not(:disabled), .books-canva-picker button.books-secondary:focus-visible { background: #e5eff9; color: #16324f; }
.books-canva-path button.books-secondary { margin: 0; width: auto; padding: 6px 12px; }
.books-canva-picker button.books-primary { justify-self: start; width: auto; margin: 0; }
.books-canva-filter { box-sizing: border-box; width: 100%; max-width: 360px; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; }
.books-canva-folder { background: #fffdf5; }
.books-canva-folder-icon { display: block; height: 110px; border-radius: 4px; background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 48'%3E%3Cpath d='M4 8a4 4 0 0 1 4-4h16l6 6h26a4 4 0 0 1 4 4v26a4 4 0 0 1-4 4H8a4 4 0 0 1-4-4z' fill='%23f2c14e' stroke='%23c99a2e' stroke-width='2'/%3E%3C/svg%3E") center / 64px 48px no-repeat; }
.books-canva-name { font-weight: 600; color: #16324f; }
