/* Canoa Tecnologia — fontes da marca (OFL, self-hosted) */
@font-face {
  font-family: 'Space Grotesk';
  src: url('fonts/SpaceGrotesk.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/JetBrainsMono.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

/* ============================================================
   Calibre-Web — "ui-refresh" theme layer
   Loaded after style.css; overrides Bootstrap 3 defaults with a
   token-based design system. Keep selectors scoped; never edit
   bootstrap.min.css or style.css directly.
   ============================================================ */

:root {
  /* palette — Canoa Tecnologia (livro de marca: terracota/oliva/creme/areia) */
  --cw-bg: #f1ecdd;
  --cw-surface: #fffdf7;
  --cw-text: #252d1c;
  --cw-text-2: #565c48;
  --cw-text-3: #6e7462;
  --cw-line: #ddd6c2;
  --cw-line-strong: #cfc9b4;
  --cw-accent: #e08a3c;
  --cw-accent-hover: #c77428;
  --cw-accent-soft: #fbefdf;
  --cw-accent-ring: rgba(224, 138, 60, 0.22);
  /* texto/ícone laranja sobre creme (#fffdf7): #e08a3c dá ~2.5:1 e falha
     contraste; #a85d1a ≈ 4.9:1 (auditoria UX/UI 2026-11-19, P0-02) */
  --cw-accent-text: #a85d1a;
  --cw-accent-text-hover: #8a4a13;
  --cw-danger: #bc4b38;
  --cw-danger-soft: #faeae5;
  --cw-info: #5a6b3c;
  --cw-info-soft: #eef0e5;

  /* shape & depth */
  --cw-radius: 8px;
  --cw-radius-s: 6px;
  --cw-shadow: 0 1px 2px rgba(37, 45, 28, 0.08), 0 2px 6px rgba(37, 45, 28, 0.07);
  --cw-shadow-l: 0 10px 28px rgba(16, 24, 40, 0.14);
  --cw-font: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --cw-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- base ---------- */

body {
  font-family: var(--cw-font);
  background: var(--cw-bg);
  color: var(--cw-text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cw-accent-text); }
a:hover, a:focus { color: var(--cw-accent-text-hover); }

h1, h2, h3 { color: var(--cw-text); }

/* content column: readable width, centered */
.container-fluid {
  max-width: 1320px;
  margin: 0 auto;
}

/* ---------- navbar ---------- */

.navbar.navbar-default.navbar-static-top {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--cw-surface);
  border-bottom: 1px solid var(--cw-line);
  box-shadow: none;
  min-height: 52px;
}

.navbar-default .navbar-brand {
  font-family: var(--cw-font);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--cw-accent-text);
  padding: 14px 15px;
}
.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus { color: var(--cw-accent-text-hover); }

.navbar-default .navbar-nav > li > a {
  color: var(--cw-text-2);
  font-size: 13px;
  padding-top: 16px;
  padding-bottom: 14px;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
  color: var(--cw-text);
  background: transparent;
}
.navbar-default .navbar-nav > li > a .glyphicon { opacity: 0.75; }

#advanced_search { color: var(--cw-text-2); }
#advanced_search:hover { color: var(--cw-accent-text); }

/* search box */
.navbar-form { padding-top: 9px; margin-top: 0; }
.navbar-form .form-control {
  border: 1px solid var(--cw-line-strong);
  border-radius: var(--cw-radius-s) 0 0 var(--cw-radius-s);
  box-shadow: none;
  height: 34px;
  font-size: 13px;
  width: 240px;
}
.navbar-form .form-control:focus {
  border-color: var(--cw-accent);
  outline: 0;
  box-shadow: 0 0 0 3px var(--cw-accent-ring);
}
.navbar-form .input-group-btn .btn {
  height: 34px;
  border: 1px solid var(--cw-line-strong);
  border-left: 0;
  border-radius: 0 var(--cw-radius-s) var(--cw-radius-s) 0;
  color: var(--cw-text-2);
  font-size: 13px;
}
.navbar-form .input-group-btn .btn:hover {
  background: var(--cw-accent-soft);
  color: var(--cw-accent-hover);
}

/* upload button in header */
.navbar .btn-file {
  border: 1px solid var(--cw-line-strong);
  border-radius: var(--cw-radius-s);
  color: var(--cw-text-2);
  font-size: 13px;
}
.navbar .btn-file:hover {
  background: var(--cw-accent-soft);
  color: var(--cw-accent-hover);
  border-color: var(--cw-accent);
}

.navbar-toggle { border: 1px solid var(--cw-line-strong); }

/* ---------- sidebar ---------- */

nav.navigation {
  background: var(--cw-surface);
  border: 1px solid var(--cw-line);
  border-radius: var(--cw-radius);
  padding: 8px 0;
  margin-top: 16px;
  box-shadow: var(--cw-shadow);
}

nav.navigation #scnd-nav .nav-head {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cw-text-3);
  padding: 14px 16px 5px;
}
nav.navigation #scnd-nav .nav-head:first-child { padding-top: 6px; }

