:root{
  --bg: #0b0f13;
  --panel: #10161d;
  --panel2:#0e141a;
  --border:#1c2732;
  --text:#e6edf3;
  --muted:#9bb0c1;

  --accent:#caa23a;      /* golden */
  --accent2:#e0c36d;     /* lighter gold */
  --danger:#ff4d4d;

  --shadow: 0 12px 30px rgba(0,0,0,.35);
  --radius: 14px;
  --radius2: 18px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  min-height:100vh;
  background: radial-gradient(1200px 800px at 30% 0%, rgba(202,162,58,.08), transparent 55%),
              radial-gradient(900px 700px at 80% 10%, rgba(224,195,109,.07), transparent 55%),
              var(--bg);
  background-attachment: fixed, fixed, fixed;
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

a{ color:inherit; text-decoration:none; }
img{ max-width:100%; display:block; }

.muted{ color:var(--muted); }
.tiny{ font-size:12px; }
.h1{ font-size:26px; margin:0 0 10px; letter-spacing:.2px; }
.h2{ font-size:18px; margin:0 0 8px; letter-spacing:.2px; }

.app-shell{
  display:flex;
  min-height:100vh;
}

.sidebar{
  width:290px;
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent 35%),
              var(--panel2);
  border-right:1px solid var(--border);
  position:sticky;
  top:0;
  height:100vh;
  padding:14px;
  overflow:auto;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px;
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.02);
  box-shadow: inset 0 0 0 1px rgba(202,162,58,.05);
  position:relative;
}
.brand-badge{
  width:42px; height:42px;
  border-radius: 12px;
  background: rgba(202,162,58,.14);
  border:1px solid rgba(202,162,58,.35);
  display:flex; align-items:center; justify-content:center;
  font-weight:800;
  letter-spacing:.6px;
  color: var(--accent2);
}
.brand-title{ font-weight:700; }
.brand-sub{ font-size:12px; color:var(--muted); margin-top:2px; }

.sidebar-close{
  display:none;
  position:absolute;
  right:8px; top:8px;
}

.nav{
  margin-top:12px;
  padding:8px 4px 10px;
}

.nav-item{
  margin:4px 0;
}
.nav-link{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 10px;
  border-radius: 12px;
  border:1px solid transparent;
  background: transparent;
  background-attachment: fixed, fixed, fixed;
  color:var(--text);
  cursor:pointer;
  transition: transform .12s ease, background .18s ease, border-color .18s ease;
}
.nav-link:hover{
  background: rgba(255,255,255,.03);
  border-color: rgba(255,255,255,.06);
  transform: translateY(-1px);
}
.nav-item.active .nav-link{
  background: rgba(202,162,58,.12);
  border-color: rgba(202,162,58,.35);
  box-shadow: inset 0 0 0 1px rgba(202,162,58,.08);
}
.nav-icon{ width:22px; display:inline-flex; justify-content:center; opacity:.95; }
.nav-text{ flex:1; text-align:left; font-weight:600; font-size:13.5px; }
.nav-caret{ opacity:.85; transform: translateX(0); transition: transform .18s ease; }
.nav-item.expanded > .nav-link .nav-caret{ transform: rotate(90deg); }

.nav-children{
  margin-left: 8px;
  border-left: 1px dashed rgba(255,255,255,.08);
  padding-left: 10px;
  display:none;
}
.nav-item.expanded + .nav-children{ display:block; }

.level-1 .nav-link{ padding-left:12px; }
.level-2 .nav-link{ padding-left:16px; }

.sidebar-footer{
  margin-top:16px;
  padding:10px 10px 2px;
  border-top:1px solid rgba(255,255,255,.06);
}

.main{ flex:1; min-width:0; display:flex; flex-direction:column; min-height:100vh; }

.topbar{
  position:sticky;
  top:0;
  z-index:20;
  background: rgba(11,15,19,.75);
  backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(255,255,255,.06);
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 18px;
}
.topbar-title{ flex:1; min-width:0; }
.topbar-h{ font-weight:800; letter-spacing:.3px; }
.topbar-sub{ font-size:12px; margin-top:2px; }

.icon-btn{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  background-attachment: fixed, fixed, fixed;
  color:var(--text);
  border-radius: 12px;
  padding:10px 12px;
  cursor:pointer;
  transition: transform .12s ease, border-color .18s ease, background .18s ease;
}
.icon-btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.05);
  border-color: rgba(202,162,58,.25);
}

.pill{
  display:flex; align-items:center; gap:8px;
  padding:8px 10px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
}
.dot{
  width:8px; height:8px; border-radius:999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(202,162,58,.15);
}

.content{
  padding: 18px;
  width: 100%;
  max-width: none;
  flex: 1;
}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent 40%),
              var(--panel);
  border:1px solid var(--border);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
}

.card-pad{ padding:16px; }

.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:14px;
}

