
/* Codex Panel X+ — Portal Desktop UI (no-build, static) */
:root{
  --bg:#070A0F;
  --space:#05070B;
  --surface:#0E1420;
  --surface2:#0B1019;
  --glass: rgba(255,255,255,.03);
  --glass2: rgba(0,0,0,.18);
  --border: rgba(255,255,255,.10);
  --border2: rgba(95,232,255,.20);
  --text:#EAF0F7;
  --muted:#9AA7B5;
  --brand:#5FE8FF;
  --magenta:#B84DFF;
  --accent:#F6C423;
  --danger:#ff5b5b;

  --r-lg: 26px;
  --r-md: 18px;
  --r-sm: 14px;

  --shadow-soft: 0 14px 40px rgba(0,0,0,.35);
  --shadow-elev: 0 28px 90px rgba(0,0,0,.55);
  --shadow-glow: 0 0 55px rgba(95,232,255,.18);
  --shadow-mag: 0 0 55px rgba(184,77,255,.14);
  --ring: 0 0 0 4px rgba(95,232,255,.12);
}

*{box-sizing:border-box; -webkit-font-smoothing: antialiased}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 20% 10%, rgba(95,232,255,.16), transparent 55%),
    radial-gradient(1000px 700px at 85% 75%, rgba(184,77,255,.12), transparent 60%),
    radial-gradient(900px 650px at 55% 115%, rgba(246,196,35,.08), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(0,0,0,0)),
    var(--bg);
  color-scheme: dark;
  overflow-x: hidden;
}

/* Layout shell */
.shell{
  min-height:100%;
  display:grid;
  grid-template-columns: 280px 1fr;
}
@media (max-width: 980px){
  .shell{ grid-template-columns: 1fr; }
  .sidebar{ display:none; }
}

.sidebar{
  border-right:1px solid rgba(255,255,255,.08);
  padding:18px 16px;
  background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.12));
  backdrop-filter: blur(12px);
  position: sticky;
  top:0;
  height:100vh;
}

.brandRow{
  display:flex; align-items:center; gap:12px;
  padding:10px 10px;
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  box-shadow: var(--shadow-soft);
}
.logo{
  width:42px;height:42px;border-radius:16px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.12), rgba(255,255,255,0) 55%),
              linear-gradient(135deg, rgba(95,232,255,.95), rgba(184,77,255,.85));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: var(--shadow-glow), var(--shadow-mag);
}
.brandTitle{
  font-weight:900; letter-spacing:.12em; font-size:14px;
}
.brandSub{
  font-size:12px; color:var(--muted); margin-top:2px;
}

.nav{
  margin-top:14px;
  display:flex; flex-direction:column; gap:6px;
}
.nav h4{
  margin:12px 8px 6px; color:var(--muted); font-size:12px; font-weight:700; letter-spacing:.12em;
}
.nav a{
  display:flex; align-items:center; gap:10px;
  padding:10px 10px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
  color: var(--text);
}
.nav a:hover{
  border-color: rgba(95,232,255,.26);
  background: rgba(255,255,255,.04);
}
.nav a.active{
  border-color: rgba(95,232,255,.45);
  background: rgba(95,232,255,.08);
  box-shadow: var(--shadow-soft);
}
.dot{
  width:10px;height:10px;border-radius:99px;background: rgba(95,232,255,.55);
  box-shadow: 0 0 20px rgba(95,232,255,.2);
}
.dot.m{ background: rgba(184,77,255,.55); box-shadow: 0 0 20px rgba(184,77,255,.2);}
.dot.a{ background: rgba(246,196,35,.65); box-shadow: 0 0 20px rgba(246,196,35,.2);}

.main{
  padding:18px 18px 90px;
}
.shell.desktop-mode{
  display:block;
}
.shell.desktop-mode .sidebar{
  display:none;
}
.shell.desktop-mode .main{
  min-height:100vh;
  padding:0 0 90px;
}
.shell.desktop-mode #page{
  min-height:calc(100vh - 90px);
  padding-top:74px;
}
.shell.desktop-mode .cockpit{
  min-height:calc(100vh - 90px);
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}
.shell.desktop-mode .cockpitMedia,
.shell.desktop-mode .cockpitGlass,
.shell.desktop-mode .cockpitEmpty{
  border-radius: 0;
}
.search{
  flex:1;
  display:flex; align-items:center; gap:10px;
  padding:10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(16px) saturate(135%);
}
.search input{
  width:100%;
  background: rgba(255,255,255,.01);
  border:0;
  outline: none;
  color: var(--text);
  font-size: 14px;
}
.searchFloat{
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(920px, calc(100vw - 236px));
  margin-left: 44px;
  z-index: 25;
}
.floatingControls{
  position: fixed;
  top: 14px;
  right: 18px;
  display:flex;
  gap:10px;
  align-items:center;
  z-index: 26;
}
.kbd{
  font-size:12px;
  color: var(--muted);
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  padding:4px 8px;
  border-radius: 10px;
}
.profileBtn{
  display:flex; align-items:center; gap:10px;
  padding:10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  cursor:pointer;
}
.avatar{
  width:28px;height:28px;border-radius:999px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.10), rgba(255,255,255,0) 55%),
              linear-gradient(135deg, rgba(246,196,35,.95), rgba(95,232,255,.60));
  border: 1px solid rgba(255,255,255,.14);
}