nav.navigation #scnd-nav li > a {
  display: block;
  padding: 7px 12px;
  margin: 1px 8px;
  border-radius: var(--cw-radius-s);
  color: var(--cw-text-2);
  font-size: 13.5px;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}
nav.navigation #scnd-nav li > a .glyphicon {
  color: var(--cw-text-3);
  width: 18px;
}
nav.navigation #scnd-nav li > a:hover {
  background: #e9e3d0;
  color: var(--cw-text);
}
nav.navigation #scnd-nav li > a:hover .glyphicon { color: var(--cw-text-2); }

/* current page — server sets .active; main.js also sets .current */
nav.navigation #scnd-nav li.active > a,
nav.navigation #scnd-nav li.current > a {
  background: var(--cw-accent-soft);
  color: var(--cw-accent-hover);
  font-weight: 600;
}
nav.navigation #scnd-nav li.active > a .glyphicon,
nav.navigation #scnd-nav li.current > a .glyphicon { color: var(--cw-accent-text); }

nav.navigation #scnd-nav li.create-shelf > a { color: var(--cw-text-3); font-style: normal; }
nav.navigation #scnd-nav li.create-shelf > a:hover { color: var(--cw-accent-text); }
nav.navigation #scnd-nav .badge {
  background: #e6e0cd;
  color: var(--cw-text-2);
  font-weight: 500;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
}

/* ---------- buttons ---------- */

.btn {
  border-radius: var(--cw-radius-s);
  font-family: var(--cw-font);
  transition: all 0.12s ease;
}

.btn-primary {
  background: var(--cw-accent);
  border-color: var(--cw-accent);
  /* branco sobre #e08a3c ≈ 2.7:1 falha contraste; texto oliva escuro
     sobre o laranja da marca ≈ 5:1 (auditoria UX/UI 2026-11-19, P0-02) */
  color: var(--cw-text);
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active,
.btn-primary.active, .open > .dropdown-toggle.btn-primary {
  background: var(--cw-accent-hover);
  border-color: var(--cw-accent-hover);
  color: var(--cw-text);
}
.btn-primary:focus { outline: 0; box-shadow: 0 0 0 3px var(--cw-accent-ring); }

.btn-default {
  background: var(--cw-surface);
  border-color: var(--cw-line-strong);
  color: var(--cw-text);
}
.btn-default:hover, .btn-default:focus, .btn-default:active {
  background: #f2eee3;
  border-color: var(--cw-text-3);
  color: var(--cw-text);
}

.btn-link { color: var(--cw-accent-text); }

/* ---------- sort/filter chip row on list pages ---------- */

.filterheader { margin: 4px 0 14px; }
.filterheader a.btn,
.filterheader a.btn.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 32px;
  padding: 0 6px;
  margin-right: 4px;
  background: var(--cw-surface);
  border: 1px solid var(--cw-line-strong);
  border-radius: var(--cw-radius-s);
  color: var(--cw-text-2);
  box-shadow: none;
}
.filterheader a.btn:hover {
  border-color: var(--cw-accent);
  color: var(--cw-accent-text);
  background: var(--cw-surface);
}
.filterheader a.btn.active,
.filterheader a.btn.btn-primary.active {
  background: var(--cw-accent);
  border-color: var(--cw-accent);
  color: var(--cw-text);
}
.filterheader a.btn.active .glyphicon { color: var(--cw-text); }

/* ---------- book grid cards ---------- */

