/* Shared visual system. Loaded after legacy layout styles to preserve workflow hooks. */
:root {
  --ui-bg: #f8f9f7; --ui-surface: #fff; --ui-text: #242724;
  --ui-muted: #697069; --ui-border: #e4e7e2; --ui-soft: #f0f2ee;
  --ui-shadow: 0 2px 4px #20282003, 0 8px 24px #20282005;
  --auth-accent: #292f2a; --auth-accent-hover: #414a42;
  --auth-border: var(--ui-border); --auth-bg: var(--ui-bg);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--ui-bg); color: var(--ui-text); font: 14px/1.55 system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; letter-spacing: .005em; }
button, input, select, textarea, table { font: inherit; }
a { color: inherit; }
h1, h2, h3 { color: var(--ui-text); line-height: 1.25; letter-spacing: -.035em; }
h1 { font-size: clamp(26px, 3vw, 38px); font-weight: 600; }
h2 { font-size: 20px; font-weight: 600; }
p { overflow-wrap: anywhere; }
hr { border: 0; border-top: 1px solid var(--ui-border); }
button, summary, [role="button"] { cursor: pointer; }
a, button, summary, input, textarea, select { transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease; }
:where(a, button, summary, input, select, textarea):focus-visible { outline: 2px solid #617965; outline-offset: 3px; }
button:disabled, input:disabled { cursor: not-allowed; opacity: .5; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]), textarea, select { border: 1px solid var(--ui-border); border-radius: 10px; background: #fff; color: var(--ui-text); padding: 10px 12px; max-width: 100%; box-shadow: 0 1px 2px #20282004; }
input:hover, textarea:hover, select:hover { border-color: #b8c1b7; }
input:focus-visible, textarea:focus-visible, select:focus-visible { border-color: #617965; box-shadow: 0 0 0 3px #61796515; }
.ui-brand { display: inline-flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 650; letter-spacing: -.7px; text-decoration: none !important; width: max-content; }
.ui-brand-mark { display: grid; place-items: center; width: 30px; height: 32px; border-radius: 9px; background: #29362e; color: #fff; font: italic 25px Georgia, serif; }
.top-view { padding: 0 32px 12px; background: #f8f9f7f5; border-bottom: 1px solid var(--ui-border); backdrop-filter: blur(16px); }
.header { min-height: 84px; height: auto; gap: 20px; grid-template-columns: auto minmax(0, 1fr) auto; max-width: 1440px; margin: auto; }
.header > div { min-width: 0; }
.dock-panel { gap: 4px; }
.dock-item { min-height: 36px; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 10px; }
.dock-label { position: static; visibility: visible; opacity: 1; font-size: 12px; }
.dock-item svg { width: 17px; height: 17px; stroke-width: 1.5; }
.dock-item:hover, .dock-item:focus-visible { transform: none; border-radius: 10px; background: var(--ui-soft); text-decoration: none; }
.dock-panel > .glyph-item { padding: 9px 12px; border-radius: 10px; font-size: 12px; }
.dock-panel > .glyph-item:hover { background: var(--ui-soft); text-decoration: none; }
.dock-pop { background: #fff; border-color: var(--ui-border); border-radius: 14px; min-width: 190px; padding: 6px; box-shadow: 0 12px 40px #20282018; text-align: left; }
.dock-pop a, .dock-pop form { padding: 9px; border-radius: 8px; gap: 9px; }
.dock-pop svg { padding: 0; width: 17px; height: 17px; }
.dock-pop a:hover, .dock-pop form:hover { background: var(--ui-soft); text-decoration: none; }
.dock-pop__link { text-align: left; }
.ui-button, .sign-up-button, .sign-in-button, .subscribe-button, .acct-manage__btn, .auth-btn-primary, .library-modal__button--primary { display: inline-flex; align-items: center; justify-content: center; gap: 12px; background: #292f2a; color: white; border: 1px solid #292f2a; border-radius: 10px; padding: 10px 16px; font-weight: 550; text-decoration: none; box-shadow: 0 2px 3px #20282008; }
.ui-button:hover, .sign-up-button:hover, .sign-in-button:hover, .subscribe-button:hover, .acct-manage__btn:hover, .auth-btn-primary:hover { background: #414a42; color: white; border-color: #414a42; transform: none; text-decoration: none; }
.sign-up-button, .acct-manage__btn--secondary { background: #fff; color: var(--ui-text); border-color: var(--ui-border); }
.acct-manage__btn--danger { background: #ad3027; border-color: #ad3027; }
.acct-manage__btn--danger:hover { background: #88221d; border-color: #88221d; }
.library-page-header > span:first-of-type { font-style: normal; font-size: 18px; font-weight: 600; }
.library-interactive-root { margin: 0; padding: 24px 32px; }
.cnt-library { padding: 0; background: transparent; border-radius: 14px; }
.bookcases-summary { background: transparent; border: 0; padding: 14px 0 0; color: var(--ui-muted); font-size: 12px; font-weight: 500; }
.cnt-inbox { border: 1px solid var(--ui-border); background: var(--ui-soft); padding: 8px; border-radius: 12px; box-shadow: none; }
.cnt-inbox--collapsed { border: 0; background: transparent; padding: 0; }
.cnt-inbox-name, .bookcase-name, .bookshelf-name { padding: 12px 10px; font-size: 12px; }
.drag-bookcase, .bookcase-row { background: white; border: 1px solid var(--ui-border); border-radius: 14px; margin: 0 0 16px; padding: 8px; box-shadow: var(--ui-shadow); }
.drag-bookshelf, .bookshelf-row { background: #f7f8f6; margin: 4px 0; border-radius: 10px; box-shadow: none; padding: 5px; }
.site-card, .drag-site, .edit-site { border: 1px solid var(--ui-border); border-radius: 10px; box-shadow: 0 2px 4px #20282004; margin: 5px; }
.site-card:hover, .drag-site:hover, .edit-site:hover { border-color: #aab8aa; box-shadow: 0 4px 12px #20282012; }
.tabs-list { border: 1px solid var(--ui-border); border-radius: 12px; background: var(--ui-soft); padding: 4px; gap: 4px; box-shadow: none; }
.tab-trigger { padding: 9px 15px; color: var(--ui-muted); border: 1px solid transparent; border-radius: 9px; background: transparent; font-weight: 500; box-shadow: none; }
.tab-trigger--active, .tab-trigger--sharedlib.tab-trigger--active { background: white; color: var(--ui-text); border-color: var(--ui-border); box-shadow: 0 1px 3px #20282009; }
.tab-trigger:hover:not(.tab-trigger--edit-mode) { transform: none; background: #fff; }
.tab-border--publib { border-bottom: 2px solid #718b73; }
.edit-page-background { background: #f5f6f2; }
.library-empty-state, .ui-empty { border: 1px solid var(--ui-border); border-radius: 16px; padding: 40px 24px; background: #fff; text-align: center; color: var(--ui-muted); }
.ui-empty h2 { font-size: 18px; }
.ui-empty-icon { font-size: 36px; color: #778c78; }
.library-modal { min-width: 0; width: 440px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 40px); overflow: auto; background: white; border: 1px solid var(--ui-border); border-radius: 18px; padding: 28px; color: var(--ui-text); box-shadow: 0 24px 80px #16201830; }
.library-modal--libraries { width: 800px; min-width: 0; max-width: calc(100vw - 32px); }
.library-modal::backdrop { background: #18211b55; opacity: 1; backdrop-filter: blur(4px); }
.library-modal__title { font-size: 20px; margin-bottom: 24px; }
.library-modal__button { min-height: 38px; border: 1px solid var(--ui-border); border-radius: 9px; padding: 8px 14px; }
.library-modal__button:hover { transform: none; box-shadow: 0 2px 6px #20282012; }
.library-modal__button--danger { color: #ad3027; background: #fff5f3; border-color: #edccc7; }
.edit-libraries__table td { background: #fff; }
.edit-libraries__table th { background: var(--ui-soft); }
.search-bar { width: min(100%, 540px); margin: auto; }
.search-bar input[type="search"] { min-height: 42px; padding-left: 38px; border-radius: 12px; }
.ui-search-page, .ui-discover { max-width: 1200px; margin: auto; padding: 20px 0 48px; }
.search-results.ui-search-page { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; }
.ui-search-page .search-column-left, .ui-search-page .search-column-right { width: auto; min-width: 0; padding: 0; float: none; }
.ui-search-page .search-column-right { align-self: start; background: #fff; border: 1px solid var(--ui-border); border-radius: 16px; padding: 24px; margin-top: 28px; }
.ui-search-page .search-column-right h2 { font-size: 15px; }
.ui-search-page .search-column-right p, .ui-lead { color: var(--ui-muted); }
.ui-eyebrow { font-size: 12px; color: var(--ui-muted); margin: 0 0 12px; }
.ui-page-intro { padding: 32px 0 24px; }
.ui-page-intro h1, .ui-search-page h1 { margin: 0 0 14px; }
.ui-lead { font-size: 15px; margin-bottom: 32px; }
.ui-category-nav { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 28px; border-bottom: 1px solid var(--ui-border); }
.ui-category-nav a { padding: 8px 14px; border: 1px solid var(--ui-border); background: white; border-radius: 999px; font-size: 12px; }
.ui-category-nav a:hover, .ui-category-nav a[aria-current] { background: #29362e; color: white; text-decoration: none; }
.ui-collection-section { margin: 36px 0; }
.ui-collection-section > p { color: var(--ui-muted); }
.ui-library-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.search-result-library-card { width: auto; min-width: 0; border: 1px solid var(--ui-border); border-radius: 14px; background: white; padding: 24px; margin: 0 0 12px; box-shadow: var(--ui-shadow); }
.search-result-library-card:hover { border-color: #b4c0b2; }
.search-result-library-card .library-page-actions { justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
.search-results-library-name { font-size: 16px; font-weight: 600; }
.search-result-library-card .library-page-description { color: var(--ui-muted); line-height: 1.6; }
.acct-manage-shell { max-width: 1180px; padding: 36px 24px; }
.acct-manage { grid-template-columns: 220px minmax(0, 1fr); gap: 40px; }
.acct-manage__nav { top: 120px; padding: 8px; }
.acct-manage__nav-title { font-size: 12px; font-weight: 500; color: var(--ui-muted); margin: 8px 12px 18px; letter-spacing: 0; }
.acct-manage__nav-link { padding: 10px 12px; margin: 3px 0; border-radius: 10px; font-size: 13px; }
.acct-manage__nav-link:hover { background: #ecefe9; }
.acct-manage__nav-link.is-active { background: #e7ebe4; color: #29362e; font-weight: 600; }
.acct-manage__content { background: #fff; padding: 32px; border: 1px solid var(--ui-border); border-radius: 16px; box-shadow: var(--ui-shadow); min-width: 0; }
.acct-manage__heading { font-size: 24px; font-weight: 600; margin-bottom: 28px; }
.acct-manage__form label { font-weight: 500; font-size: 13px; }
.auth-card { max-width: 410px; padding: 32px; border-radius: 18px; box-shadow: var(--ui-shadow); }
.auth-heading { font-size: 24px; letter-spacing: -.035em; }
.auth-footer, .footer { color: var(--ui-muted); font-size: 12px; text-align: center; padding: 28px 16px; margin-top: 32px; border-top: 1px solid var(--ui-border); }
.container { max-width: 1120px; margin: auto; padding: 32px 24px; }
.site-header { background: #fff; color: var(--ui-text); border-bottom: 1px solid var(--ui-border); }
.site-header a, .inline-logout button { color: var(--ui-text); }
.messages { max-width: 1100px; margin: 16px auto; list-style: none; padding: 0 24px; }
.messages li { padding: 12px 16px; border: 1px solid var(--ui-border); background: white; border-radius: 10px; }
.messages .success { background: #f5f5f6; color: #56575b; }
.messages .error { background: #fff1ef; color: #9a3025; }
@keyframes ui-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.library-modal[open], .dock-details[open] .dock-pop { animation: ui-enter 180ms ease-out; }
.auth-card, .acct-manage__content, .ui-page-intro { animation: ui-enter 260ms ease-out; }
@media (max-width: 900px) {
 .top-view { padding: 0 16px 12px; }
 .header { gap: 12px; grid-template-columns: 1fr auto; padding: 16px 0; }
 .header > div:not(.acct-manage__header-spacer) { grid-column: 1 / -1; grid-row: 2; }
 .header .dock-panel { grid-column: 2; grid-row: 1; }
 .dock-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
 .library-interactive-root { padding: 20px 16px; }
 .search-results.ui-search-page { grid-template-columns: minmax(0, 1fr); gap: 20px; }
 .acct-manage { grid-template-columns: 170px minmax(0, 1fr); gap: 20px; }
 .acct-manage__content { padding: 24px; }
 .bookcase-name, .bookshelf-name { float: none; width: auto; }
 .cnt-bookshelf, .sites { display: block; width: 100%; }
}
@media (max-width: 600px) {
 .ui-brand { font-size: 16px; gap: 6px; }
 .dock-panel { gap: 0; flex-wrap: wrap; justify-content: flex-end; }
 .dock-panel > .glyph-item { padding: 8px; }
 .sign-in-button, .sign-up-button { padding: 7px 8px; font-size: 11px; }
 .acct-manage-shell { padding: 12px; }
 .acct-manage { grid-template-columns: minmax(0, 1fr); gap: 16px; }
 .acct-manage__nav { position: static; }
 .acct-manage__nav-list { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 8px; }
 .acct-manage__nav-link { white-space: nowrap; }
 .acct-manage__content { padding: 22px 18px; }
 .acct-manage__name-row { grid-template-columns: 1fr; }
 .library-modal { padding: 22px 18px; }
 .library-modal__actions { display: flex; flex-wrap: wrap; justify-content: space-between; }
 .library-modal__actions-left, .library-modal__actions-right { flex-wrap: wrap; }
 .tabs-carousel-root { width: 100%; }
 .auth-card { padding: 28px 22px; }
}
@media (prefers-reduced-motion: reduce) {
 *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
/* Public entry point and shared result surfaces. */
.public-header { max-width: 1240px; width: 100%; margin: auto; padding: 28px 32px; }
.ui-landing { max-width: 1120px; margin: auto; padding: 80px 32px 40px; }
.ui-landing h1 { font-size: clamp(36px, 5.5vw, 64px); line-height: 1.1; margin: 20px 0; font-weight: 550; letter-spacing: -.055em; }
.ui-landing > .ui-lead { max-width: 480px; line-height: 1.8; }
.ui-landing-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; font-size: 13px; }
.ui-feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 72px; }
.ui-feature-grid section { padding: 28px; background: white; border: 1px solid var(--ui-border); border-radius: 16px; box-shadow: var(--ui-shadow); }
.ui-feature-grid h2 { font-size: 18px; margin-top: 24px; }
.ui-feature-grid p { color: var(--ui-muted); font-size: 13px; }
.ui-auth-brand { margin: 0 auto 28px; display: flex; }
.search-results-container { background: transparent; background-image: none; border: 0; box-shadow: none; padding: 0; }
.search-results-container:hover { box-shadow: none; }
.search-results-container .library-page-actions { float: none; display: flex; justify-content: flex-start; margin-top: 12px; }
@media (max-width: 600px) { .ui-landing { padding: 40px 24px; } .ui-feature-grid { grid-template-columns: 1fr; margin-top: 40px; } }
/* Motion stays small and avoids moving a draggable target under the pointer. */
.site-card:hover, .drag-site:hover, .search-bar:hover { transform: none; }
.share-modal__platform:hover { transform: translateY(-2px); }
.dock-details[open] .dock-pop { animation: none; }
@media (prefers-reduced-motion: no-preference) {
 .ui-button:active, .auth-btn:active, .acct-manage__btn:active, .library-modal__button:active { transform: scale(.98); }
}
.auth-btn--primary { border-radius: 10px; }
.search-result-library-card .glyph-item { position: relative; }
.site-card { cursor: pointer; }
.add-site-button, .add-bookshelf-button, .add-bookcase-button, .edit-libraries-button { background: #fff; border: 1px solid var(--ui-border); border-radius: 9px; padding: 9px 12px; box-shadow: 0 1px 3px #20282005; font-size: 12px; }
.add-site-button:hover, .add-bookshelf-button:hover, .add-bookcase-button:hover { background: var(--ui-soft); transform: none; }
.edit-bookcase-button, .edit-bookshelf-button, .edit-site-button { background: #fff; border: 1px solid var(--ui-border); border-radius: 7px; }
@media (hover: none) {
 .edit-bookcase-button:not([x-cloak]), .edit-bookshelf-button:not([x-cloak]), .edit-site-button:not([x-cloak]) { display: inline-flex !important; }
}
.search-bar { border: 0; border-radius: 12px; box-shadow: none; }
#search-query { padding: 10px 42px 10px 38px; height: 44px; }
#search-query:focus-visible { outline: 2px solid #617965; outline-offset: 3px; }
.search-bar button { width: 32px; right: 6px; border-radius: 8px; }
.search-bar button:hover { background: var(--ui-soft); }
.search-bar svg { color: #748073; }
