/* Main website pages share the same content edges as their navigation. */
:root { --main-page-width:1200px; --main-page-gutter:32px; }
.shelf-page,.shelf-header { --sf-accent:#0e6b5c; --sf-selected:#e7f1ed; }
[data-theme=dark] .shelf-page,[data-theme=dark] .shelf-header { --sf-accent:#76cbb7; --sf-selected:#203b34; }
.shelf-header .main-search {
  display:flex; align-items:center; gap:9px; flex:0 1 352px; min-width:0;
  min-height:42px; margin:0 0 0 auto; padding:0 8px 0 13px;
  border:1px solid var(--sf-line); border-radius:10px;
  background:var(--sf-muted-bg); color:var(--sf-muted);
}
.shelf-header .main-search:focus-within { border-color:var(--sf-accent); background:var(--sf-bg); box-shadow:0 0 0 3px var(--sf-selected); }
.shelf-header .main-search:focus-within > span { color:var(--sf-accent); }
.shelf-header .main-search input {
  flex:1; width:0; min-width:0; min-height:38px; margin:0; padding:6px 0;
  border:0; border-radius:0; outline:none; box-shadow:none;
  background:transparent; color:var(--sf-text); font:16px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
/* The rounded container owns focus; suppress the store's generic input outline. */
.shelf-header .main-search input:is(:focus,:focus-visible) { border:0; outline:none; box-shadow:none; }
.shelf-header .main-search input { caret-color:var(--sf-accent); }
.shelf-header .main-search input::placeholder { color:var(--sf-muted); }
.shelf-header .main-search input::-webkit-search-cancel-button { display:none; }
.shelf-header .main-search > span { display:flex; flex:none; }
.shelf-header .main-search button {
  display:flex; align-items:center; justify-content:center; flex:none;
  width:28px; min-width:28px; height:32px; padding:5px;
  border:0; border-radius:6px; background:transparent; color:inherit;
}
.shelf-header .main-search button:hover { background:var(--sf-selected); }
.shelf-header .main-search svg { display:block; }
.bn-actions { margin-bottom:28px; }
/* Notes are rows of books rather than a second card grid. */
#shelfNoteGroups { display:flex; flex-direction:column; gap:0; border-top:1px solid var(--sf-line); }
.shelf-notes h1 { margin-bottom:28px; }
.shelf-note-group { align-items:center; gap:18px; min-height:106px; padding:24px 4px; border:0; border-bottom:1px solid var(--sf-line); border-radius:0; }
.shelf-note-group > .shelf-svg { display:flex; align-items:center; justify-content:center; flex:none; width:48px; height:56px; border-radius:6px; background:var(--sf-selected); color:var(--sf-accent); }
.shelf-note-group > .shelf-svg svg { width:26px; height:26px; }
.shelf-note-group strong { font-size:18px; font-weight:500; }
.shelf-note-group small { margin-top:7px; font-size:14px; }
.shelf-note-group > span:last-child { padding:0 10px; font-size:26px; color:var(--sf-muted); }
.shelf-note-group:hover strong { color:var(--sf-accent); }

@media screen and (min-width:761px) {
  :root:not(.qa-native-ios) .shelf-header.topbar {
    height:76px; min-height:76px; padding:0 max(var(--main-page-gutter),calc((100% - var(--main-page-width))/2));
    gap:32px; background:var(--sf-bg);
  }
  :root:not(.qa-native-ios) .shelf-brand { flex:0 0 auto; gap:44px; }
  :root:not(.qa-native-ios) .shelf-brand > a { font-size:24px; font-weight:700; letter-spacing:-.8px; }
  :root:not(.qa-native-ios) .shelf-desktop-nav { height:76px; gap:30px; font-size:15px; }
  :root:not(.qa-native-ios) .shelf-desktop-nav a { color:var(--sf-muted); border-bottom-width:3px; }
  :root:not(.qa-native-ios) .shelf-desktop-nav a[aria-current] { color:var(--sf-accent); border-color:var(--sf-accent); }
  :root:not(.qa-native-ios) :is(.shelf-layout,.shelf-notes,body[data-store-page="store"] #content,body[data-store-page="store"] .section-tabs,body[data-store-page="store"] #storeMessage,.book-notes-view .ac-layout) {
    box-sizing:border-box; width:min(var(--main-page-width),calc(100% - var(--main-page-gutter)*2)); max-width:var(--main-page-width); margin-inline:auto;
  }
  :root:not(.qa-native-ios) .shelf-layout { grid-template-columns:172px minmax(0,1fr); gap:44px; min-height:calc(100dvh - 76px); padding-top:36px; }
  :root:not(.qa-native-ios) .shelf-sidebar { position:sticky; top:108px; align-self:start; max-height:calc(100dvh - 132px); overflow:auto; padding:0; border:0; }
  :root:not(.qa-native-ios) .shelf-main { width:100%; max-width:none; margin:0; padding:0 0 64px; }
  :root:not(.qa-native-ios) .shelf-toolbar { min-height:44px; margin-bottom:28px; }
  :root:not(.qa-native-ios) .shelf-path { font-size:24px; font-weight:600; line-height:1.4; }
  :root:not(.qa-native-ios) .shelf-sort select { font-size:14px; min-height:40px; }
  :root:not(.qa-native-ios) .shelf-cover-card .shelf-book-info strong { font-size:16px; line-height:1.65; font-weight:500; }
  :root:not(.qa-native-ios) .shelf-covers { grid-template-columns:repeat(4,minmax(0,1fr)); gap:32px 28px; }
  :root:not(.qa-native-ios) .shelf-notes { padding:36px 0 64px; }
  :root:not(.qa-native-ios) body[data-store-page="store"] .section-tabs { padding:30px 0 32px; border:0; }
  :root:not(.qa-native-ios) body[data-store-page="store"] .section-tabs > div { display:inline-flex; gap:3px; padding:4px; border-radius:11px; background:var(--soft); }
  :root:not(.qa-native-ios) body[data-store-page="store"] .section-tabs a { justify-content:center; min-height:36px; padding:7px 23px; border:0; border-radius:8px; }
  :root:not(.qa-native-ios) body[data-store-page="store"] .section-tabs a[aria-current] { background:var(--bg); color:var(--text); box-shadow:0 1px 4px #16282012; }
  :root:not(.qa-native-ios) body[data-store-page="store"] #content { padding:0 0 64px; }
  :root:not(.qa-native-ios) body[data-store-page="store"] .catalog-layout { grid-template-columns:172px minmax(0,1fr); gap:44px; }
  :root:not(.qa-native-ios) body[data-store-page="store"] .sidebar { top:108px; padding:0; max-height:calc(100dvh - 132px); }
  :root:not(.qa-native-ios) body[data-store-page="store"] .toolbar { min-height:44px; margin-bottom:28px; }
  :root:not(.qa-native-ios) body[data-store-page="store"] .toolbar h1 { font-size:24px; line-height:1.4; }
  :root:not(.qa-native-ios) body[data-store-page="store"] .tools select { font-size:14px; min-height:40px; }
  :root:not(.qa-native-ios) body[data-store-page="store"] .book-grid { grid-template-columns:repeat(4,minmax(0,1fr)); gap:32px 28px; }
  :root:not(.qa-native-ios) body[data-store-page="store"] .book-card .book-caption strong { font-size:16px; line-height:1.65; }
  :root:not(.qa-native-ios) .book-notes-view .ac-layout { padding:0; }
}
@media screen and (min-width:761px) and (max-width:1050px) {
  :root:not(.qa-native-ios) .shelf-header.topbar { gap:24px; }
  :root:not(.qa-native-ios) .shelf-brand { gap:24px; }
  :root:not(.qa-native-ios) .shelf-desktop-nav { gap:22px; }
  :root:not(.qa-native-ios) .shelf-layout,
  :root:not(.qa-native-ios) body[data-store-page="store"] .catalog-layout { grid-template-columns:150px minmax(0,1fr); gap:30px; }
  :root:not(.qa-native-ios) .shelf-covers,
  :root:not(.qa-native-ios) body[data-store-page="store"] .book-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:30px 24px; }
}
@media screen and (min-width:901px) {
  :root:not(.qa-native-ios) .book-notes-view .nt-layout { gap:44px; }
  :root:not(.qa-native-ios) .book-notes-view .nt-side { flex-basis:172px; top:108px; max-height:calc(100dvh - 132px); }
  :root:not(.qa-native-ios) .book-notes-view.bn-book-selected .nt-head { margin:0; }
  :root:not(.qa-native-ios) .book-notes-view.bn-book-selected #ntH { position:absolute; width:1px; height:1px; margin:0; padding:0; border:0; clip-path:inset(50%); overflow:hidden; }
}
@media screen and (max-width:760px) {
  .shelf-header.topbar { gap:10px; }
  .shelf-header .shelf-brand { flex:0 0 auto; }
  .shelf-header .main-search { flex:1; margin:0; min-height:40px; padding-left:8px; padding-right:4px; gap:6px; }
  .shelf-header .main-search input { min-height:36px; }
  .shelf-header .main-search > span svg { width:18px; height:18px; }
  .shelf-header .main-search button { width:44px; min-width:44px; height:40px; }
  :root:not(.qa-native-ios) .notes-page .shelf-header.topbar { padding:env(safe-area-inset-top) 16px 0; }
  .shelf-note-group { min-height:98px; gap:14px; padding-inline:0; }
  .shelf-note-group strong { font-size:17px; }
  .shelf-note-group > .shelf-svg { width:42px; height:50px; }
  .shelf-note-group > span:last-child { padding-right:2px; }
  .book-notes-view .ac-layout { padding-inline:16px; }
  .book-notes-view .nt-head h1 { font-size:22px; margin-top:0; }
  .bn-actions { margin-bottom:24px; }
  .shelf-mobile-nav a[aria-current=page] { color:#0e6b5c; }
  .shelf-mobile-nav a[aria-current=page] > span:first-child { background:#e7f1ed; }
  [data-theme=dark] .shelf-mobile-nav a[aria-current=page] { color:#76cbb7; }
  [data-theme=dark] .shelf-mobile-nav a[aria-current=page] > span:first-child { background:#203b34; }
}
.qa-native-ios.qa-compact-navigation .shelf-header .shelf-brand { flex:0 0 auto; }
.qa-native-ios.qa-compact-navigation .shelf-header .main-search { flex:1; margin-inline:8px 4px; }
@media screen and (max-width:900px) {
  .book-notes-view .nt-side { padding-top:max(16px,env(safe-area-inset-top)); padding-bottom:calc(40px + env(safe-area-inset-bottom)); }
}
@media print {
  body[data-main-page] { padding-bottom:0; }
  .shelf-mobile-nav,.main-search { display:none!important; }
}
