:root{
  --rivoli-font:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
  --header-ink:var(--ink,#17211b);
  --header-muted:var(--muted,#69736d);
  --header-line:var(--line,#dce4dd);
  --header-bg:var(--bg,#f5f7f4);
  --header-shadow:var(--shadow,0 18px 50px rgba(20,50,34,.10));
}
@media(max-width:560px){
  .topbar nav{position:fixed;inset:74px 12px auto 12px;z-index:40;display:none;width:auto;height:auto;max-height:calc(100dvh - 88px);margin:0;padding:10px;overflow:auto;flex-direction:column;align-items:stretch;gap:4px;border:1px solid var(--header-line);border-radius:20px;background:rgba(255,255,255,.98);box-shadow:0 24px 70px rgba(16,45,29,.18);backdrop-filter:blur(14px)}
  .mobile-nav-open nav{display:flex}
  .topbar nav a,.topbar nav button,.topbar nav summary{min-height:48px;padding:0 14px;border-radius:12px;display:flex;align-items:center;font-size:15px;font-weight:650;transition:background .16s,color .16s,transform .16s}
  .topbar nav a[aria-current="page"]:after,.topbar nav a.active:after,.topbar nav .nav-item.active:after{display:none}
  .topbar nav a[aria-current="page"],.topbar nav .nav-item.active{background:#edf4ee;color:var(--header-ink)}
  .topbar nav a:hover,.topbar nav button:hover,.topbar nav summary:hover{background:var(--header-bg);transform:translateX(2px)}
  .mobile-nav-toggle{order:2;margin-left:auto;margin-right:4px;position:relative;z-index:41}
  .header-actions{order:3}
}
body{font-family:var(--rivoli-font);}
.topbar,.topbar *{font-family:var(--rivoli-font);}
.topbar{
  height:72px;
  display:flex;
  align-items:center;
  padding:0 32px;
  background:#fff;
  border-bottom:1px solid var(--header-line);
  position:sticky;
  top:0;
  z-index:20;
}
.brand{
  display:flex;
  align-items:center;
  gap:11px;
  color:var(--header-ink);
  text-decoration:none;
  font-size:18px;
  letter-spacing:-.3px;
}
.brand-mark,.mark{
  display:inline-grid;
  place-items:center;
  width:42px;
  height:42px;
  border-radius:11px;
  background:transparent;
  color:var(--lime,#c9f06a);
  font-weight:850;
  object-fit:contain;
  padding:2px;
}
.topbar nav,.main-nav{
  display:flex;
  align-self:stretch;
  margin-left:60px;
  gap:26px;
}
.topbar nav a,.main-nav a,.nav-item{
  border:0;
  background:none;
  display:flex;
  align-items:center;
  position:relative;
  color:var(--header-muted);
  text-decoration:none;
  padding:0 2px;
  font-size:14px;
  font-weight:600;
}
.topbar nav a[aria-current="page"],.topbar nav a.active,.main-nav a[aria-current="page"],.main-nav a.active,.nav-item.active{
  color:var(--header-ink);
  font-weight:650;
}
.topbar nav a[aria-current="page"]:after,.topbar nav a.active:after,.main-nav a[aria-current="page"]:after,.main-nav a.active:after,.nav-item.active:after{
  content:"";
  position:absolute;
  height:3px;
  border-radius:4px;
  background:var(--green,#164b32);
  bottom:0;
  left:0;
  right:0;
}
.header-actions{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:10px;
}
.mobile-nav-toggle{display:none}
.rivoli-chat-button{width:42px;height:42px;border-radius:12px;font-family:var(--rivoli-font);}
.nav-chat-item{display:none;border:0;background:none;color:var(--header-ink);font:inherit;font-weight:600;text-align:left;cursor:pointer}
.icon-button,.grid-button,.account-button,.account{
  border:1px solid var(--header-line);
  background:#fff;
  height:42px;
  border-radius:12px;
  cursor:pointer;
}
.icon-button,.grid-button{
  width:42px;
  display:grid;
  place-items:center;
  padding:0;
}
.app-grid-icon,.dot-grid{
  display:grid;
  grid-template-columns:repeat(3,4px);
  gap:4px;
}
.app-grid-icon i,.dot-grid i{
  width:4px;
  height:4px;
  border-radius:50%;
  background:currentColor;
}
.account-button,.account{
  display:flex;
  align-items:center;
  gap:9px;
  padding:0 12px 0 6px;
  text-align:left;
}
.topbar .account{
  margin-left:0;
  border:1px solid var(--header-line);
  background:#fff;
  color:var(--header-ink);
  padding:0 12px 0 6px;
}
.account-button #avatar,.account>span:first-child{
  width:26px;
  height:26px;
  display:grid;
  place-items:center;
  border-radius:8px;
  background:#eaf1eb;
  color:var(--green,#164b32);
  font-weight:750;
}
.account-button span:nth-child(2),.account span:nth-child(2){
  display:grid;
  min-width:120px;
}
.account-button small,.account small{
  font-size:11px;
  color:var(--header-muted);
  max-width:190px;
  overflow:hidden;
  text-overflow:ellipsis;
}
.switcher-wrap,.account-wrap{
  position:relative;
}
.popover{
  position:fixed;
  z-index:30;
  right:max(24px,calc((100vw - 1360px)/2));
  top:72px;
  background:#fff;
  border:1px solid var(--header-line);
  border-radius:20px;
  box-shadow:var(--header-shadow);
}
.switcher,.product-switcher{
  width:370px;
  padding:16px;
}
.switcher-head{
  padding:5px 7px 14px;
}
.switcher-head strong,.switcher-head small{
  display:block;
}
.switcher-head small{
  color:var(--header-muted);
  margin-top:4px;
}
.switcher-list{
  display:grid;
  gap:5px;
}
.switcher-item,.product-switcher .product-link{
  display:grid;
  grid-template-columns:42px 1fr auto;
  align-items:center;
  gap:11px;
  padding:9px;
  border-radius:13px;
  text-decoration:none;
  color:var(--header-ink);
}
.switcher-item:hover,.product-switcher .product-link:hover,.product-switcher .product-link:focus-visible{
  background:#f2f6f2;
  outline:none;
}
.switcher-icon,.product-switcher .product-icon{
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  border-radius:12px;
  background:#edf3ee;
  color:var(--green,#164b32);
  font-weight:900;
}
.switcher-item small,.product-switcher .product-copy small{
  display:block;
  color:var(--header-muted);
}
.switcher-item.disabled,.product-switcher .product-link.disabled{
  opacity:.52;
  pointer-events:none;
}
.switcher-foot{
  display:block;
  padding:13px 18px;
  border-top:1px solid var(--header-line);
  background:#fbfcfb;
  color:var(--green,#164b32);
  font-size:12px;
  font-weight:700;
  text-decoration:none;
}
.switcher-foot:hover{
  background:#f3f7f4;
}
.account-menu{
  padding:10px;
  width:220px;
}
.account-menu p{
  font-size:13px;
  color:var(--header-muted);
  padding:0 8px;
  word-break:break-all;
  margin:0 0 6px;
}
.account-menu a,.account-menu button{
  display:block;
  width:100%;
  padding:12px;
  border:0;
  border-radius:10px;
  background:none;
  color:var(--header-ink);
  text-decoration:none;
  text-align:left;
  cursor:pointer;
}
.account-menu a:hover,.account-menu button:hover{
  background:var(--header-bg);
}
@media(max-width:900px){
  .topbar{
    padding:0 16px;
    gap:0;
  }
  .main-nav{
    margin-left:20px;
    gap:12px;
  }
  .account-button #accountName,.account span:nth-child(2),.account>i{
    display:none;
  }
}
@media(max-width:800px){
  .popover{
    right:12px;
  }
  .switcher,.product-switcher{
    width:min(370px,calc(100vw - 24px));
  }
}
@media(max-width:560px){
  .brand span:last-child{
    font-size:17px;
  }
  .brand-mark,.mark{
    width:44px;
    height:44px;
  }
  .topbar{
    height:auto;
    min-height:64px;
    padding:9px 13px;
    flex-wrap:wrap;
  }
  .mobile-nav-toggle{
    display:grid;
    flex:0 0 38px;
    width:38px;
    height:38px;
    place-content:center;
    gap:4px;
    margin-left:8px;
    padding:0;
    border:1px solid var(--header-line);
    border-radius:10px;
    background:#fff;
    color:var(--header-ink);
  }
  .mobile-nav-toggle span{display:block;width:16px;height:2px;border-radius:2px;background:currentColor;transition:transform .18s,opacity .18s}
  .mobile-nav-open .mobile-nav-toggle span:nth-child(1){transform:translateY(6px) rotate(45deg)}
  .mobile-nav-open .mobile-nav-toggle span:nth-child(2){opacity:0}
  .mobile-nav-open .mobile-nav-toggle span:nth-child(3){transform:translateY(-6px) rotate(-45deg)}
  .main-nav{
    position:fixed;
    inset:64px 12px auto 12px;
    z-index:40;
    display:none;
    height:auto;
    max-height:calc(100dvh - 76px);
    margin:0;
    padding:8px;
    overflow:auto;
    flex-direction:column;
    align-items:stretch;
    gap:2px;
    border:1px solid var(--header-line);
    border-radius:16px;
    background:#fff;
    box-shadow:var(--header-shadow);
  }
  .mobile-nav-open .main-nav{display:flex}
  .main-nav a,.main-nav button,.main-nav summary{min-height:44px;padding:0 12px;border-radius:10px;display:flex;align-items:center}
  .main-nav a[aria-current="page"]:after,.main-nav a.active:after,.main-nav .nav-item.active:after{display:none}
  .main-nav a:hover,.main-nav button:hover,.main-nav summary:hover{background:var(--header-bg)}
  .header-actions{
    gap:8px;
  }
  .icon-button,.grid-button,.account-button,.account{
    height:38px;
  }
  .icon-button,.grid-button{
    width:38px;
  }
  .account-button,.account{
    padding:0 7px 0 5px;
  }
}
@media(max-width:560px){.topbar nav .nav-chat-item{display:flex;align-items:center;width:100%;min-height:44px;padding:0 12px;border-radius:10px}.topbar nav .nav-chat-item:hover{background:var(--header-bg)}.header-actions .rivoli-chat-button{display:none}}
@media(max-width:560px){.topbar nav{display:none}.mobile-nav-open .topbar nav{display:flex}}
