/* Warm, deliberately quiet Explore / Inspect surface. All assets are local. */
:root {
  color-scheme: light;
  --page: #f5f4ef;
  --surface: #fffefa;
  --list: #fbfaf6;
  --ink: #242e2c;
  --muted: #5e6a65;
  --faint: #e1e4dd;
  --teal: #24665e;
  --teal-dark: #174e47;
  --teal-soft: #e9f1ed;
  --caution: #76551e;
  --caution-bg: #f7f0df;
  --danger: #913b32;
  font-family: "Segoe UI", "Noto Sans", Arial, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 280px; background: var(--page); }
body { margin: 0; color: var(--ink); font-size: 15px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select, summary, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, select, summary { cursor: pointer; }
button, input, select { min-height: 44px; }
button { background: none; border: 0; }
a { color: var(--teal-dark); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: pretty; }
p, li, h1, h2, h3, a, button, .post-text { overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 30; padding: 12px 16px; background: var(--surface); border: 1px solid var(--teal); border-radius: 6px; }
.skip-link:focus { top: 12px; }
.library-page { height: 100vh; height: 100dvh; overflow: hidden; }
.library-app { height: 100%; display: flex; flex-direction: column; }
.app-header { flex: 0 0 auto; min-height: 100px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 32px 18px; border-bottom: 1px solid var(--faint); background: var(--surface); }
.eyebrow { color: var(--muted); font-size: 12px; letter-spacing: .045em; margin-bottom: 1px; }
.brand h1 { font-size: 27px; line-height: 1.25; font-weight: 650; letter-spacing: -.03em; }
.header-end { display: flex; align-items: center; gap: 22px; flex: 0 0 auto; }
.header-end form { margin: 0; }
.private-label { color: var(--muted); font-size: 12px; }
.quiet-button { min-height: 44px; padding: 9px 12px; border: 1px solid transparent; border-radius: 6px; color: var(--muted); }
.quiet-button:hover { background: var(--teal-soft); color: var(--teal-dark); }
.logout-button { border-color: var(--faint); }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.explore { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--list); border-right: 1px solid var(--faint); }
.explore-controls { flex: 0 0 auto; padding: 21px 27px 0; }
.pilot-scope { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.topic-tabs { display: flex; gap: 5px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; padding: 4px 2px 10px; margin: -4px -2px 12px; min-width: 0; }
.topic-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 13px; border: 1px solid var(--faint); border-radius: 6px; background: var(--surface); white-space: nowrap; }
.topic-tab:hover { border-color: #a5b9b0; }
.topic-tab[aria-pressed="true"] { color: var(--teal-dark); border-color: #a7c4b9; background: var(--teal-soft); font-weight: 600; }
.topic-count { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); }
.search-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, 35%); gap: 10px; align-items: end; }
.search-field { min-width: 0; position: relative; }
.search-field input { appearance: none; display: block; width: 100%; min-width: 0; padding: 11px 43px 11px 37px; border: 1px solid #b8c3bb; border-radius: 6px; background: var(--surface); line-height: 1.5; }
.search-field input::placeholder { color: #727b76; opacity: 1; font-size: 14px; }
.search-field input::-webkit-search-cancel-button, .search-field input::-webkit-search-decoration { appearance: none; }
.search-symbol { position: absolute; left: 14px; top: 17px; width: 13px; height: 13px; border: 1.5px solid var(--muted); border-radius: 50%; pointer-events: none; }
.search-symbol::after { content: ""; position: absolute; width: 6px; height: 1.5px; background: var(--muted); transform: rotate(45deg); top: 10px; left: 9px; }
.clear-search { position: absolute; right: 2px; top: 2px; min-width: 44px; min-height: 44px; border-radius: 5px; font-size: 24px; line-height: 1; color: var(--muted); }
.clear-search:hover { color: var(--teal-dark); background: var(--teal-soft); }
.type-field { min-width: 0; }
.type-field label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.type-field select { width: 100%; min-width: 0; max-width: 100%; min-height: 47px; border: 1px solid #b8c3bb; border-radius: 6px; padding: 8px 24px 8px 10px; background: var(--surface); font-size: 13px; text-overflow: ellipsis; }
.search-hint { color: var(--muted); font-size: 11px; margin: 8px 0 7px; }
.results-heading { min-height: 48px; display: flex; align-items: center; gap: 12px; justify-content: space-between; border-bottom: 1px solid var(--faint); }
.result-count { font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.text-button { color: var(--teal); padding: 8px 0 8px 8px; font-size: 12px; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.results-area { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.results { margin: 0; padding: 0 15px; list-style: none; overflow: auto; overscroll-behavior-y: contain; scrollbar-width: thin; flex: 1; min-height: 0; }
.results > li { margin: 0; padding: 0; }
.material-row { width: 100%; display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 16px; text-align: left; padding: 18px 12px; border-bottom: 1px solid var(--faint); border-radius: 0; }
.material-row:hover { background: #f0f2eb; }
.material-row[aria-current="true"] { background: var(--teal-soft); }
.material-row:focus-visible { outline-offset: -3px; border-radius: 5px; position: relative; z-index: 1; }
.row-media { width: 58px; height: 64px; align-self: start; display: flex; align-items: center; justify-content: center; border: 1px solid #dfe3d9; border-radius: 5px; background: #edf0e8; overflow: hidden; margin-top: 3px; }
.row-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-label { font-size: 10px; line-height: 1.3; text-align: center; color: var(--muted); padding: 5px; }
.row-media.image-unavailable::after { content: "Нет превью"; color: var(--muted); font-size: 10px; text-align: center; padding: 5px; }
.row-content { display: block; min-width: 0; }
.row-kicker { display: block; color: var(--teal); font-size: 11px; line-height: 1.4; margin-bottom: 4px; }
.row-title { display: block; font-size: 16px; font-weight: 650; letter-spacing: -.012em; line-height: 1.35; }
.row-summary { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 13px; line-height: 1.5; color: #4e5953; margin-top: 6px; }
.row-source { display: block; color: var(--muted); font-size: 11px; margin-top: 8px; }
.row-review { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.row-files { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.row-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.row-flags:empty { display: none; }
.badge { display: inline-block; padding: 3px 7px; border-radius: 4px; background: #edf0e9; color: #4e5e53; font-size: 11px; line-height: 1.5; font-weight: 400; }
.badge-caution { background: var(--caution-bg); color: var(--caution); }
.catalog-footnote { flex: 0 0 auto; padding: 11px 27px 13px; border-top: 1px solid var(--faint); color: var(--muted); font-size: 11px; }
.state-message { padding: 40px 28px; max-width: 470px; margin: 0 auto; color: var(--muted); font-size: 14px; }
.state-message p { margin-bottom: 16px; }
.secondary-button { border: 1px solid #b5c5bb; border-radius: 6px; padding: 9px 14px; color: var(--teal-dark); background: var(--surface); }
.secondary-button:hover { background: var(--teal-soft); }
.detail-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface); }
.detail-empty { margin: auto; padding: 48px; max-width: 440px; }
.empty-eyebrow { color: var(--teal); font-size: 12px; margin-bottom: 10px; }
.detail-empty h2 { font-size: 24px; font-weight: 600; letter-spacing: -.025em; margin-bottom: 13px; }
.detail-empty > p:last-child { color: var(--muted); font-size: 14px; line-height: 1.7; }
.detail-toolbar { min-height: 65px; flex: 0 0 auto; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--faint); padding: 9px 24px; }
.detail-close { padding-left: 5px; color: var(--teal-dark); font-size: 13px; }
.detail-close span { margin-right: 5px; font-size: 19px; }
.detail-label { margin-left: auto; color: var(--muted); font-size: 12px; }
.escape-hint { font-size: 10px; color: var(--muted); border: 1px solid var(--faint); border-radius: 4px; padding: 2px 5px; }
.detail-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior-y: contain; scrollbar-width: thin; }
.material-detail { max-width: 780px; padding: 29px 36px 52px; margin: 0 auto; font-size: 14px; line-height: 1.7; }
.detail-kicker { color: var(--teal); font-size: 12px; margin-bottom: 9px; }
.material-detail h2 { font-size: 26px; font-weight: 650; letter-spacing: -.027em; line-height: 1.3; }
.detail-source { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 15px 0 13px; }
.detail-source p + p { margin-top: 2px; }
.source-note { font-size: 11px; margin-top: 5px !important; }
.detail-tags { display: flex; gap: 5px; flex-wrap: wrap; margin: 14px 0 20px; }
.detail-tags:empty { display: none; }
.detail-section { margin-top: 27px; }
.detail-section h3 { font-size: 14px; font-weight: 650; margin-bottom: 8px; line-height: 1.5; }
.detail-section p + p { margin-top: 9px; }
.overview-note { color: var(--muted); font-size: 11px; margin-bottom: 8px; }
.review-section { padding: 17px 18px; border: 1px solid #dce4da; border-radius: 6px; background: #f4f6ef; }
.review-emphasis { font-weight: 600; color: #354c3e; }
.muted { color: var(--muted); font-size: 12px; }
.caution-section { padding: 17px 18px; background: var(--caution-bg); color: var(--caution); border-radius: 6px; }
.contested-note { color: var(--caution); margin-bottom: 9px; }
.caveat-list { padding-left: 19px; margin: 0; }
.caveat-list li + li { margin-top: 8px; }
.original-post { border-top: 1px solid var(--faint); border-bottom: 1px solid var(--faint); margin-top: 29px; padding: 4px 0; }
.original-post summary { min-height: 52px; padding: 13px 2px; color: var(--teal-dark); font-size: 14px; font-weight: 600; }
.original-hint { margin: 4px 0 15px; }
.post-text { white-space: pre-wrap; font-size: 13px; line-height: 1.8; padding-bottom: 18px; }
.attachment-list { list-style: none; padding: 0; margin: 0; }
.attachment { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--faint); }
.attachment:first-child { padding-top: 5px; }
.attachment-info { flex: 1 1 170px; min-width: 0; }
.attachment-name { font-size: 13px; font-weight: 600; }
.attachment-info .muted { margin-top: 3px; font-size: 11px; }
.attachment-preview { max-width: 100%; width: 110px; height: 85px; border-radius: 4px; object-fit: contain; background: var(--page); border: 1px solid var(--faint); }
.file-download { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 10px; border: 1px solid #b5c5bb; border-radius: 5px; font-size: 12px; text-decoration: none; }
.file-download:hover { background: var(--teal-soft); }
.link-list { padding: 0; list-style: none; margin: 8px 0 0; }
.link-list li { border-bottom: 1px solid var(--faint); }
.external-link { display: flex; align-items: center; min-height: 44px; padding: 9px 0; font-size: 13px; word-break: break-word; }
.related-list { display: flex; flex-wrap: wrap; gap: 6px; }
.related-button { text-align: left; padding: 9px 11px; min-height: 44px; border: 1px solid var(--faint); border-radius: 5px; color: var(--teal-dark); font-size: 12px; }
.related-button:hover { background: var(--teal-soft); }
.noscript-message { position: fixed; left: 16px; right: 16px; bottom: 20px; z-index: 40; padding: 20px; background: var(--caution-bg); color: var(--caution); border: 1px solid #c9b98d; border-radius: 6px; }

/* Login uses the same private-library vocabulary, without remote fonts. */
.auth-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 28px 20px; background: var(--page); }
.auth-card { width: 100%; max-width: 420px; padding: 37px 34px 29px; background: var(--surface); border: 1px solid var(--faint); border-radius: 10px; box-shadow: 0 8px 30px #253c2f08; }
.auth-title { font-size: 28px; line-height: 1.25; font-weight: 650; letter-spacing: -.03em; margin: 7px 0 13px; }
.auth-description { color: var(--muted); font-size: 14px; line-height: 1.65; margin-bottom: 25px; }
.auth-field { display: block; margin: 18px 0; }
.auth-field label, label.auth-field { font-size: 13px; font-weight: 600; }
.auth-field input, .auth-card input[type="password"], .auth-card input[type="text"] { width: 100%; margin-top: 7px; min-height: 48px; border: 1px solid #b8c3bb; border-radius: 6px; padding: 10px 12px; background: var(--surface); }
.auth-button { min-height: 48px; width: 100%; margin-top: 6px; padding: 11px 16px; background: var(--teal); border: 1px solid var(--teal); border-radius: 6px; font-weight: 600; color: white; }
.auth-button:hover { background: var(--teal-dark); }
.auth-error { color: var(--danger); background: #faeee8; font-size: 13px; padding: 12px 14px; margin: 16px 0; border-radius: 6px; }
.auth-footnote { color: var(--muted); font-size: 11px; line-height: 1.65; margin-top: 24px; }

@media (min-width: 1500px) {
  .workspace { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .explore-controls { padding-left: 36px; padding-right: 36px; }
  .results { padding-left: 24px; padding-right: 24px; }
  .material-detail { padding-top: 36px; padding-left: 44px; padding-right: 44px; }
}
@media (max-width: 1100px) and (min-width: 900px) {
  .explore-controls { padding-left: 20px; padding-right: 20px; }
  .results { padding-left: 8px; padding-right: 8px; }
  .material-detail { padding-left: 25px; padding-right: 25px; }
  .material-row { gap: 12px; }
  .detail-toolbar { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 899px) {
  .library-page { height: auto; min-height: 100vh; min-height: 100dvh; overflow: auto; }
  .library-app { height: auto; min-height: 100vh; min-height: 100dvh; }
  .app-header { padding: 18px 20px 17px; min-height: 92px; gap: 12px; }
  .brand h1 { font-size: 25px; }
  .header-end { gap: 0; }
  .private-label { display: none; }
  .workspace { display: block; flex: 1; min-height: 0; }
  .explore { border: 0; min-height: calc(100dvh - 92px); }
  .explore-controls { padding: 18px 20px 0; }
  .pilot-scope { font-size: 11px; margin-bottom: 15px; }
  .topic-tabs { margin-bottom: 12px; }
  .search-form { grid-template-columns: minmax(0, 1fr); gap: 11px; }
  .search-field input { font-size: 16px; min-height: 48px; }
  .type-field { display: flex; align-items: center; gap: 12px; }
  .type-field label { margin: 0; font-size: 12px; }
  .type-field select { flex: 1; font-size: 14px; min-height: 44px; padding-right: 26px; }
  .search-hint { margin-top: 9px; }
  .results-area { display: block; flex: 1; }
  .results { overflow: visible; padding: 0 8px; }
  .results-heading { min-height: 51px; }
  .material-row { padding: 18px 12px; gap: 13px; }
  .row-title { font-size: 16px; }
  .row-source { font-size: 11px; }
  .row-summary { font-size: 13px; }
  .catalog-footnote { padding: 15px 20px 19px; }
  .detail-pane { display: none; }
  .detail-open .detail-pane { display: flex; position: fixed; inset: 0; z-index: 20; width: 100%; height: 100vh; height: 100dvh; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .mobile-detail-open { overflow: hidden; }
  .detail-toolbar { min-height: 64px; padding: 8px 20px; }
  .detail-close { font-size: 14px; }
  .escape-hint { display: none; }
  .material-detail { padding: 26px 23px 44px; font-size: 15px; }
  .material-detail h2 { font-size: 25px; }
  .detail-section h3 { font-size: 15px; }
  .post-text { font-size: 14px; }
  .detail-pane .state-message { padding-top: 40px; }
  .state-message { padding: 34px 22px; }
}
@media (max-width: 359px) {
  .app-header { padding-left: 15px; padding-right: 15px; }
  .explore-controls { padding-left: 15px; padding-right: 15px; }
  .material-row { grid-template-columns: 45px minmax(0, 1fr); gap: 10px; }
  .row-media { width: 45px; height: 55px; }
  .material-detail { padding-left: 18px; padding-right: 18px; }
  .auth-card { padding-left: 23px; padding-right: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
