/* ============================================================
   layout.css — chrome: header, sidebar, panels
   ============================================================ */

#app { display: flex; flex-direction: column; height: 100vh; }

/* ---------- Header ---------- */
header {
  display: flex; align-items: center;
  padding: 0 28px; height: 64px; flex-shrink: 0;
  /* Solid, not blurred: the header sits beside the page, not over it,
     and a blur behind it was redrawn on every keystroke and scroll
     (typing lagged on a laptop, 20 October 2026). */
  background: rgba(13,15,23,0.96);
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 40;
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.brand-mark img {
  width: 34px; height: 34px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 6px rgba(201,169,98,.28));
}
.brand-name {
  font-family: var(--serif); font-size: 21px; font-weight: 600;
  letter-spacing: 0.06em; color: var(--text);
}
.brand-name span { color: var(--gold); font-weight: 500; }
.brand-tag {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.34em;
  text-transform: uppercase; color: var(--text-3); margin-top: 1px;
}

/* ---------- Global search ---------- */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 9px 16px;
  transition: border-color .2s, box-shadow .2s, background .2s;
  max-width: 560px;
}
.search-bar:focus-within {
  border-color: var(--border-gold);
  background: var(--surface-2);
  box-shadow: var(--glow-gold);
}
.search-bar svg { width: 15px; height: 15px; color: var(--text-3); flex-shrink: 0; }
.search-bar input {
  background: none; border: none; outline: none; flex: 1;
  color: var(--text); font-size: 13px; font-weight: 300; letter-spacing: 0.01em;
}
.search-bar input::placeholder { color: var(--text-3); }
.kbd {
  font-family: var(--mono); font-size: 9.5px; color: var(--text-3);
  border: 1px solid var(--border); border-radius: 5px; padding: 2px 7px;
  background: var(--surface); flex-shrink: 0;
}

.header-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.icon-btn {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center; cursor: pointer;
  border: 1px solid transparent;
  color: var(--text-2); transition: all .18s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }

.icon-btn.counsel {
  border-color: var(--border-gold);
  color: var(--gold);
  background: rgba(201,169,98,0.06);
}
.icon-btn.counsel:hover { background: rgba(201,169,98,0.13); box-shadow: var(--glow-gold); }

.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(140deg, var(--gold), #8a6c34);
  display: grid; place-items: center;
  font-size: 10px; font-weight: 600; letter-spacing: 0.05em;
  color: #14100a; cursor: pointer; margin-left: 4px;
}

/* ---------- Main split ---------- */
main { display: flex; flex: 1; overflow: hidden; }

aside {
  width: 232px; flex-shrink: 0;
  padding: 22px 14px;
  border-right: 1px solid var(--border);
  background: rgba(255,255,255,0.012);
  display: flex; flex-direction: column;
  overflow-y: auto;
}

.nav-label {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--text-3);
  padding: 0 12px; margin-bottom: 10px;
}

.tab {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; margin-bottom: 3px;
  border-radius: 10px; cursor: pointer;
  font-size: 12.5px; font-weight: 300; color: var(--text-2);
  border: 1px solid transparent;
  transition: all .16s;
  position: relative;
}
.tab svg { width: 16px; height: 16px; opacity: 0.75; flex-shrink: 0; }
.tab:hover { background: var(--surface); color: var(--text); }
.tab.active {
  background: linear-gradient(120deg, rgba(201,169,98,0.11), rgba(201,169,98,0.03));
  border-color: var(--border-gold);
  color: var(--text);
  font-weight: 400;
}
.tab.active svg { opacity: 1; color: var(--gold); }
.tab-count {
  margin-left: auto;
  font-family: var(--mono); font-size: 9px;
  background: var(--surface-3); color: var(--text-2);
  border-radius: 5px; padding: 2px 7px;
}
.tab.active .tab-count { background: rgba(201,169,98,0.18); color: var(--gold-bright); }

.sidebar-footer {
  margin-top: auto; padding: 16px 12px 4px;
  border-top: 1px solid var(--border);
}
.sys-stat {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em;
  color: var(--text-3); padding: 3px 0;
}

/* ---------- Content ---------- */
.content { flex: 1; overflow-y: auto; padding: 34px 40px 60px; }

.panel { display: none; animation: rise .3s cubic-bezier(.2,.7,.3,1); }
.panel.active { display: block; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 30px; gap: 30px;
}
.page-title {
  font-size: 34px; font-weight: 500; line-height: 1.12;
  letter-spacing: 0.004em;
}
.page-title em { font-style: italic; color: var(--gold); font-weight: 400; }
.page-sub {
  color: var(--text-2); font-size: 12.5px; font-weight: 300;
  margin-top: 9px; max-width: 660px; line-height: 1.65;
}
.page-meta { display: flex; gap: 26px; flex-shrink: 0; }
.page-meta > div {
  text-align: right;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-3);
}
.page-meta span {
  display: block; margin-top: 4px;
  font-family: var(--serif); font-size: 24px; font-weight: 500;
  letter-spacing: 0; color: var(--text); text-transform: none;
}
/* A relabelled meta caption. It has to be an element so the
   vocabulary can rewrite it, but it is a label rather than a
   figure — so it inherits the caption styling, not the numeral's. */
.page-meta > div > i { font-style: normal; }

.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1100px) { .split-2 { grid-template-columns: 1fr; } }