.book .cover .img,
.book .cover img {
  border-radius: var(--cw-radius);
  box-shadow: var(--cw-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  background: var(--cw-surface);
}

.book .cover img {
  aspect-ratio: 2 / 3;
  object-fit: cover;
}
.book .cover a { text-decoration: none; }
.book .cover:hover .img,
.book .cover:hover img {
  transform: translateY(-2px);
  box-shadow: var(--cw-shadow-l);
}

.book .meta { margin-top: 8px; }
.book .meta p.title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--cw-text);
  line-height: 1.35;
  margin: 0 0 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}
.book .meta p.title a { color: var(--cw-text); }
.book .meta p.title a:hover { color: var(--cw-accent); }

.book .meta p.author { margin: 0; font-size: 12.5px; line-height: 1.4; }
.book .meta p.author a.author-name { color: var(--cw-text-2); }
.book .meta p.author a.author-name:hover { color: var(--cw-accent); }
.book .meta p.series { font-size: 12px; color: var(--cw-text-3); margin: 2px 0 0; }

.book .meta .rating .glyphicon { font-size: 11px; }
.book .meta .rating .glyphicon-star.good { color: #e0a12c; }
.book .meta .rating .glyphicon-star-empty { color: var(--cw-line-strong); }

/* read badge on covers */
.book .cover .badge.read {
  background: var(--cw-accent);
  border-radius: 999px;
  box-shadow: var(--cw-shadow);
  top: 8px;
  right: 8px;
  padding: 4px;
}

h2.random-books, h2.discover, .discover h2,
.page-heading {
  font-size: 15px;
  font-weight: 600;
  color: var(--cw-text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--cw-line);
  padding-bottom: 8px;
  margin-bottom: 14px;
}

h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 18px 0 12px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 2000;
  background: var(--cw-text);
  color: var(--cw-surface);
  padding: 10px 18px;
  border-radius: 0 0 var(--cw-radius-s) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- pagination ---------- */

.pagination { margin: 22px 0; }
.pagination > li > a,
.pagination > li > span {
  color: var(--cw-text-2);
  border: 1px solid var(--cw-line-strong);
  padding: 6px 13px;
  margin: 0 2px;
  border-radius: var(--cw-radius-s) !important;
}
.pagination > li > a:hover {
  background: var(--cw-accent-soft);
  border-color: var(--cw-accent);
  color: var(--cw-accent-hover);
}
.pagination > .active > a,
.pagination > .active > a:hover {
  background: var(--cw-accent);
  border-color: var(--cw-accent);
  color: var(--cw-text);
}

/* ---------- forms ---------- */

.form-control {
  border-color: var(--cw-line-strong);
  border-radius: var(--cw-radius-s);
  box-shadow: none;
  color: var(--cw-text);
  font-size: 14px;
}
.form-control:focus {
  border-color: var(--cw-accent);
  box-shadow: 0 0 0 3px var(--cw-accent-ring);
}
label { font-weight: 600; color: var(--cw-text); font-size: 13.5px; }

/* bootstrap-select: quiet include, tinted exclude */
.bootstrap-select > .btn {
  border-radius: var(--cw-radius-s);
  border-color: var(--cw-line-strong);
}
.bootstrap-select > .btn.btn-primary,
#search .bootstrap-select > .btn[data-style="btn-primary"],
#search .bootstrap-select .btn-primary {
  background: var(--cw-accent-soft);
  border-color: rgba(14, 124, 102, 0.35);
  color: var(--cw-accent-text);
}
#search .bootstrap-select .btn-danger {
  background: var(--cw-danger-soft);
  border-color: rgba(179, 54, 42, 0.3);
  color: var(--cw-danger);
}
#search .bootstrap-select .btn-default { background: var(--cw-surface); }

/* ---------- advanced search ---------- */

#search .sf-section {
  background: var(--cw-surface);
  border: 1px solid var(--cw-line);
  border-radius: var(--cw-radius);
  box-shadow: var(--cw-shadow);
  padding: 18px 20px 6px;
  margin-bottom: 16px;
}
#search .sf-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cw-text-3);
  margin: 0 0 14px;
}
#search .sf-actions {
  position: sticky;
  top: 66px;
  z-index: 500;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid var(--cw-line);
  border-radius: var(--cw-radius);
  box-shadow: var(--cw-shadow);
  padding: 10px 14px;
  margin-bottom: 16px;
}

/* ---------- book detail ---------- */