.col-12{ grid-column: span 12; }
.col-8{ grid-column: span 8; }
.col-6{ grid-column: span 6; }
.col-4{ grid-column: span 4; }
.col-3{ grid-column: span 3; }

@media (max-width: 1100px){
  .col-8,.col-6,.col-4,.col-3{ grid-column: span 12; }
  .sidebar{ position:fixed; left:-320px; top:0; z-index:50; transition:left .2s ease; }
  .sidebar.open{ left:0; }
  .sidebar-close{ display:inline-flex; }
}

.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px;
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid rgba(202,162,58,.35);
  background: rgba(202,162,58,.12);
  color: var(--accent2);
  font-weight:800;
  cursor:pointer;
  transition: transform .12s ease, background .18s ease, border-color .18s ease;
}
.btn:hover{
  transform: translateY(-1px);
  background: rgba(202,162,58,.16);
  border-color: rgba(202,162,58,.55);
}
.btn.secondary{
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  color: var(--text);
  font-weight:700;
}
.btn.danger{
  border-color: rgba(255,77,77,.45);
  background: rgba(255,77,77,.10);
  color: #ffd1d1;
}

.input, .select{
  width:100%;
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
  color: var(--text);
  outline:none;
}
.input:focus, .select:focus{
  border-color: rgba(202,162,58,.45);
  box-shadow: 0 0 0 3px rgba(202,162,58,.10);
}

.toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  justify-content:space-between;
}
.toolbar-left, .toolbar-right{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius: 999px;
  font-size:12px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.02);
}
.badge .b{
  width:8px; height:8px; border-radius:999px;
  background: var(--accent);
}

.cards{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:14px;
  margin-top: 14px;
}
.card-item{
  grid-column: span 3;
  overflow:hidden;
  border-radius: var(--radius2);
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
  transition: transform .12s ease, border-color .18s ease, background .18s ease;
  cursor:pointer;
  opacity:0;
  transform: translateY(10px);
}
.card-item.in{
  opacity:1;
  transform: translateY(0);
  transition: opacity .35s ease, transform .35s ease, border-color .18s ease, background .18s ease;
}
.card-item:hover{
  transform: translateY(-2px);
  border-color: rgba(202,162,58,.30);
  background: rgba(202,162,58,.06);
}
.card-item .thumb{
  height:160px;
  background: rgba(0,0,0,.25);
  border-bottom:1px solid rgba(255,255,255,.06);
  overflow:hidden;
}
.card-item .thumb img{
  width:100%; height:100%; object-fit:cover;
  filter: saturate(1.03) contrast(1.02);
}
.card-item .meta{
  padding:12px;
}
.card-item .title{
  font-weight:900;
  letter-spacing:.2px;
}
.card-item .sub{
  margin-top:6px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:12px;
}
.tag{
  padding:4px 8px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
}
.tag.gold{
  border-color: rgba(202,162,58,.35);
  background: rgba(202,162,58,.10);
  color: var(--accent2);
}

@media (max-width: 1200px){
  .card-item{ grid-column: span 4; }
}
@media (max-width: 850px){
  .card-item{ grid-column: span 6; }
}
@media (max-width: 560px){
  .card-item{ grid-column: span 12; }
}

.hr{
  border:none;
  border-top:1px solid rgba(255,255,255,.08);
  margin:14px 0;
}

.footer{
  margin-top:auto;
  padding: 18px;
  border-top:1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.12);
}
.footer-inner{
  max-width:1250px;
  margin:0 auto;
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
}

/* Modal */
.modal-backdrop{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.55);
  z-index: 80;
}
.modal{
  position:fixed;
  inset:0;
  z-index: 90;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
}
.modal-card{
  width:min(1000px, 100%);
  max-height: 86vh;
  overflow:auto;
  border-radius: 18px;
  border:1px solid rgba(202,162,58,.22);
  background: linear-gradient(180deg, rgba(202,162,58,.08), transparent 35%),
              var(--panel);
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
  transform: scale(.98);
  opacity:0;
  animation: pop .14s ease forwards;
}
@keyframes pop{
  to{ transform: scale(1); opacity:1; }
}
.modal-head{
  padding:14px 14px 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.modal-title{
  font-weight:1000;
  letter-spacing:.2px;
}
.modal-body{ padding:14px; }

.gallery{
  display:grid;
  grid-template-columns: 1.5fr .5fr;
  gap: 12px;
}
@media (max-width: 900px){
  .gallery{ grid-template-columns: 1fr; }
}

.gallery-main{
  border-radius: 16px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.25);
}
.gallery-main img{
  width:100%;
  height: 380px;
  object-fit:cover;
}
.gallery-thumbs{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.gallery-thumbs button{
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
  padding:0;
  overflow:hidden;
  cursor:pointer;
  transition: transform .12s ease, border-color .18s ease, background .18s ease;
}
.gallery-thumbs button:hover{
  transform: translateY(-1px);
  border-color: rgba(202,162,58,.30);
  background: rgba(202,162,58,.06);
}
.gallery-thumbs img{
  width:100%;
  height: 90px;
  object-fit:cover;
}

.kv{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 10px;
}
.kv .kv-item{
  grid-column: span 4;
  padding:12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
}
@media (max-width: 900px){
  .kv .kv-item{ grid-column: span 12; }
}
.kv .k{ color:var(--muted); font-size:12px; }
.kv .v{ font-weight:900; margin-top:4px; }

.notice{
  border:1px dashed rgba(202,162,58,.35);
  background: rgba(202,162,58,.07);
  padding:12px;
  border-radius: 14px;
  color: var(--accent2);
}

.ref-img{
  border-radius: 16px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.2);
}

