/* =========================================================
   KIRPI AI — PREMIUM GLASS UI (DARK ONLY)
   ========================================================= */


/* ================= THEME ================= */

:root{
  --bg: #0b1220;

  --text: #e5e7eb;
  --muted: #9ca3af;
  --line: rgba(148,163,184,.18);

  --accent: #8b5cf6;
  --accent2: #3b82f6;

  --radius: 22px;
  --shell-gap: clamp(14px, 1.8vw, 24px);
  --shell-pad: clamp(12px, 1.8vw, 22px);
  --sidebar-width: 300px;
  --mobile-topbar-height: 58px;
}

html{
  color-scheme: dark;
}


/* ================= BASE ================= */

*{ box-sizing:border-box; }

html, body{ height:100%; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;

  color:var(--text);

  background:var(--bg);

  overflow-x:hidden;
  position:relative;
  isolation:isolate;
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:0;
  pointer-events:none;

  background:
    radial-gradient(1200px 760px at 16% -12%, rgba(20,184,166,.18), transparent 58%),
    radial-gradient(980px 680px at 88% 6%, rgba(59,130,246,.16), transparent 58%),
    radial-gradient(900px 720px at 56% 112%, rgba(139,92,246,.14), transparent 62%),
    linear-gradient(145deg, #050914 0%, #08111f 38%, #0d1324 62%, #050812 100%);
}

body::after{
  content:"";
  position:fixed;
  inset:0;
  z-index:0;
  pointer-events:none;

  background:
    linear-gradient(118deg, transparent 0%, rgba(255,255,255,.05) 31%, transparent 48%),
    linear-gradient(242deg, transparent 0%, rgba(45,212,191,.055) 28%, transparent 52%),
    linear-gradient(180deg, rgba(255,255,255,.03) 0%, transparent 30%, rgba(0,0,0,.30) 100%),
    radial-gradient(ellipse at 50% 38%, transparent 0%, rgba(0,0,0,.34) 100%);
  background-size:180% 180%, 160% 160%, 100% 100%, 100% 100%;
  background-position:50% 0, 50% 100%, center, center;
  opacity:.92;
}


/* ================= LAYOUT ================= */

.app{
  position:relative;
  z-index:1;

  max-width:1400px;
  width:min(1400px, calc(100% - 40px));
  margin:auto;
  padding:20px;

  display:grid;
  grid-template-columns:320px 1fr;
  gap:24px;
  align-items:start;
}

.sidebar, .main{
  min-width:0;
}

.sidebar{
  position:sticky;
  top:20px;
  height:calc(100vh - 40px);
  height:calc(100dvh - 40px);

  align-self:start;
  display:flex;
  flex-direction:column;
  min-height:0;
  overflow:hidden;
  isolation:isolate;
}


/* ================= GLASS BASE ================= */

.sidebar,
.main,
.mobile-topbar{
  border-radius:var(--radius);

  border:1px solid rgba(255,255,255,.06);

  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));

  backdrop-filter:blur(18px);

  box-shadow:
    0 20px 60px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.05);

  transition:.25s ease;
}

.sidebar:hover,
.main:hover{
  transform:none;
}


/* ================= SIDEBAR ================= */

.sidebar-header{
  padding:18px;
  display:flex;
  flex-direction:column;
  gap:12px;
  flex-shrink:0;

  border-bottom:1px solid var(--line);

  background:
    radial-gradient(circle at 20% 10%, rgba(139,92,246,.15), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(59,130,246,.12), transparent 50%);
}

.sidebar-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color:var(--text);
  min-width:0;
}