.single .cover img#detailcover {
  border-radius: var(--cw-radius);
  box-shadow: var(--cw-shadow-l);
}

.book-meta h2#title, .book-meta h1#title {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 4px 0 6px;
}
.book-meta p.author {
  font-size: 15px;
  margin-bottom: 10px;
}
.book-meta p.author a { font-weight: 600; }

.book-meta .languages .label,
.book-meta .label-default {
  background: #e6e0cd;
  color: var(--cw-text-2);
  font-weight: 500;
  font-size: 11.5px;
  border-radius: var(--cw-radius-s);
  padding: 3px 8px;
}

/* metadata chips: tags, identifiers */
.book-meta .tags a.btn,
.book-meta .tags a.btn-info,
.book-meta .identifiers a.btn,
.book-meta .identifiers a.btn-success {
  background: #e6e0cd;
  border: 0;
  border-radius: 999px;
  color: var(--cw-text-2);
  font-size: 11.5px;
  padding: 3px 11px;
  box-shadow: none;
}
.book-meta .tags a.btn:hover,
.book-meta .identifiers a.btn:hover {
  background: var(--cw-accent-soft);
  color: var(--cw-accent-hover);
}

.book-meta .publishing-date p,
.book-meta .publishers p,
.book-meta .real_custom_columns {
  color: var(--cw-text-2);
  font-size: 13.5px;
}

.book-meta .comments {
  color: var(--cw-text);
  line-height: 1.62;
  font-size: 14.5px;
  max-width: 68ch;
  border-left: 3px solid var(--cw-line);
  padding-left: 16px;
}
.book-meta .comments h3#decription {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cw-text-3);
}

/* read/archive switches */
.custom_columns label.block-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin-right: 22px;
  font-weight: 500;
  color: var(--cw-text-2);
  font-size: 13.5px;
}
.custom_columns label.block-label input[type="checkbox"] {
  /* visualmente oculto, mas presente p/ teclado e leitor de tela
     (display:none removia da árvore acessível — auditoria P0-02) */
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.custom_columns label.block-label input[type="checkbox"]:focus-visible + span::before {
  outline: 2px solid var(--cw-accent-text);
  outline-offset: 2px;
}
.custom_columns label.block-label input[type="checkbox"] + span {
  position: relative;
  padding-left: 45px;
}
.custom_columns label.block-label input[type="checkbox"] + span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #c9c3ad;
  transition: background 0.15s ease;
}
.custom_columns label.block-label input[type="checkbox"] + span::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.custom_columns label.block-label input[type="checkbox"]:checked + span::before {
  background: var(--cw-accent);
}
.custom_columns label.block-label input[type="checkbox"]:checked + span::after {
  left: 22px;
}

/* actions area */
.book-meta .btn-toolbar.book-actions {
  margin: 18px 0 6px;
  padding-top: 16px;
  border-top: 1px solid var(--cw-line);
}
.more-stuff { margin-top: 10px; }
.more-stuff #back,
.more-stuff .btn-default#back {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--cw-text-3);
  text-decoration: underline;
  padding-left: 8px;
}
.more-stuff #back:hover { color: var(--cw-accent); }

/* ---------- tables (admin, book list) ---------- */

.table > thead > tr > th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cw-text-3);
  font-weight: 600;
  border-bottom: 1px solid var(--cw-line-strong);
}
.table > tbody > tr > td { color: var(--cw-text); }

/* ---------- stats KPIs ---------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin: 16px 0 28px;
}
.kpi {
  background: var(--cw-surface);
  border: 1px solid var(--cw-line);
  border-radius: var(--cw-radius);
  box-shadow: var(--cw-shadow);
  padding: 18px 20px;
}
.kpi .kpi-value {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--cw-accent);
}
.kpi .kpi-label {
  font-size: 13px;
  color: var(--cw-text-2);
  margin-top: 4px;
}

/* ---------- admin mode (body.admin-mode set by main.js) ---------- */

body.admin-mode .col-sm-2 { display: none; }
body.admin-mode .col-sm-10 {
  width: 100%;
  flex: 0 0 100%;
  max-width: 100%;
}
body.admin-mode h2 {
  font-size: 17px;
  font-weight: 700;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--cw-line);
  margin-bottom: 14px;
}

/* ---------- alerts & modals ---------- */