/* Infographic-ish blocks */
.block{
  padding:14px;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
}
.block-title{
  font-weight:1000;
  letter-spacing:.2px;
  margin-bottom:10px;
}
.list{
  margin:0;
  padding-left: 18px;
  color: var(--muted);
}

/* FORCE the HTML [hidden] attribute to actually hide things */
[hidden] { display: none !important; }

/* extra safety */
.modal[hidden],
.modal-backdrop[hidden] { display: none !important; }



/* Communications poster layout */
.comms-wrap{
  display:grid;
  grid-template-columns: 360px 1fr 420px;
  gap:18px;
  align-items:start;
}
@media (max-width: 1100px){
  .comms-wrap{ grid-template-columns: 1fr; }
}
.comms-stack{ display:grid; gap:18px; }
.comms-poster{
  padding:18px;
  border:1px solid rgba(255,255,255,.08);
  border-radius: var(--radius2);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(0,0,0,.10));
  box-shadow: var(--shadow);
}
.comms-poster-title{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:14px;
  margin-bottom:14px;
}
.comms-poster-title .h1{ margin:0; }
.marker-panel{
  display:grid;
  grid-template-columns: 44px 1fr;
  gap:12px;
  align-items:start;
}

/* Dot rail: each row aligns 1:1 with a marker row in the image */
.dot-rail{
  width:44px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.07);
  padding:10px 0;
  display:grid;
  grid-template-rows: repeat(var(--rows, 10), 1fr);
  justify-items:center;
  align-items:center;
}

.dot-row{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:4px;
}

.dot{
  width:9px;
  height:9px;
  border-radius:999px;
  box-shadow: 0 0 0 3px rgba(0,0,0,.18);
}

.c-commander{ background:#d9c83f; }
.c-officers{ background:#7e46c7; }
.c-squad{ background:#2fd07b; }
.c-team{ background:#4aa3ff; }

.legend-dot{
  width:10px;
  height:10px;
  border-radius:999px;
  display:inline-block;
  margin-right:8px;
  box-shadow: 0 0 0 3px rgba(0,0,0,.18);
}
.marker-img{
  border-radius: 14px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.16);
}
.marker-img img{ width:100%; height:auto; display:block; }

.comms-right{
  display:grid;
  gap:18px;
}
.comms-mini{
  display:grid;
  grid-template-columns: 44px 1fr;
  gap:12px;
  align-items:start;
}


.marker-img{
  border-radius: 14px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.16);
  padding:10px;
  display:flex;
  justify-content:center;
  align-items:flex-start;
}
.marker-img img{
  display:block;
  width:auto;
  max-width:100%;
  height:auto;
  margin:0 auto;
}

/* Size tuning per area */
.comms-poster .marker-img img{ max-height: 520px; }
.comms-right .marker-img img{ max-height: 360px; }
.comms-mini .marker-img img{ max-height: 220px; }



/* blue */


/* Communications split-block list */
.comms-splitlist{
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0,0,0,.18);
}
.comms-title-img{
  width: 100%;
  height: auto;
  display: block;
}
.comms-row{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.comms-row-img{
  max-height: 48px;
  width: auto;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
}

/* Dots */
.dot-stack{
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 52px;
}
.dot-stack .dot{
  width: 8px;
  height: 8px;
  border-radius: 99px;
  display: inline-block;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 0 0 1px rgba(0,0,0,.35) inset;
}
.dot.c-commander { background: #f2c94c; } /* yellow */
.dot.c-officers  { background: #9b51e0; } /* purple */
.dot.c-squad     { background: #27ae60; } /* green */
.dot.c-team      { background: #2d9cdb; } /* blue */

/* Phonetic alphabet */
.phonetic-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 10px;
}
.ph-row{
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255,255,255,.06);
}
.ph-row:last-child{ border-bottom: 0; }
.ph-letter{
  min-width: 18px;
  font-weight: 700;
  color: rgba(255,255,255,.88);
}
.ph-sep{
  color: rgba(255,255,255,.35);
}
.ph-word{
  color: rgba(255,255,255,.78);
}