.brand-title{
  font-weight:900;
  font-size:14px;
  line-height:1.2;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.brand-sub{
  font-size:11px;
  color:var(--muted);
  line-height:1.25;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.brand-text{
  min-width:0;
}

.logo{
  width:38px;
  height:38px;
  flex:0 0 38px;
  border-radius:12px;
  background:
    linear-gradient(135deg, rgba(139,92,246,.20), rgba(59,130,246,.18)),
    url("/static/img/logo.png") center / cover no-repeat;
  border:1px solid rgba(255,255,255,.08);
  box-shadow:
    0 10px 24px rgba(59,130,246,.20),
    inset 0 1px 0 rgba(255,255,255,.12);
}

.user-badge-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.user-badge-link:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* ================= NAV ================= */

.nav{
  padding:12px 12px 16px;
  display:grid;
  gap:10px;
  align-content:start;

  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  flex:1;           /* 🔥 ключ */
  min-height:0;     /* 🔥 важно */
  scrollbar-width:thin;
  scrollbar-color:rgba(148,163,184,.35) transparent;
}

.nav::-webkit-scrollbar{
  width:8px;
}

.nav::-webkit-scrollbar-track{
  background:transparent;
}

.nav::-webkit-scrollbar-thumb{
  border-radius:999px;
  background:rgba(148,163,184,.28);
}

.nav::-webkit-scrollbar-thumb:hover{
  background:rgba(148,163,184,.44);
}

.nav-group{
  border:1px solid var(--line);
  border-radius:14px;

  background:rgba(255,255,255,.025);
  overflow:hidden;
  transition:border-color .18s ease, background .18s ease;
}

.nav-group[open]{
  border-color:rgba(139,92,246,.24);
  background:rgba(255,255,255,.04);
}

.nav-group summary{
  padding:10px 12px;
  cursor:pointer;

  font-size:12px;
  font-weight:800;

  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  list-style:none;
  user-select:none;
  color:rgba(229,231,235,.92);
}

.nav-group summary:hover{
  background:rgba(255,255,255,.035);
}

.nav-group summary::-webkit-details-marker{
  display:none;
}

.nav-group summary::after{
  content:"";
  width:7px;
  height:7px;
  flex-shrink:0;
  border-right:2px solid var(--muted);
  border-bottom:2px solid var(--muted);
  transform:rotate(-45deg);
  transition:.18s ease;
}

.nav-group[open] summary::after{
  transform:rotate(45deg);
}

.nav-items{
  padding:0 8px 8px;
  display:grid;
  gap:6px;
}


/* ================= NAV LINK ================= */

.nav-link{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;

  padding:9px 10px;
  border-radius:10px;

  text-decoration:none;
  color:var(--text);

  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.05);

  transition:.2s ease;
  min-width:0;
}

.nav-link:hover{
  background:rgba(139,92,246,.14);
  border-color:rgba(139,92,246,.28);
  box-shadow:0 6px 18px rgba(139,92,246,.18);
}

.nav-link.active{
  background:linear-gradient(135deg, rgba(139,92,246,.35), rgba(59,130,246,.35));
  border-color:rgba(139,92,246,.5);
  box-shadow:0 8px 30px rgba(139,92,246,.35);
}


/* icon */
.nav-emoji{
  width:24px;
  height:24px;
  border-radius:8px;
  flex-shrink:0;

  display:grid;
  place-items:center;

  background:linear-gradient(135deg,var(--accent),var(--accent2));
  color:white;
  font-size:13px;

  box-shadow:0 4px 14px rgba(139,92,246,.4);
}

.nav-left{
  min-width:0;
  display:flex;
  align-items:center;
  gap:8px;
}

.nav-title{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:12px;
  font-weight:700;
}

.nav-chip,
.hint{
  flex-shrink:0;
  padding:3px 7px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.045);
  color:var(--muted);
  font-size:10px;
  font-weight:800;
  line-height:1;
}


/* ================= MAIN ================= */

.main-header{
  padding:22px 26px;

  display:flex;
  justify-content:space-between;
  align-items:center;
}

.main-title{
  font-weight:900;
  font-size:20px;
}

.main-sub{
  font-size:13px;
  color:var(--muted);
}

.main-body{
  padding:24px;
}


/* ================= USER ================= */