.alert { border-radius: var(--cw-radius); border-left-width: 3px; }
.modal-content { border-radius: var(--cw-radius); box-shadow: var(--cw-shadow-l); }
.modal-header { border-bottom: 1px solid var(--cw-line); }

/* dropdown menus */
.dropdown-menu {
  border-radius: var(--cw-radius-s);
  border-color: var(--cw-line);
  box-shadow: var(--cw-shadow-l);
  padding: 5px;
}
.dropdown-menu > li > a { border-radius: 4px; padding: 7px 12px; }
.dropdown-menu > li > a:hover { background: var(--cw-accent-soft); color: var(--cw-accent-hover); }

/* ---------- accessibility: visible keyboard focus ---------- */

a:focus-visible, .btn:focus-visible,
.navbar-default .navbar-nav > li > a:focus-visible,
.navbar-form .form-control:focus-visible {
  outline: 2px solid var(--cw-accent);
  outline-offset: 1px;
}

/* ---------- mobile touch targets ---------- */

@media (max-width: 767px) {
  .navbar-toggle {
    width: 44px;
    height: 44px;
    margin-top: 6px;
    border-radius: var(--cw-radius-s);
  }
  /* input acompanha os 40px do botão — antes ficava em 34px e o botão
     estourava 6px abaixo (relatado pelo João, 19/11) */
  .navbar-form .form-control { width: 100%; min-height: 40px; }
  .navbar-form .input-group-btn .btn,
  #query_submit { min-height: 40px; min-width: 56px; }
  nav.navigation #scnd-nav li > a {
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 15px;
  }
  .filterheader a.btn { width: 42px; height: 42px; }
  .pagination > li > a, .pagination > li > span { padding: 10px 16px; }
  .book-meta h2#title, .book-meta h1#title { font-size: 22px; }
  .book .meta p.title { font-size: 13px; }
}

/* ---------- sidebar nav when relocated into the mobile hamburger menu ---------- */

.navbar-collapse nav.navigation #scnd-nav .nav-head { font-family: var(--cw-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cw-text-3);
  padding: 14px 15px 4px;
}
.navbar-collapse #scnd-nav li > a {
  display: block;
  padding: 9px 15px;
  color: var(--cw-text-2);
  font-size: 14px;
  text-decoration: none;
  min-height: 44px;
}
.navbar-collapse #scnd-nav li > a .glyphicon {
  color: var(--cw-text-3);
  width: 20px;
}
.navbar-collapse #scnd-nav li > a:hover {
  background: var(--cw-accent-soft);
  color: var(--cw-accent-hover);
}
.navbar-collapse #scnd-nav li.active > a,
.navbar-collapse #scnd-nav li.current > a {
  background: var(--cw-accent-soft);
  color: var(--cw-accent-hover);
  font-weight: 600;
}
.navbar-collapse #scnd-nav .badge {
  background: #e6e0cd;
  color: var(--cw-text-2);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
}

/* hide the empty sidebar card after the nav list moves away on small screens */
nav.navigation:not(:has(*)) { display: none; }

/* ---------- responsive pass: kill legacy nested scroll, page scrolls naturally ---------- */

body > div.container-fluid > div.row-fluid > div.col-sm-10,
body > div.container-fluid > div.row-fluid > div.col-sm-2 {
  max-height: none !important;
  overflow-y: visible !important;
}

nav.navigation {
  position: sticky;
  top: 76px;
}

/* sort/filter chips: horizontal swipe instead of wrap/overflow */
.filterheader {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filterheader::-webkit-scrollbar { display: none; }

/* ---------- header breathing room on phones ---------- */

@media (max-width: 767px) {
  .navbar-header { padding: 0 10px; }
  .navbar-header .navbar-brand { padding-left: 4px; }
  .navbar-form {
    padding: 0 16px 10px;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
  }
  .navbar-form .form-control { width: 100% !important; }
  .navbar-form .input-group { max-width: 100%; table-layout: fixed; }
}

/* ---------- book detail on phones: centered cover, roomy actions ---------- */

@media (max-width: 559px) {
  .single .col-xs-5 {
    width: 58%;
    margin: 0 auto 6px;
    float: none;
  }
  .single .cover { text-align: center; }
  .book-meta { padding: 0 6px; }
  .book-meta .book-actions .btn,
  .more-stuff .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .book-meta .comments { padding-left: 10px; }
}

/* keep the admin-mode content column full width from breaking sticky */
body.admin-mode nav.navigation { display: none; }

/* ---------- Canoa: mono labels + brand symbol ---------- */

nav.navigation #scnd-nav .nav-head,
.navbar-collapse #scnd-nav .nav-head {
  font-family: var(--cw-mono);
  letter-spacing: 0.08em;
  font-size: 10.5px;
}
h2.random-books, .discover h2, .kpi .kpi-label, .sf-section-title {
  font-family: var(--cw-mono);
  letter-spacing: 0.06em;
}
.kpi .kpi-value { font-family: var(--cw-font); }