/* Pages */
.pageTitle{
  font-weight:900; letter-spacing:.06em; margin: 10px 0 6px;
}
.pageSub{ color: var(--muted); margin: 0 0 14px; font-size: 13px; }

.grid{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 16px;
}
@media(max-width: 1100px){
  .grid{ grid-template-columns: 1fr; }
}
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.025));
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-elev);
  padding:16px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px) saturate(140%);
}
.card::before{
  content:"";
  position:absolute; inset:-2px;
  background:
    radial-gradient(600px 220px at 10% 10%, rgba(95,232,255,.14), transparent 60%),
    radial-gradient(520px 220px at 90% 40%, rgba(184,77,255,.12), transparent 60%),
    radial-gradient(520px 220px at 45% 120%, rgba(246,196,35,.08), transparent 60%);
  pointer-events:none;
  filter: blur(10px);
  opacity: .95;
}
.card > *{ position:relative; }
.section{
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--r-md);
  padding: 14px;
  margin-top: 12px;
}
label{display:block;color:var(--muted);font-size:12px;margin:10px 0 6px}
input, select{
  width:100%;
  padding:11px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: var(--text);
  outline:none;
}
input:focus, select:focus{ border-color: rgba(95,232,255,.35); box-shadow: var(--ring); }

.row{ display:grid; grid-template-columns: 1fr 1fr; gap:10px; }
@media(max-width: 980px){ .row{ grid-template-columns: 1fr; } }

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:10px;
  padding:10px 12px;
  border-radius: 16px;
  cursor:pointer;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: var(--text);
  transition: transform .06s ease, background .18s ease, border-color .18s ease, filter .18s ease;
}
.btn:hover{ background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); }
.btn:active{ transform: translateY(1px); }
.btn.primary{
  background: linear-gradient(135deg, rgba(95,232,255,.95), rgba(184,77,255,.80));
  color: #05070B; border-color: rgba(255,255,255,.06);
  box-shadow: var(--shadow-glow);
}
.btn.danger{
  background: rgba(255,91,91,.12);
  border-color: rgba(255,91,91,.35);
}
.btn.ghost{
  background: transparent;
}

pre{
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--r-md);
  padding: 12px;
  color: #dbe7f0;
  min-height: 220px;
}

/* Portal Start Menu */
.overlay{
  position:fixed; inset:0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(10px);
  display:none;
  z-index: 20;
}
.overlay.open{ display:block; }
.startMenu{
  position:fixed;
  left: 18px;
  bottom: 86px;
  width: 420px;
  max-width: calc(100vw - 36px);
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(10,12,16,.72);
  box-shadow: var(--shadow-elev);
  padding: 14px;
}
.startTop{
  display:flex; gap:10px; align-items:center;
}
.startTop input{
  background: rgba(255,255,255,.05);
}
.appGrid{
  margin-top: 12px;
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.appTile{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.025));
  cursor:pointer;
  backdrop-filter: blur(18px) saturate(130%);
}
.appTile:hover{
  border-color: rgba(95,232,255,.28);
  box-shadow: 0 10px 35px rgba(95,232,255,.12);
}
.appIcon,
.dockIcon,
.cmdIcon{
  flex: 0 0 auto;
  display:grid;
  place-items:center;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.04));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 12px 24px rgba(0,0,0,.24);
  overflow:hidden;
}
.appIcon{
  width: 58px;
  height: 58px;
}
.dockIcon,
.cmdIcon{
  width: 28px;
  height: 28px;
  border-radius: 10px;
}
.appIcon img,
.dockIcon img,
.cmdIcon img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
}
.appName{ font-weight: 800; }
.appDesc{ color: var(--muted); font-size: 12px; margin-top: 4px; }