.user-panel{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

.user-badge{
  display:flex;
  align-items:center;
  gap:10px;

  padding:8px 14px;
  border-radius:999px;

  border:1px solid var(--line);
  background:rgba(255,255,255,.06);

  backdrop-filter:blur(8px);
}

.user-email{
  font-weight:600;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.account-type{
  font-size:11px;
  font-weight:800;
}

.account-unpaid{
  color:#ef4444;
}


/* logout */
.logout-btn{
  padding:8px 16px;
  border-radius:14px;

  border:1px solid rgba(239,68,68,.35);
  background:rgba(239,68,68,.15);

  color:#ff6b6b;
  font-weight:700;

  transition:.2s ease;
}

.logout-btn:hover{
  background:rgba(239,68,68,.3);
  box-shadow:0 6px 20px rgba(239,68,68,.35);
}


/* ================= INPUTS ================= */

input, select, textarea{
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.08);

  border-radius:14px;
  padding:12px;

  color:var(--text);

  transition:.2s ease;
}

input:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(139,92,246,.25);
}


/* ================= MOBILE ================= */

.mobile-topbar{
  display:none;
  min-height:62px;
  padding:12px 14px;
}

/* кнопка */
.mobile-menu-btn{
  width:38px;
  height:38px;
  flex:0 0 38px;

  border-radius:12px;
  border:1px solid rgba(255,255,255,.1);

  background:rgba(255,255,255,.06);
  color:var(--text);

  display:flex;
  align-items:center;
  justify-content:center;

  font-size:18px;
  cursor:pointer;
  transition:background .18s ease, border-color .18s ease, transform .18s ease;
}

.mobile-menu-btn:hover{
  background:rgba(139,92,246,.16);
  border-color:rgba(139,92,246,.32);
}

/* бренд */
.mobile-brand{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;

  font-weight:900;
  font-size:15px;
  letter-spacing:.3px;

  background:linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;

  text-shadow:
    0 0 12px rgba(139,92,246,.35),
    0 0 24px rgba(59,130,246,.25);
}


/* overlay */
.sidebar-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.5);
  backdrop-filter:blur(4px);

  opacity:0;
  pointer-events:none;

  transition:.25s;
  z-index:998;
}

.sidebar-overlay.show{
  opacity:1;
  pointer-events:auto;
}

body.menu-open{
  overflow:hidden;
}


/* ================= TABLET ================= */

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


/* ================= MOBILE ================= */

@media (max-width:980px){

  .app{
    grid-template-columns:1fr;
    padding:10px;
    width:100%;
    min-height:100dvh;
  }

  .mobile-topbar{
    position:sticky;
    top:10px;
    z-index:900;

    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:10px;
    box-shadow:
      0 14px 36px rgba(0,0,0,.36),
      inset 0 1px 0 rgba(255,255,255,.06);
  }

  .sidebar{
    position:fixed;
    top:0;
    bottom:0;
    left:0;
    width:310px;
    max-width:calc(100vw - 18px);
    height:100vh;
    height:100dvh;
    max-height:100vh;
    max-height:100dvh;
    border-radius:0 18px 18px 0;
    background:
      linear-gradient(180deg, rgba(12,18,32,.97), rgba(8,13,24,.95));
    box-shadow:
      20px 0 60px rgba(0,0,0,.46),
      inset -1px 0 0 rgba(255,255,255,.05);
    transform:translateX(-104%);
    will-change:transform;

    z-index:2000;
    transition:transform .28s ease;
  }

  .sidebar.open{
    transform:translateX(0);
  }

  .sidebar-header{
    padding:16px;
  }

  .nav{
    padding:10px 10px max(14px, env(safe-area-inset-bottom));
    gap:8px;
  }

  .nav-group summary{
    padding:10px 11px;
  }

  .nav-link{
    padding:9px;
  }

}


/* ================= SMALL MOBILE ================= */

@media (max-width:700px){

  .app{
    padding:0;
  }

  .mobile-topbar{
    top:0;
    margin:0;
    border-radius:0;
    min-height:56px;
    padding:10px 12px;
  }

  .sidebar{
    width:292px;
    max-width:calc(100vw - 14px);
    border-radius:0 16px 16px 0;
  }

  .main{
    border-radius:0;
  }

  .main-body{
    padding:12px;
  }

}