.navbar-default .navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.navbar-default .navbar-brand img.brand-symbol {
  height: 22px;
  width: auto;
}

/* ---------- polish 2: labelled sort chips ---------- */

.filterheader { white-space: nowrap; }
.filterheader a.btn,
.filterheader a.btn.btn-primary {
  width: auto;
  gap: 6px;
  padding: 0 11px;
  font-size: 12.5px;
  font-weight: 500;
}
.filterheader a.btn .glyphicon { font-size: 11px; color: var(--cw-text-3); }
.filterheader a.btn:hover .glyphicon { color: var(--cw-accent); }
.filterheader a.btn .chip-label { line-height: 1; }

/* ---------- polish 2: admin dashboard as cards ---------- */

body.admin-mode .admin-dash {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
  padding: 0;
}
body.admin-mode .admin-dash::before,
body.admin-mode .admin-dash::after { display: none; }
body.admin-mode .admin-dash > .row {
  margin: 0;
  background: var(--cw-surface);
  border: 1px solid var(--cw-line);
  border-radius: var(--cw-radius);
  box-shadow: var(--cw-shadow);
  padding: 16px 20px 18px;
  display: flow-root;
  min-width: 0;
}
body.admin-mode .admin-dash > .row > .col { min-width: 0; }
body.admin-mode .admin-dash > .row h2 { margin-top: 0; }
body.admin-mode .admin-dash > .row > .col > .col-xs-12,
body.admin-mode .admin-dash > .row > .col > .col-sm-6 {
  float: none;
  width: 100%;
  padding: 0;
  margin-bottom: 14px;
}
body.admin-mode .admin-dash > .row .row { margin: 0; padding: 5px 0; border-bottom: 1px dashed var(--cw-line); }
body.admin-mode .admin-dash > .row .row:last-child { border-bottom: 0; }
body.admin-mode .admin-dash > .row .row > [class*="col-"]:first-child { padding-left: 0; color: var(--cw-text-2); }
body.admin-mode .admin-dash > .row .row > [class*="col-"]:last-child { word-break: break-word; }
body.admin-mode .admin-dash > .row .btn { margin: 0 6px 6px 0; }
body.admin-mode .admin-dash .table { margin-bottom: 12px; }
body.admin-mode .admin-dash > .row > .col { overflow-x: auto; }
body.admin-mode .admin-ops .form-group { margin-bottom: 0; }

@media (min-width: 1200px) {
  body.admin-mode .admin-dash { grid-template-columns: 1fr 1fr; }
  /* users table and version info span the full width */
  body.admin-mode .admin-dash > .row:first-child,
  body.admin-mode .admin-dash > .row:last-child { grid-column: 1 / -1; }
  body.admin-mode .admin-dash > .row .row > .col-sm-3 { width: 50%; }
}

/* ---------- polish 2: advanced search in two columns on wide screens ---------- */

.sf-wrap { max-width: 1180px; }
@media (min-width: 1200px) {
  #search {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
    align-items: start;
  }
  #search > .sf-actions,
  #search > #adv_submit { grid-column: 1 / -1; }
  #search > #adv_submit { justify-self: start; }
  #search > .sf-section { margin-bottom: 16px; }
}

/* ---------- layout-wide: use the screen on large monitors ---------- */

/* wider shell; text-heavy pages keep their own reading widths */
.container-fluid { max-width: 1880px; }
@media (min-width: 1200px) {
  body > div.container-fluid { padding-left: 28px; padding-right: 28px; }
}

