@font-face { font-family: 'FontAwesome'; src: url('fontawesome.ttf'); }

:root{
  --bg:#0b0f14;
  --panel:rgba(255,255,255,.06);
  --panel2:rgba(255,255,255,.085);
  --stroke:rgba(255,255,255,.12);
  --text:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.68);
  --muted2:rgba(255,255,255,.56);
  --brand:#7dd3fc;
  --brand2:#a78bfa;
  --ok:#34d399;
  --warn:#fbbf24;
  --bad:#fb7185;

  --shadow:0 24px 60px rgba(0,0,0,.55);
  --radius:18px;
  --radius2:28px;

  --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,"Apple Color Emoji","Segoe UI Emoji";

  --topbar-h:60px;
  --sidebar-w:280px;
}

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

body{
  margin:0;
  font-family:var(--sans);
  background:var(--bg);
  color:var(--text);
  overflow:hidden;
  -ms-overflow-style:none;
  scrollbar-width:none;
}
body::-webkit-scrollbar{ width:0;height:0; }

a{ color:var(--text); text-decoration:none; }
a:hover{ color:var(--muted2); text-decoration:none; }

code,kbd,pre{ font-family:var(--mono); }

.scroll{
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  touch-action:pan-y;
  -ms-overflow-style:none;
  scrollbar-width:none;
}
.scroll::-webkit-scrollbar{ width:0;height:0; }

:target{ scroll-margin-top:72px; }

.topbar{
  position:sticky;
  top:0;
  z-index:1000;
  height:var(--topbar-h);
  display:flex;
  align-items:center;
  gap:12px;
  padding:0 14px;
  background:var(--panel);
  border-bottom:1px solid var(--stroke);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}

.hamburger{
  width:40px;
  height:40px;
  display: none;
  align-items:center;
  justify-content:center;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.06);
  color:var(--text);
  cursor:pointer;
  font-size:18px;
  border-radius:12px;
}

@media (max-width: 980px){
  .hamburger{
    display: inline-flex;
  }
}

.brandbar{ display:flex; align-items:center; gap:10px; min-width:170px; }
.branddot{
  width:34px;height:34px;
  display:flex;align-items:center;justify-content:center;
}
.brandtext{ display:flex; flex-direction:column; line-height:1.1; min-width:0; }
.brandtitle{ font-weight:800; letter-spacing:.2px; }
.brandsub{ color:var(--muted); font-size:12px; margin-top:2px; }

.grow{ flex:1; }

.app{
  display:grid;
  grid-template-columns:var(--sidebar-w) 1fr;
  height:calc(100dvh - var(--topbar-h));
  min-height:calc(100dvh - var(--topbar-h));
  gap:18px;
  padding:18px;
  padding-top:max(18px, env(safe-area-inset-top));
  padding-bottom:max(18px, env(safe-area-inset-bottom));
  padding-left:max(18px, env(safe-area-inset-left));
  padding-right:max(18px, env(safe-area-inset-right));
}

.card{
  background:var(--panel);
  border:1px solid var(--stroke);
  border-radius:var(--radius2);
  box-shadow:var(--shadow);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}

.sidebar{
  display:flex;
  flex-direction:column;
  min-height:0;
}

.brand{
  padding:18px 18px 10px 18px;
  border-bottom:1px solid var(--stroke);
}
.brand h1{
  margin:0;
  font-size:18px;
  letter-spacing:.2px;
  display:flex;
  align-items:center;
  gap:10px;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(125,211,252,.12);
  border:1px solid rgba(125,211,252,.22);
  color:var(--text);
  font-size:12px;
  margin-top:10px;
  width:fit-content;
}
.pill small{ color:var(--muted); }

.nav{
  padding:10px 10px 14px 10px;
  min-height:0;
}
.nav .groupTitle{
  padding:10px 12px 6px 12px;
  font-size:12px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.12em;
}
.nav a{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:14px;
  color:var(--text);
  border:1px solid transparent;
}
.nav a:hover{
  background:rgba(255,255,255,.06);
  border-color:rgba(255,255,255,.10);
  color:var(--muted2);
}

.dot{ width:8px;height:8px;border-radius:99px; background:rgba(255,255,255,.35); }
.dot.ok{ background:rgba(52,211,153,.9); }
.dot.warn{ background:rgba(251,191,36,.95); }
.dot.bad{ background:rgba(251,113,133,.95); }

.content{
  min-height:0;
  position:relative;
  display:flex;
  flex-direction:column;
}

.main{
  padding:18px;
  min-height:0;
}

.section{
  padding:18px;
  border-radius:var(--radius);
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.04);
  margin-bottom:14px;

  content-visibility:auto;
  contain-intrinsic-size:600px;
}
.section h3{
  margin:0 0 10px 0;
  font-size:16px;
  letter-spacing:.2px;
}
.section p{ margin:8px 0; color:var(--muted); line-height:1.55; }
.section ul{ margin:8px 0 0 18px; color:var(--muted); line-height:1.55; }
.section li{ margin:6px 0; }

.grid2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:10px;
}

