:root{
  --pageBg:#002D89;
  --pageBgDeep:#001f63;

  --panel:rgba(255,255,255,0.08);
  --panelStrong:rgba(255,255,255,0.12);
  --line:rgba(232,236,255,0.16);

  --text:#e8ecff;
  --muted:rgba(232,236,255,0.72);

  --accent-yellow:#FFFF00;
  --accent-orange:#ED7D31;
  --accent-red:#FF0000;
  --accent-green:#00B050;
  --accent-cyan:#00B0F0;
  --accent-purple:#7030A0;

  --accent:var(--accent-red);
  --accent-soft:rgba(255,0,0,0.12);

  --btnBg:#7aa2ff;
  --btnText:#0b1020;
  --btnRadius:12px;

  --radius:14px;
  --shadow:0 10px 24px rgba(0,0,0,0.28);

  --mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans:ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

*{ box-sizing:border-box; }
html, body{ height:100%; }

body{
  margin:0;
  font-family:var(--sans);
  color:var(--text);
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.06), transparent 28%),
    linear-gradient(180deg, var(--pageBg) 0%, var(--pageBgDeep) 100%);
  overflow:hidden;
}

a{
  color:var(--accent-cyan);
}

a:hover{
  filter:brightness(1.06);
}

button,
input,
select,
textarea{
  font:inherit;
}

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

.topbar{
  min-height:64px;
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:16px;
  padding:12px 16px;
  border-bottom:1px solid var(--line);
  background:rgba(0,45,137,0.72);
  backdrop-filter:blur(8px);
  flex:0 0 auto;
}

.topbar-left,
.topbar-right{
  display:flex;
  align-items:center;
}

.topbar-center{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  min-width:0;
}

.brand{
  font-weight:700;
  letter-spacing:0.2px;
  font-size:clamp(18px, 2.2vw, 24px);
  color:var(--text);
}

.subbrand{
  margin-top:2px;
  font-size:12px;
  color:var(--muted);
  letter-spacing:0.08em;
  text-transform:uppercase;
}

.badge{
  font-size:12px;
  padding:6px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  color:var(--text);
  background:rgba(255,255,255,0.08);
}

.layout{
  flex:1;
  display:flex;
  gap:12px;
  padding:12px;
  align-items:stretch;
  min-height:0;
}

.panel{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
  min-height:0;
  backdrop-filter:blur(6px);
}

.panel-inner{
  padding:14px;
  height:100%;
  overflow:auto;
}

.panel.left{ width:320px; }
.panel.right{ width:340px; }

.center{
  flex:1;
  min-width:560px;
  min-height:0;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.entry-header{
  flex:0 0 auto;
}

.entry-header-inner{
  display:flex;
  justify-content:space-between;
  gap:18px;
  padding:16px 18px;
  align-items:flex-start;
}

.eyebrow{
  font-size:12px;
  color:var(--muted);
  letter-spacing:0.12em;
  text-transform:uppercase;
}

.entry-title{
  margin:6px 0 4px;
  font-size:clamp(28px, 3vw, 38px);
  line-height:1.08;
}

.entry-subtitle{
  color:var(--muted);
  line-height:1.45;
  max-width:62ch;
}

.entry-meta-inline{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
  min-width:160px;
}

.mini-pill,
.type-pill,
.tag{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.08);
  color:var(--text);
  font-size:12px;
}

.entry-surface{
  flex:1;
  min-height:0;
}

.entry-body-wrap{
  padding:20px 22px 28px;
}

.dedication{
  margin-bottom:18px;
  color:var(--accent-yellow);
  font-size:14px;
  letter-spacing:0.04em;
}

.entry-body{
  max-width:78ch;
  margin:0 auto;
  font-size:16px;
  line-height:1.72;
}

.entry-body p{
  margin:0 0 1.15rem;
}

.entry-body em{
  color:#ffffff;
}

.section-tight + .index-tools,
.index-tools + .entry-list{
  margin-top:14px;
}

.section-title{
  font-size:12px;
  color:var(--muted);
  margin-bottom:8px;
  text-transform:uppercase;
  letter-spacing:0.08em;
}

.intro-copy{
  margin:0;
  line-height:1.55;
}

.muted{
  color:var(--muted);
}