/* Dock + portal button */
.dockBar{
  position:fixed;
  left: 0; right: 0; bottom: 0;
  padding: 14px 18px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 12px;
  z-index: 15;
}
.dock{
  display:flex; align-items:center; gap:10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(9,11,16,.16);
  backdrop-filter: blur(16px) saturate(135%);
  padding: 7px 9px;
  box-shadow: 0 16px 40px rgba(0,0,0,.18);
}
.portalBtn{
  position:fixed;
  left: 23px;
  bottom: 18px;
  width: 54px; height: 54px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.14);
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.10), rgba(255,255,255,0) 55%),
              linear-gradient(135deg, rgba(95,232,255,.95), rgba(184,77,255,.85));
  box-shadow: var(--shadow-glow), var(--shadow-mag);
  cursor:pointer;
  z-index: 21;
  overflow:hidden;
}
.portalBtn::after{
  content:"";
  position:absolute;
  inset: 8px;
  border-radius: 12px;
  background: url('/assets/icons/png/00_world.png') center/cover no-repeat;
  opacity:.92;
}
.dockItem{
  display:flex;
  align-items:center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.05);
  background: rgba(255,255,255,.03);
  cursor:pointer;
  color: var(--text);
  font-size: 12px;
  backdrop-filter: blur(12px);
}
.dockItem.active{
  border-color: rgba(95,232,255,.24);
  background: rgba(95,232,255,.05);
}
.dockItem:hover{ border-color: rgba(255,255,255,.18); }

/* Command palette */
.palette{
  position: fixed;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 720px;
  max-width: calc(100vw - 36px);
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(10,12,16,.78);
  box-shadow: var(--shadow-elev);
  padding: 12px;
}
.palette input{ background: rgba(255,255,255,.06); }
.list{
  margin-top: 10px;
  display:flex; flex-direction:column; gap: 8px;
}
.cmd{
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
  cursor:pointer;
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
}
.cmd:hover{ border-color: rgba(95,232,255,.28); }
.cmd small{ color: var(--muted); }

/* Profile menu */
.menu{
  position: fixed;
  top: 70px;
  right: 18px;
  width: 320px;
  max-width: calc(100vw - 36px);
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(10,12,16,.78);
  box-shadow: var(--shadow-elev);
  padding: 10px;
  display:none;
  z-index: 30;
}
.menu.open{ display:block; }
.menuHeader{ padding:10px; border-radius: 18px; background: rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.10); }
.menuHeader b{ letter-spacing:.06em; }
.menuHeader div{ color: var(--muted); font-size: 12px; margin-top: 4px; }
.menuGroupTitle{ margin: 10px 10px 6px; color: var(--muted); font-size: 11px; letter-spacing:.12em; font-weight: 800; }
.menuItem{
  padding: 10px 10px;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
  cursor:pointer;
  display:flex; align-items:center; justify-content:space-between;
}
.menuItem:hover{ border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.04); }
.menuItem.active{ border-color: rgba(95,232,255,.32); background: rgba(95,232,255,.09); }
.menuItem.danger{ border-color: rgba(255,91,91,.28); background: rgba(255,91,91,.08); }

/* Toasts */
.toasts{
  position: fixed;
  right: 18px;
  bottom: 86px;
  display:flex;
  flex-direction:column;
  gap:10px;
  z-index: 40;
}
.toast{
  width: 360px;
  max-width: calc(100vw - 36px);
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(10,12,16,.78);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
  padding: 12px;
}
.toast b{ letter-spacing:.04em; }
.toast .tmuted{ color: var(--muted); font-size: 12px; margin-top: 4px; }
.toast.ok{ border-color: rgba(95,232,255,.22); }
.toast.bad{ border-color: rgba(255,91,91,.30); }

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

.split{
  display:flex; align-items:center; justify-content:space-between; gap: 12px;
  flex-wrap: wrap;
}

.shell{
  grid-template-columns: 280px 1fr;
  transition: grid-template-columns .18s ease;
}
.shell.sidebar-collapsed{
  grid-template-columns: 76px 1fr;
}
.shell.sidebar-collapsed .brandSub,
.shell.sidebar-collapsed .nav a span:last-child,
.shell.sidebar-collapsed .nav h4,
.shell.sidebar-collapsed .section .muted{
  display:none;
}
.shell.sidebar-collapsed .brandRow{
  justify-content:center;
  padding:10px 6px;
}
.shell.sidebar-collapsed .logo{
  width:44px;
  height:44px;
}
.shell.sidebar-collapsed .nav a{
  justify-content:center;
}
.shell.sidebar-collapsed .nav a .dot{
  width:12px;
  height:12px;
}

