/* Trust Law Textbooks — Reader (UI) */
/* ---------- Reset/vars ---------- */
:root{
  --bg:#f6f8fb;
  --panel:#ffffff;
  --ink:#0f172a;
  --muted:#64748b;
  --line:#e2e8f0;
  --brand:#0a4d78;
  --accent:#2563eb;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
html{ -webkit-text-size-adjust:100%; }
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font:16px/1.5 system-ui,-apple-system,Segoe UI,Roboto,Inter,Helvetica,Arial,"Apple Color Emoji","Segoe UI Emoji";
}

/* ---------- Top bar ---------- */
.header{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; gap:.75rem;
  padding:.6rem .9rem;
  background:#0b2a3e; /* deep brand */
  color:#e6f0f7;
  border-bottom:1px solid #062132;
}
.brand{
  display:flex; align-items:center; gap:.6rem; min-width:0;
}
.brand img{
  width:36px; height:36px; /* <- bigger logo */
  display:block;
}
.brand .title{
  font-weight:700; letter-spacing:.2px; white-space:nowrap;
}
.repo-links{ display:flex; gap:.5rem; margin-left:1rem; }
.repo-links a{
  color:#cbe4f8; text-decoration:none; border:1px solid #18415c;
  padding:.25rem .5rem; border-radius:6px; font-size:.85rem;
}
.repo-links a:hover{ background:#0f3751; }

/* Search widget */
.search{
  margin-left:auto; display:flex; align-items:center; gap:.35rem;
}
.search input{
  width:34vw; max-width:520px; min-width:200px;
  padding:.45rem .6rem; border:1px solid #30526a; border-radius:8px;
  background:#0e334b; color:#eaf4fb; outline:none;
}
.search input::placeholder{ color:#a6c1d3; }
.search .nav{
  display:flex; gap:.25rem;
}
.search .nav button{
  border:1px solid #30526a; background:#0e334b; color:#eaf4fb;
  padding:.35rem .5rem; border-radius:6px; cursor:pointer;
}
.search .nav button:disabled{ opacity:.45; cursor:default; }
.search .count{ font-size:.85rem; color:#a6c1d3; margin-left:.25rem; }

/* ---------- Layout ---------- */
.shell{
  display:grid; grid-template-columns: 300px 1fr; gap:1rem;
  padding:1rem;
}
.panel{
  background:var(--panel); border:1px solid var(--line); border-radius:12px;
}

/* Sidebar (repos + library) */
.sidebar{ padding:1rem; }
.sidebar h3{
  margin:.25rem 0 .5rem; font-size:.9rem; color:var(--muted);
  text-transform:uppercase; letter-spacing:.06em;
}
.repos{ display:flex; flex-direction:column; gap:.4rem; margin-bottom:1rem; }
.repos a{
  display:block; padding:.45rem .6rem; border:1px solid var(--line); border-radius:8px;
  background:#fbfdff; color:#0b2a3e; text-decoration:none;
}
.repos a:hover{ background:#f1f7fd; }
.library{ display:flex; flex-direction:column; gap:.45rem; }
.library .item{
  display:block; padding:.5rem .6rem; border:1px solid var(--line); border-radius:8px;
  background:#ffffff; color:#0f172a; text-decoration:none;
}
.library .item:hover{ border-color:#c7d8eb; background:#f8fbff; }

/* Document panel */
.doc{
  padding:1rem 1.25rem; white-space:pre-wrap; word-break:break-word;
  font-family: ui-serif, Georgia, "Times New Roman", Times, serif;
  line-height:1.6; font-size:17px; color:#0f172a;
}
.status{
  padding:.6rem 1rem; font-size:.9rem; color:var(--muted);
  border-top:1px solid var(--line);
}

/* Highlighting */
mark.hl{ background:#fff59d; padding:.05em .1em; border-radius:3px; }

/* Mobile */
@media (max-width:900px){
  .shell{ grid-template-columns:1fr; }
  .search input{ width:50vw; }
}