.pillrow{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.type-pill{
  background:rgba(255,255,255,0.06);
}

.entry-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.entry-card{
  width:100%;
  text-align:left;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(255,255,255,0.05);
  color:var(--text);
  padding:12px;
  cursor:pointer;
  transition:transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.entry-card:hover{
  transform:translateY(-1px);
  background:rgba(255,255,255,0.08);
}

.entry-card.active{
  border-color:rgba(255,255,255,0.34);
  background:var(--accent-soft);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,0.05);
}

.entry-card.is-placeholder{
  opacity:0.78;
}

.entry-card-head{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}

.entry-card-title{
  font-weight:700;
  font-size:16px;
  line-height:1.25;
}

.entry-card-subtitle{
  margin-top:6px;
  color:var(--muted);
  font-size:13px;
  line-height:1.45;
}

.entry-card-meta{
  margin-top:10px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.card-kicker{
  color:var(--accent-yellow);
  font-size:11px;
  letter-spacing:0.1em;
  text-transform:uppercase;
}

.context-column{
  display:flex;
  flex-direction:column;
  gap:18px;
}

.context-block{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.facts{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.factrow{
  display:grid;
  grid-template-columns:96px 1fr;
  gap:12px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,0.06);
  font-size:13px;
  line-height:1.45;
}

.factrow span:first-child{
  color:var(--muted);
}

.stack{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.note-card,
.link-card,
.empty-card{
  padding:12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,0.06);
}

.note-card-title,
.link-card-title{
  font-weight:700;
  margin-bottom:6px;
}

.note-card p,
.link-card p,
.empty-card p{
  margin:0;
  font-size:14px;
  line-height:1.55;
}

.link-card a{
  text-decoration:none;
  font-weight:600;
}

.tag-cloud{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.tag{
  background:rgba(255,255,255,0.06);
}

.image-stack{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.image-card{
  border:1px solid var(--line);
  border-radius:12px;
  overflow:hidden;
  background:rgba(255,255,255,0.06);
}

.image-card img{
  display:block;
  width:100%;
  height:auto;
  aspect-ratio:16/9;
  object-fit:cover;
  background:rgba(255,255,255,0.04);
}

.image-caption{
  padding:10px 12px;
  font-size:13px;
  line-height:1.45;
  color:var(--muted);
}

.empty-state{
  min-height:240px;
  display:grid;
  place-items:center;
  text-align:center;
  padding:28px;
  color:var(--muted);
}

.btn{
  height:34px;
  padding:0 12px;
  border:none;
  border-radius:var(--btnRadius);
  background:var(--btnBg);
  color:var(--btnText);
  cursor:pointer;
  box-shadow:var(--shadow);
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:600;
}

.btn:hover{
  filter:brightness(1.05);
}

.btn:focus-visible,
.entry-card:focus-visible,
.link-card a:focus-visible{
  outline:2px solid #fff;
  outline-offset:2px;
}

.backbtn{
  white-space:nowrap;
}

.page-header{
  position: sticky;
  top: 0;
  z-index: 100;

  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 92px;
  align-items: center;
  gap: 12px;

  margin-bottom: 18px;
  padding: 12px clamp(10px, 2vw, 20px);

  background: #002D89;
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}

.header-side{
  display: flex;
  align-items: center;
}

.header-left{
  justify-content: flex-start;
}

.header-right{
  justify-content: flex-end;
}

.page-title-wrap{
  text-align: center;
  min-width: 0;
  max-width: 100%;
  padding: 0 4px;
}

.page-title{
  margin: 0;
  font-size: clamp(1.25rem, 2.2vw, 2rem);
  line-height: 1.15;
}

.page-subtitle{
  margin: 4px 0 0;
  font-size: clamp(0.9rem, 1.3vw, 1rem);
  line-height: 1.25;
  opacity: 0.92;
  white-space: normal;
  overflow-wrap: anywhere;
}
.nav-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;

  background: #7aa2ff;
  color: #0b1020;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 8px 18px rgba(0,0,0,0.28);
}

.nav-btn:hover{
  filter: brightness(1.05);
}

.nav-btn:focus-visible{
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.header-spacer{
  display: inline-block;
  min-width: 92px;
  min-height: 42px;
}

@media (max-width: 700px){
  .page-header{
    grid-template-columns: 76px minmax(0, 1fr) 76px;
    gap: 10px;
    margin-bottom: 14px;
    padding: 10px 12px;
  }

  .page-title{
    font-size: clamp(1.05rem, 4.2vw, 1.45rem);
  }

  .page-subtitle{
    font-size: 0.88rem;
    margin-top: 3px;
  }

  .nav-btn{
    min-height: 40px;
    padding: 7px 12px;
    font-size: 0.95rem;
  }

  .header-spacer{
    min-width: 76px;
    min-height: 40px;
  }
}

@media (max-width: 1180px){
  .layout{
    flex-wrap:wrap;
    overflow:auto;
    align-content:flex-start;
  }

  .panel.left,
  .panel.right,
  .center{
    width:100%;
    min-width:0;
  }

  .center{
    order:2;
    min-height:520px;
  }

  .panel.left{
    order:1;
  }

  .panel.right{
    order:3;
  }

  body{
    overflow:auto;
  }

  .app{
    min-height:100vh;
    height:auto;
  }
}

@media (max-width: 760px){
  .topbar{
    grid-template-columns:1fr;
    justify-items:center;
    text-align:center;
  }

  .topbar-left,
  .topbar-right{
    justify-content:center;
  }

  .entry-header-inner{
    flex-direction:column;
  }

  .entry-meta-inline{
    justify-content:flex-start;
  }

  .entry-body-wrap{
    padding:16px;
  }

  .entry-body{
    font-size:15px;
    line-height:1.68;
  }

  .factrow{
    grid-template-columns:1fr;
    gap:4px;
  }
}