/* =========================================================
   USER PANEL MOBILE FIX
   ========================================================= */

@media (max-width: 900px){

  .main-header{
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .user-panel{
    width: 100%;

    display: flex;
    flex-direction: column; /* ключ */
    gap: 10px;
  }

  .user-badge{
    width: 100%;

    display: flex;
    align-items: center;
    gap: 8px;

    padding: 8px 12px;
  }

  .user-email{
    flex: 1;
    min-width: 0;

    font-size: 13px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .account-type{
    flex-shrink: 0;
  }

  .logout-btn{
    width: 100%;
    text-align: center;
  }

}

/* =========================================================
   SIDEBAR REDESIGN OVERRIDE
   ========================================================= */

.app{
  width:min(1440px, 100%);
  min-height:100dvh;
  margin:0 auto;
  padding:var(--shell-pad);
  grid-template-columns:var(--sidebar-width) minmax(0, 1fr);
  gap:var(--shell-gap);
  align-items:start;
}

.main,
.mobile-topbar{
  border:1px solid rgba(255,255,255,.07);
  background:linear-gradient(180deg, rgba(15,23,42,.78), rgba(7,12,24,.72));
  backdrop-filter:blur(22px) saturate(130%);
  box-shadow:
    0 24px 70px rgba(0,0,0,.42),
    inset 0 1px 0 rgba(255,255,255,.06);
}

.main{
  border-radius:var(--radius);
}

.sidebar{
  position:sticky;
  top:var(--shell-pad);
  align-self:start;
  height:calc(100vh - (var(--shell-pad) * 2));
  height:calc(100dvh - (var(--shell-pad) * 2));
  min-height:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  isolation:isolate;
  border:1px solid rgba(255,255,255,.075);
  border-radius:24px;
  background:
    linear-gradient(180deg, rgba(13,20,36,.94), rgba(7,12,24,.91)),
    radial-gradient(680px 320px at 20% -8%, rgba(139,92,246,.18), transparent 58%);
  backdrop-filter:blur(24px) saturate(140%);
  box-shadow:
    0 24px 70px rgba(0,0,0,.46),
    inset 0 1px 0 rgba(255,255,255,.075);
  transform:none;
}

.sidebar::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  pointer-events:none;
  background:
    linear-gradient(90deg, rgba(139,92,246,.18), transparent 34%),
    radial-gradient(420px 220px at 80% 0%, rgba(59,130,246,.13), transparent 62%);
  opacity:.8;
}

.sidebar-header{
  flex:0 0 auto;
  padding:16px;
  border-bottom:1px solid rgba(148,163,184,.14);
  background:transparent;
}

.sidebar-brand-row{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.brand{
  flex:1 1 auto;
  min-width:0;
  gap:11px;
}

.brand-title{
  max-width:100%;
  font-size:14px;
  font-weight:900;
  line-height:1.18;
  letter-spacing:.01em;
}

.brand-sub{
  max-width:100%;
  margin-top:3px;
  color:rgba(203,213,225,.66);
  font-size:11px;
  line-height:1.25;
}

.logo{
  width:40px;
  height:40px;
  flex:0 0 40px;
  border-radius:14px;
  box-shadow:
    0 12px 28px rgba(59,130,246,.22),
    inset 0 1px 0 rgba(255,255,255,.14);
}

.sidebar-close{
  display:none;
  width:36px;
  height:36px;
  flex:0 0 36px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:12px;
  background:rgba(255,255,255,.055);
  color:rgba(226,232,240,.88);
  font-size:24px;
  line-height:1;
  cursor:pointer;
}

.user-badge-link:hover{
  transform:none;
}

.nav{
  flex:1 1 auto;
  min-height:0;
  max-height:100%;
  padding:10px;
  display:flex;
  flex-direction:column;
  gap:7px;
  align-content:normal;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  scrollbar-gutter:stable;
  scrollbar-width:thin;
  scrollbar-color:rgba(148,163,184,.34) transparent;
}

.nav::-webkit-scrollbar{
  width:7px;
}

.nav::-webkit-scrollbar-thumb{
  border:2px solid transparent;
  border-radius:999px;
  background:rgba(148,163,184,.34);
  background-clip:padding-box;
}

.nav-group{
  flex:0 0 auto;
  border:1px solid rgba(148,163,184,.12);
  border-radius:16px;
  background:rgba(255,255,255,.026);
  overflow:hidden;
  transition:background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.nav-group[open]{
  border-color:rgba(139,92,246,.22);
  background:rgba(255,255,255,.04);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
}

.nav-group summary{
  min-height:42px;
  padding:0 12px;
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto 12px;
  align-items:center;
  gap:8px;
  color:rgba(226,232,240,.88);
  font-size:12px;
  font-weight:850;
  letter-spacing:.01em;
}

.nav-group summary > span:first-child{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.nav-group summary::after{
  width:7px;
  height:7px;
  border-right-color:rgba(148,163,184,.78);
  border-bottom-color:rgba(148,163,184,.78);
}

.nav-items{
  padding:0 8px 8px;
  display:flex;
  flex-direction:column;
  gap:5px;
}

.nav-link{
  position:relative;
  flex:0 0 auto;
  min-width:0;
  min-height:38px;
  padding:7px 9px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  color:rgba(226,232,240,.86);
  border:1px solid transparent;
  background:transparent;
  transition:background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.nav-link::before{
  content:"";
  position:absolute;
  left:0;
  top:9px;
  bottom:9px;
  width:3px;
  border-radius:999px;
  background:linear-gradient(180deg, var(--accent), var(--accent2));
  opacity:0;
  transition:opacity .18s ease;
}

.nav-link:hover{
  color:#fff;
  background:rgba(255,255,255,.055);
  border-color:rgba(255,255,255,.075);
  box-shadow:none;
}

.nav-link.active{
  color:#fff;
  background:linear-gradient(135deg, rgba(139,92,246,.22), rgba(59,130,246,.16));
  border-color:rgba(139,92,246,.30);
  box-shadow:0 10px 28px rgba(59,130,246,.13);
}

.nav-link.active::before{
  opacity:1;
}

.nav-left{
  min-width:0;
  gap:9px;
}

.nav-emoji{
  width:26px;
  height:26px;
  flex:0 0 26px;
  border-radius:10px;
  font-size:13px;
  background:linear-gradient(135deg, rgba(139,92,246,.95), rgba(59,130,246,.88));
  box-shadow:0 8px 18px rgba(59,130,246,.18);
}

.nav-title{
  font-size:12px;
  font-weight:720;
  line-height:1.2;
}

.nav-chip{
  display:none;
}

.hint{
  flex:0 0 auto;
  max-width:84px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  padding:4px 7px;
  color:rgba(203,213,225,.64);
  font-size:9px;
  text-transform:uppercase;
  letter-spacing:.035em;
}

.mobile-topbar{
  display:none;
  min-height:var(--mobile-topbar-height);
  padding:10px 12px;
  border-radius:18px;
}

.mobile-menu-btn,
.sidebar-close{
  transition:background .18s ease, border-color .18s ease, color .18s ease;
}

.mobile-menu-btn:hover,
.sidebar-close:hover{
  background:rgba(139,92,246,.16);
  border-color:rgba(139,92,246,.32);
}

.sidebar-overlay{
  z-index:1200;
  background:rgba(3,7,18,.58);
  backdrop-filter:blur(8px);
}

@media (max-width:1200px){
  :root{
    --sidebar-width: 286px;
  }
}

@media (max-width:980px){
  .app{
    width:100%;
    min-height:100dvh;
    padding:10px;
    grid-template-columns:minmax(0, 1fr);
    gap:10px;
  }

  .mobile-topbar{
    position:sticky;
    top:10px;
    z-index:1100;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin:0;
  }

  .sidebar{
    position:fixed;
    inset:0 auto 0 0;
    width:min(330px, calc(100vw - 18px));
    height:100vh;
    height:100dvh;
    max-height:none;
    border-radius:0 22px 22px 0;
    transform:translateX(-104%);
    z-index:1300;
    transition:transform .24s ease;
    will-change:transform;
  }

  .sidebar.open{
    transform:translateX(0);
  }

  .sidebar-close{
    display:grid;
    place-items:center;
  }

  .sidebar-header{
    padding:14px;
  }

  .nav{
    padding:9px 9px max(16px, env(safe-area-inset-bottom));
    gap:6px;
  }

  .nav-group{
    border-radius:15px;
  }

  .nav-group summary{
    min-height:40px;
    padding:0 11px;
  }

  .nav-link{
    min-height:38px;
    padding:7px 8px;
  }

  .main{
    border-radius:18px;
  }
}

@media (max-width:700px){
  .app{
    padding:0;
    gap:0;
  }

  .mobile-topbar{
    top:0;
    min-height:56px;
    border-width:0 0 1px;
    border-radius:0;
  }

  .sidebar{
    width:min(304px, calc(100vw - 12px));
    border-radius:0 18px 18px 0;
  }

  .main{
    border-width:0;
    border-radius:0;
  }
}

/* =========================================================
   FRIENDLY APP SHELL OVERRIDE
   ========================================================= */

:root{
  --bg:#101312;
  --text:#f4f7f3;
  --muted:#9aa59d;
  --line:rgba(236,241,232,.12);
  --accent:#2f9e8f;
  --accent2:#f59e0b;
  --radius:12px;
  --sidebar-width:316px;
}

body{
  background:#101312;
}

body::before{
  background:
    linear-gradient(145deg, #101312 0%, #171816 44%, #15131a 72%, #101312 100%);
}

body::after{
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), transparent 30%, rgba(0,0,0,.18)),
    linear-gradient(120deg, rgba(47,158,143,.12), transparent 42%, rgba(245,158,11,.08));
  opacity:.72;
}

.sidebar,
.main,
.mobile-topbar{
  border-color:rgba(236,241,232,.11);
  background:rgba(18,22,20,.88);
  box-shadow:0 18px 48px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.05);
}

.main{
  min-height:calc(100dvh - (var(--shell-pad) * 2));
}

.sidebar{
  border-radius:14px;
  background:rgba(16,19,18,.94);
}

.sidebar::before{
  background:linear-gradient(180deg, rgba(47,158,143,.14), transparent 42%);
  opacity:1;
}

.brand,
.mobile-brand{
  text-decoration:none;
}

.brand-title{
  font-size:13px;
}

.brand-sub{
  color:rgba(244,247,243,.62);
}

.logo{
  border-radius:8px;
  background:
    linear-gradient(135deg, rgba(47,158,143,.16), rgba(245,158,11,.14)),
    url("/static/img/logo.png") center / cover no-repeat;
}

.nav{
  gap:8px;
}

.nav-group{
  border-radius:8px;
  background:rgba(255,255,255,.025);
}

.nav-group[open]{
  border-color:rgba(47,158,143,.30);
  background:rgba(255,255,255,.045);
}

.nav-group summary{
  min-height:42px;
  text-transform:none;
}

.nav-link{
  min-height:48px;
  align-items:flex-start;
  border-radius:8px;
  padding:8px;
}

.nav-link:hover{
  background:rgba(47,158,143,.12);
  border-color:rgba(47,158,143,.24);
}

.nav-link.active{
  background:linear-gradient(135deg, rgba(47,158,143,.22), rgba(245,158,11,.13));
  border-color:rgba(47,158,143,.42);
  box-shadow:0 10px 24px rgba(0,0,0,.22);
}

.nav-link.nav-locked{
  opacity:.72;
}

.nav-emoji{
  width:28px;
  height:28px;
  flex:0 0 28px;
  border-radius:8px;
  font-size:10px;
  font-weight:900;
  letter-spacing:0;
  background:linear-gradient(135deg, rgba(47,158,143,.95), rgba(245,158,11,.82));
  box-shadow:none;
}

.nav-copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}

.nav-title{
  font-size:12px;
  font-weight:820;
}

.nav-note{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:rgba(244,247,243,.52);
  font-size:10.5px;
  line-height:1.25;
}

.nav-chip,
.hint{
  border-radius:999px;
  border-color:rgba(236,241,232,.12);
  background:rgba(236,241,232,.06);
  color:rgba(244,247,243,.56);
}

.nav-chip{
  display:inline-flex;
  margin-top:4px;
}

.nav-chip-locked{
  color:#fed7aa;
  border-color:rgba(245,158,11,.30);
  background:rgba(245,158,11,.12);
}

.main-header{
  padding:22px 24px 16px;
  border-bottom:1px solid rgba(236,241,232,.08);
}

.main-title{
  font-size:22px;
  letter-spacing:0;
}

.main-sub{
  max-width:760px;
  color:rgba(244,247,243,.62);
}

.main-body{
  padding:22px;
}

.main-helper{
  margin:0 auto 18px;
  max-width:1100px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding:12px 14px;
  border:1px solid rgba(47,158,143,.20);
  border-radius:8px;
  background:rgba(47,158,143,.075);
  color:rgba(244,247,243,.78);
}

.main-helper b{
  color:var(--text);
  margin-right:8px;
}

.main-helper span{
  font-size:13px;
}

.page-assistant{
  margin:0 auto 18px;
  max-width:1100px;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:14px;
  align-items:center;
  padding:14px;
  border:1px solid rgba(236,241,232,.10);
  border-radius:8px;
  background:rgba(255,255,255,.04);
}

.page-assistant.has-guide{
  border-color:rgba(47,158,143,.22);
  background:
    linear-gradient(135deg, rgba(47,158,143,.09), rgba(245,158,11,.045)),
    rgba(255,255,255,.035);
}

.assistant-mark{
  min-width:80px;
  padding:7px 9px;
  border-radius:999px;
  border:1px solid rgba(47,158,143,.28);
  background:rgba(47,158,143,.10);
  color:#a7f3d0;
  font-size:11px;
  font-weight:900;
  text-align:center;
  text-transform:uppercase;
  letter-spacing:.06em;
}

.assistant-copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:3px;
}

.assistant-copy b{
  color:var(--text);
  font-size:14px;
}

.assistant-copy span{
  color:rgba(244,247,243,.64);
  font-size:13px;
  line-height:1.45;
}

.assistant-steps{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin-top:8px;
}

.assistant-steps span{
  display:flex;
  align-items:flex-start;
  gap:7px;
  min-width:0;
  padding:9px 10px;
  border:1px solid rgba(236,241,232,.10);
  border-radius:8px;
  background:rgba(255,255,255,.045);
  color:rgba(244,247,243,.72);
  font-size:12px;
  line-height:1.45;
}

.assistant-steps span b{
  flex:0 0 auto;
  width:20px;
  height:20px;
  display:grid;
  place-items:center;
  border-radius:999px;
  background:rgba(47,158,143,.16);
  color:#a7f3d0;
  font-size:11px;
}

.assistant-done{
  margin-top:6px;
  color:#fed7aa;
  font-size:12px;
  font-weight:800;
  line-height:1.45;
}

.user-badge{
  border-radius:8px;
  background:rgba(236,241,232,.06);
}

.account-type{
  border-radius:999px;
}

@media (max-width:980px){
  .sidebar{
    border-radius:0 12px 12px 0;
  }

  .main{
    min-height:calc(100dvh - 20px);
  }
}

@media (max-width:700px){
  .main-body{
    padding:14px;
  }

  .main-helper{
    flex-direction:column;
    align-items:stretch;
  }

  .page-assistant{
    grid-template-columns:1fr;
  }

  .assistant-steps{
    grid-template-columns:1fr;
  }

  .assistant-mark{
    width:max-content;
  }

  .nav-note{
    white-space:normal;
  }
}