.callout{
  border-radius:16px;
  border:1px solid var(--stroke);
  padding:12px;
  background:rgba(255,255,255,.05);
}
.callout strong{ display:block; margin-bottom:6px; }
.callout.ok{ border-color:rgba(52,211,153,.25); background:rgba(52,211,153,.08); }
.callout.warn{ border-color:rgba(251,191,36,.25); background:rgba(251,191,36,.08); }
.callout.bad{ border-color:rgba(251,113,133,.25); background:rgba(251,113,133,.08); }

pre{
  margin:10px 0 0 0;
  padding:12px;
  border-radius:16px;
  border:1px solid var(--stroke);
  background:rgba(0,0,0,.28);
  overflow:auto;
  -ms-overflow-style:none;
  scrollbar-width:none;
}
pre::-webkit-scrollbar{ width:0;height:0; }
pre code{
  font-size:12.5px;
  color:#fff;
  white-space:pre;
}

.kbd{
  display:inline-flex;
  gap:6px;
  align-items:center;
  padding:2px 8px;
  border-radius:10px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.06);
  color:var(--text);
  font-size:12px;
  white-space:nowrap;
}

.table{
  width:100%;
  border-collapse:collapse;
  margin-top:10px;
  overflow:hidden;
  border-radius:16px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.03);
}
.table th,.table td{
  padding:10px;
  border-bottom:1px solid rgba(255,255,255,.08);
  vertical-align:top;
  text-align:left;
  font-size:13px;
}
.table th{
  color:var(--text);
  background:rgba(255,255,255,.05);
  font-weight:700;
}
.table td{ color:var(--muted); }
.table tr:last-child td{ border-bottom:none; }

.fa16{
  font-family: 'FontAwesome';
  font-size:16px; 
}
.fa24{
  font-family: 'FontAwesome';
  font-size:24px; 
}

.footer{
  padding:12px 16px 0px;
  border-top:1px solid var(--stroke);
  color:var(--muted2);
  font-size:12px;
  display:flex;
  border-radius:14px;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.footer div {
  position: relative; top: 3px;
}
.footer a{ color:var(--text); }
.footer a:hover{ color:var(--muted2); text-decoration: none; }

.drawerOverlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  z-index:55;
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
}
.drawerOverlay.open{ opacity:1; pointer-events:auto; }

@media (max-width: 980px){
  :root{ --radius:14px; }

  body{
    font-size:16px;
    line-height:1.55;
  }

  .brandsub{ display:none; }

  .app{
    grid-template-columns:1fr;
    height:calc(100dvh - var(--topbar-h));
    padding:0;
    gap:0;
  }

  #sidebar.sidebar{
    position:fixed;
    top:var(--topbar-h);
    left:0;
    width:min(92vw, var(--sidebar-w));
    height:calc(100dvh - var(--topbar-h));
    transform:translateX(-100%);
    transition:transform .22s ease;
    pointer-events:none;
    z-index:60;
    overflow:auto;
    border-radius:0 18px 18px 0;
    box-shadow:0 10px 26px rgba(0,0,0,.45);
  }
  #sidebar.sidebar.open{
    transform:translateX(0);
    pointer-events:auto;
  }

  .drawerOverlay{ display:block; top:var(--topbar-h); height:calc(100dvh - var(--topbar-h)); }

  #mainScroll.main{
    flex:1 1 auto;
    min-height:0;
    padding:16px 14px 24px;
    overflow:auto;
    -webkit-overflow-scrolling:touch;
  }

  .grid2{ grid-template-columns:1fr; }

  table,.table{
    display:block;
    max-width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }

  p,li{
    overflow-wrap:anywhere;
    word-break:normal;
  }

  .btn, button, a.btn{ min-height:44px; }
}

@media (max-width: 420px){
  .topbar{ padding:0 10px; }
  #mainScroll.main{ padding:12px 10px 18px; }
}

.actions{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.btn{
  cursor:pointer;
  border-radius:12px;
  padding:9px 12px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.06);
  color:var(--text);
  font-size:13px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  user-select:none;
}
.btn:hover{ background:rgba(255,255,255,.10); }
.btn.primary{
  border-color:rgba(125,211,252,.30);
  background:rgba(125,211,252,.12);
}
.btn.primary:hover{ background:rgba(125,211,252,.16); }
.btn.ghost{ background:transparent; }

.download {
  background: none;
  border: 0px;
  color: var(--text);
  font-size: 16px;
}
.download:hover {
  color: var(--muted2);
  cursor: pointer;
}

.gallery{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(160px, 1fr));
  gap:12px;
  margin-top:10px;
}

.gallery img{
  width:100%;
  height:140px;
  object-fit:cover;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.04);
  cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease;
}

.gallery img:hover{
  transform:scale(1.03);
  box-shadow:0 12px 32px rgba(0,0,0,.45);
}

@media (prefers-reduced-motion: reduce){
  *{ scroll-behavior:auto !important; transition:none !important; animation:none !important; }
}

@media (prefers-reduced-transparency: reduce){
  .card,.topbar{
    backdrop-filter:none;
    -webkit-backdrop-filter:none;
  }
}