.topbar{
  padding: 8px 0 10px;
}
.search{
  padding: 7px 10px;
  border-radius: 16px;
}
.search input{
  font-size: 13px;
  padding: 0;
}
.kbd{
  padding: 3px 7px;
  border-radius: 9px;
}

.exitBtn{
  width: 40px;
  height: 40px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  cursor:pointer;
  user-select:none;
}
.exitBtn:hover{
  border-color: rgba(255,91,91,.35);
  background: rgba(255,91,91,.08);
}
.exitBtn:active{
  transform: translateY(1px);
}
.exitBtn span{
  font-weight: 900;
  color: rgba(255,255,255,.85);
  letter-spacing: .04em;
}

.cockpit{
  position: relative;
  min-height: 360px;
}
.cockpitMedia,
.cockpitGlass,
.cockpitEmpty{
  position: absolute;
  inset: 0;
  border-radius: var(--r-lg);
}
.cockpitMedia{
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
}
.cockpitVideo{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
  filter: saturate(118%) contrast(108%) brightness(.6);
}
.desktopFrame{
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.youtubeControls{
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(560px, 100%);
}
.youtubeInput{
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(7,10,15,.28);
  color: var(--text);
  backdrop-filter: blur(16px);
}
.youtubeActions{
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
}
.youtubeActions .btn{
  min-width: 0;
  white-space: nowrap;
}
.cockpitGlass{
  background:
    linear-gradient(180deg, rgba(5,7,11,.18), rgba(5,7,11,.54)),
    radial-gradient(800px 300px at 20% 10%, rgba(95,232,255,.18), transparent 60%),
    radial-gradient(620px 260px at 82% 30%, rgba(184,77,255,.16), transparent 60%);
  backdrop-filter: blur(10px) saturate(135%);
}
.cockpitEmpty{
  display:grid;
  align-items:end;
  justify-items:start;
  padding: 48px 54px 120px;
  z-index: 1;
}
.desktopEngrave{
  max-width: 760px;
  text-align:left;
  pointer-events:none;
}
.desktopEngraveInteractive{
  pointer-events:auto;
}
.desktopGlyph{
  width: 74px;
  height: 74px;
  margin-bottom: 18px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.12);
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.10), rgba(255,255,255,0) 55%),
    linear-gradient(135deg, rgba(95,232,255,.45), rgba(184,77,255,.30));
  box-shadow: 0 18px 46px rgba(0,0,0,.22);
  display:grid;
  place-items:center;
  backdrop-filter: blur(14px);
}
.desktopGlyph b{
  font-size: 22px;
  letter-spacing: .14em;
}
.engraveTitle{
  font-size: 28px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-shadow: 0 10px 40px rgba(0,0,0,.38);
}
.engraveSub{
  margin-top: 10px;
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  text-shadow: 0 6px 24px rgba(0,0,0,.32);
}
.engraveMeta{
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(234,240,247,.72);
  text-shadow: 0 6px 24px rgba(0,0,0,.34);
}
.desktopCopy{
  text-align:left !important;
  max-width: 620px !important;
  color: rgba(234,240,247,.86);
  text-shadow: 0 6px 24px rgba(0,0,0,.34);
}
@media (max-width: 980px){
  .searchFloat{
    width: calc(100vw - 112px);
    margin-left: 28px;
  }
  .floatingControls{
    top: 78px;
    right: 14px;
  }
  .cockpitEmpty{
    padding: 36px 22px 120px;
  }
  .engraveTitle{
    font-size: 22px;
    letter-spacing: .12em;
  }
  .youtubeActions{
    flex-wrap: wrap;
  }
}
.cockpitMark{
  width: 92px;
  height: 92px;
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,.12);
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.10), rgba(255,255,255,0) 55%),
    linear-gradient(135deg, rgba(95,232,255,.75), rgba(184,77,255,.55));
  box-shadow: var(--shadow-glow);
  display:grid;
  place-items:center;
  position: relative;
}
.cockpitMark::after{
  content:"";
  position:absolute;
  inset: 10px;
  border-radius: 22px;
  border: 2px dashed rgba(255,255,255,.18);
  opacity:.55;
  animation: spin 18s linear infinite;
}
.cockpitMark b{
  font-size: 22px;
  letter-spacing: .16em;
}
@keyframes spin {
  to { transform: rotate(1turn); }
}