/* sidebar: fixed width instead of 16.6%, so it never gets squeezed */
@media (min-width: 768px) {
  body > div.container-fluid > div.row-fluid {
    display: flex;
    align-items: flex-start;
    gap: 24px;
  }
  body > div.container-fluid > div.row-fluid::before,
  body > div.container-fluid > div.row-fluid::after { display: none; }
  body > div.container-fluid > div.row-fluid > div.col-sm-2 {
    flex: 0 0 236px;
    width: 236px;
    padding: 0;
    float: none;
  }
  body > div.container-fluid > div.row-fluid > div.col-sm-10 {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    padding: 0;
    float: none;
  }
}
@media (min-width: 768px) and (max-width: 991px) {
  body > div.container-fluid > div.row-fluid { gap: 16px; }
  body > div.container-fluid > div.row-fluid > div.col-sm-2 { flex-basis: 212px; width: 212px; }
}

/* sidebar items: one line each, icon aligned, long shelf names ellipsized */
nav.navigation #scnd-nav li > a {
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
nav.navigation #scnd-nav li > a .glyphicon { flex: 0 0 18px; margin-right: 8px; }
nav.navigation #scnd-nav li > a .badge { margin-left: auto; }
/* "create shelf": quiet link in the theme, not the legacy teal pill */
nav.navigation #scnd-nav li.create-shelf { margin: 10px 0 4px; text-align: left; font-size: 13px; }
nav.navigation #scnd-nav li.create-shelf > a {
  background: transparent;
  color: var(--cw-accent);
  border: 1px dashed var(--cw-line-strong);
  padding: 7px 12px;
}
nav.navigation #scnd-nav li.create-shelf > a::before { content: "+"; font-weight: 700; margin-right: 8px; }
nav.navigation #scnd-nav li.create-shelf > a:hover { background: var(--cw-accent-soft); border-color: var(--cw-accent); }

/* book grids: as many columns as fit instead of a fixed 6 */
.row.display-flex:has(> .book) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  column-gap: 20px;
  margin-left: 0;
  margin-right: 0;
}
.row.display-flex:has(> .book)::before,
.row.display-flex:has(> .book)::after { display: none; }
.row.display-flex:has(> .book) > .book {
  width: auto;
  float: none;
  padding: 0;
  max-width: 180px;
}
@media (max-width: 559px) {
  .row.display-flex:has(> .book) {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    column-gap: 14px;
  }
}

/* book details modal: roomier on big screens; long file-like titles wrap */
@media (min-width: 1200px) {
  #bookDetailsModal .modal-lg { width: 1080px; }
}
.book-meta h2#title,
.book-meta h1#title,
.modal .book-meta h2 { overflow-wrap: anywhere; }

/* layout-wide fix: Isotope (main.js, fitRows) absolutely positions .book by
   each cover's own width, overriding the CSS grid. Let the grid win. */
.row.display-flex:has(> .book) { height: auto !important; position: static !important; }
.row.display-flex:has(> .book) > .book {
  position: static !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
}


/* ---------- ux-fase3: login card, drawer mobile, ordenação ---------- */
.well.login-card {
  float: none;
  margin: 3rem auto;
  max-width: 460px;
  background: var(--cw-surface);
  border: 1px solid var(--cw-line);
  box-shadow: var(--cw-shadow);
}
.login-card .toggle-pass {
  position: absolute;
  right: 6px;
  top: 28px;
  padding: 4px 8px;
  z-index: 3;
}
.login-card .form-group { position: relative; }

@media (max-width: 767px) {
  /* menu mobile com scroll próprio em vez de empurrar o conteúdo
     (auditoria P1-07: menu aberto media ~1.000px de altura) */
  .navbar-collapse.in {
    max-height: calc(100vh - 58px);
    overflow-y: auto;
    box-shadow: var(--cw-shadow);
  }
}

.sort-label {
  display: inline-block;
  margin-right: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--cw-text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
>> .login-card .form-group .form-control { padding-right: 44px; }

/* ux-fase3: filtros raros colapsáveis + voltar */
details.sf-details {
  background: var(--cw-surface);
  border: 1px solid var(--cw-line);
  border-radius: var(--cw-radius);
  box-shadow: var(--cw-shadow);
  padding: 10px 14px;
  margin-bottom: 16px;
}
details.sf-details > summary {
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--cw-text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  list-style-position: inside;
}
details.sf-details[open] > summary { margin-bottom: 12px; }
.voltar-resultados { padding-left: 0; color: var(--cw-text-2); }
