* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #f8f7f2; color: #1a1a18; }
.hidden { display: none !important; }
.app { max-width: 1180px; margin: 0 auto; padding: 28px; }
input { border: 1px solid #d9d7cc; border-radius: 10px; background: #fffef9; color: #1a1a18; padding: 11px 13px; font-size: 14px; }
button { border: none; border-radius: 10px; background: #085041; color: #e1f5ee; padding: 10px 14px; font-weight: 600; cursor: pointer; }
a { color: #085041; text-decoration: none; }
.btnSecondary { border: 1px solid #d9d7cc; background: #fffef9; color: #56544f; }

.homeView { min-height: 72vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.logoRow { display: flex; align-items: center; gap: 10px; }
.logoIcon { width: 30px; height: 30px; border: 2px solid #085041; border-radius: 50%; position: relative; }
.logoIcon::after { content: ""; position: absolute; width: 9px; height: 2px; background: #085041; right: -6px; bottom: 1px; transform: rotate(45deg); border-radius: 2px; }
.logoText { font-size: 30px; font-weight: 700; }
.homeTagline { color: #66645d; margin: 10px 0 18px; max-width: 620px; }
.homeSearchForm { width: min(720px, 100%); display: flex; gap: 10px; }
.homeSearchForm input { flex: 1; }
.homeChips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; justify-content: center; }
.homeChip { background: #ecebe3; color: #54524d; border: 1px solid #dfddd2; padding: 7px 11px; font-size: 12px; border-radius: 999px; }

.searchView { max-width: 980px; margin: 0 auto; }
.topbar { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.searchInline { display: flex; gap: 8px; flex: 1; }
.searchInline input { flex: 1; }
.status { min-height: 24px; color: #5f5d57; margin-bottom: 8px; }
.panel { background: #fffef9; border: 1px solid #e2e0d5; border-radius: 12px; padding: 16px; margin-top: 10px; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 9px; }
.chip { border: 1px solid #8ac8b8; background: #edf8f4; color: #085041; border-radius: 999px; padding: 4px 10px; font-size: 12px; }
.results { display: grid; gap: 10px; }
.card { border: 1px solid #e2e0d5; border-radius: 10px; background: white; padding: 12px; }
.cardHead { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.cardTitle { font-weight: 600; }
.meta { margin-top: 6px; font-size: 12px; color: #6a6863; }
.summary { margin: 8px 0 0; font-size: 14px; line-height: 1.45; }

.readerView { max-width: 1180px; margin: 0 auto; }
.readerTop { margin-bottom: 8px; }
.readerShell { display: grid; grid-template-columns: 360px 1fr; gap: 12px; }
.readerLeft { border: 1px solid #e2e0d5; border-radius: 12px; background: #fcfbf6; max-height: 80vh; overflow: auto; padding: 14px; }
.docTitle { font-size: 18px; font-weight: 700; line-height: 1.25; margin-bottom: 8px; }
.docBadges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.docBadges span { font-size: 11px; border-radius: 999px; background: #f2f8f6; color: #085041; border: 1px solid #d5ece5; padding: 3px 8px; }
.relevanceBox { font-size: 12px; color: #44433f; background: #eef6f2; border: 1px solid #d4e9e2; border-radius: 8px; padding: 8px; margin-bottom: 10px; }
.docActions { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.docActions a, .docActions button { font-size: 12px; padding: 8px 10px; border-radius: 8px; }
.docActions a { border: 1px solid #d9d7cc; background: #fffef9; color: #56544f; }
.section { border-top: 1px solid #eceae0; }
.sectionHeader { display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 9px 0; }
.sectionArrow { color: #7a7872; font-size: 12px; transition: transform .15s ease; }
.sectionArrow.open { transform: rotate(90deg); }
.sectionTitle { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: #6d6b65; }
.sectionBody { display: none; padding: 0 0 10px; font-size: 13px; color: #32312d; line-height: 1.45; }
.sectionBody.open { display: block; }

.readerRight { border: 1px solid #e2e0d5; border-radius: 12px; background: white; display: flex; flex-direction: column; min-height: 80vh; }
.readerNav { display: flex; gap: 4px; flex-wrap: wrap; padding: 10px; border-bottom: 1px solid #efede3; }
.navItem { font-size: 11px; border: 1px solid #e1dfd4; background: #faf9f4; color: #6a6861; border-radius: 999px; padding: 5px 9px; cursor: pointer; }
.navItem.active { background: #eaf6f2; color: #085041; border-color: #cde7de; }
.readerSearch { display: flex; align-items: center; gap: 6px; padding: 9px 10px; border-bottom: 1px solid #efede3; }
.readerSearch input { flex: 1; }
.readerSearch span { font-size: 12px; color: #6d6b65; min-width: 56px; text-align: right; }
.readerText { padding: 14px; overflow: auto; line-height: 1.65; font-size: 14px; white-space: normal; position: relative; }
.readerText h3 { font-size: 15px; color: #0e6e5a; margin: 18px 0 6px; }
.readerText p { margin: 0 0 8px; color: #22211e; }
mark { background: #f9ef9f; border-radius: 2px; }
.hl-user { background: #d8f0e8; }

.selectionToolbar { position: fixed; background: #1f1f1d; color: #f3f3ee; border-radius: 8px; padding: 6px; display: flex; gap: 6px; z-index: 9999; box-shadow: 0 8px 20px rgba(0,0,0,.24); }
.selectionToolbar button { background: #2f2f2c; color: #f3f3ee; font-size: 12px; padding: 6px 8px; border-radius: 6px; }

@media (max-width: 980px) {
  .homeSearchForm { flex-direction: column; }
  .readerShell { grid-template-columns: 1fr; }
}
