/* Shell navigation: theme, goal-based sidebar, ⌘K command palette and the
   mobile menu. Loaded after ads_v3_shell.css so these rules win. */

:root{
  --ads3-accent:#6d4aff;
  --ads3-accent-dark:#5a37e6;
  --primary:#6d4aff;
  --shell-goal-waste:#f97316;
  --shell-goal-grow:#10b981;
  --shell-goal-content:#eab308;
  --shell-goal-markets:#3b82f6;
}

body{
  font-family:"DM Sans",ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

button,input,select,textarea{
  font-family:inherit;
}

.ads-v3-brand{
  font-weight:700;
  letter-spacing:-.01em;
}

/* Sidebar */

.ads-v3-sidebar{
  display:flex;
  flex-direction:column;
}

.ads-v3-sidebar nav{
  flex:1 0 auto;
}

.ads-v3-sidebar a.ads-v3-home{
  margin-bottom:6px;
  font-size:14px;
}

.ads-v3-goal .ads-v3-nav-title,
.ads-v3-insights .ads-v3-nav-title{
  display:flex;
  align-items:center;
  gap:8px;
  padding-top:12px;
  color:#55566a;
  font-size:12px;
  letter-spacing:.06em;
}

.ads-v3-goal .ads-v3-nav-title::before{
  content:"";
  width:8px;
  height:8px;
  flex:none;
  border-radius:999px;
  background:var(--shell-goal);
}

.ads-v3-sidebar a.ads-v3-goal-link{
  justify-content:flex-start;
  min-height:30px;
  margin-top:8px;
  padding:6px 11px;
  color:#55566a;
  font-size:12px;
  font-weight:750;
  letter-spacing:.06em;
  text-transform:uppercase;
}

.ads-v3-sidebar a.ads-v3-goal-link.active{
  background:#f0efff;
  color:var(--ads3-accent-dark);
}

.ads-v3-goal.is-waste{--shell-goal:var(--shell-goal-waste)}
.ads-v3-goal.is-grow{--shell-goal:var(--shell-goal-grow)}
.ads-v3-goal.is-content{--shell-goal:var(--shell-goal-content)}
.ads-v3-goal.is-markets{--shell-goal:var(--shell-goal-markets)}

.ads-v3-sidebar a.ads-v3-subnav,
.ads-v3-sidebar a.ads-v3-subnav.active{
  padding-left:27px;
  font-size:13px;
}

.ads-v3-sidebar-foot{
  display:grid;
  gap:4px;
  margin-top:16px;
  padding-top:12px;
  border-top:1px solid var(--ads3-border);
}

.ads-v3-sidebar-search{
  display:none;
}

.ads-v3-sidebar-backdrop{
  display:none;
}

/* Search button in the top bar */

.ads-v3-search{
  display:inline-flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
  min-height:var(--ads3-utility-control-height);
  margin-left:12px;
  padding:0 8px 0 12px;
  border:1px solid var(--ads3-border);
  border-radius:10px;
  background:#fff;
  color:var(--ads3-muted);
  font-size:13px;
  cursor:pointer;
}

.ads-v3-search:hover{
  border-color:#cfd4e6;
  color:var(--ads3-ink);
}

.ads-v3-search:focus-visible,
.ads-v3-menu-toggle:focus-visible,
.ads-v3-sidebar-search:focus-visible{
  outline:2px solid var(--ads3-accent);
  outline-offset:2px;
}

.ads-v3-search svg,
.cp-search svg,
.ads-v3-menu-toggle svg{
  width:16px;
  height:16px;
  flex:none;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
}

.ads-v3-search span{
  min-width:118px;
  text-align:left;
}

.ads-v3-search kbd,
.ads-v3-sidebar-search kbd,
.cp-dialog kbd{
  padding:1px 6px;
  border:1px solid var(--ads3-border);
  border-radius:6px;
  background:#fff;
  color:var(--ads3-muted);
  font:inherit;
  font-size:11px;
  font-weight:600;
}

.ads-v3-menu-toggle{
  display:none;
}

/* Command palette */

.cp-dialog{
  width:min(680px,calc(100vw - 32px));
  max-height:min(620px,calc(100vh - 120px));
  margin:72px auto auto;
  padding:0;
  overflow:hidden;
  border:0;
  border-radius:18px;
  background:#fff;
  color:var(--ads3-ink);
  box-shadow:0 30px 80px rgba(23,23,31,.28);
}

.cp-dialog[open]{
  display:flex;
  flex-direction:column;
}

.cp-dialog::backdrop{
  background:rgba(23,23,31,.32);
}

.cp-search{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 18px;
  border-bottom:1px solid var(--ads3-border);
  color:var(--ads3-muted);
}

.cp-search svg{
  width:18px;
  height:18px;
}

.cp-search input{
  flex:1;
  min-width:0;
  min-height:32px;
  padding:0;
  border:0;
  outline:none;
  background:transparent;
  color:var(--ads3-ink);
  font-size:18px;
}

.cp-results{
  flex:1;
  overflow-y:auto;
  overscroll-behavior:contain;
  padding:8px;
}

.cp-group{
  padding:10px 10px 4px;
  color:var(--ads3-muted);
  font-size:12px;
  font-weight:700;
  letter-spacing:.06em;
  text-transform:uppercase;
}

.cp-option{
  display:grid;
  grid-template-columns:28px minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  min-height:44px;
  padding:6px 10px;
  border-radius:10px;
  cursor:pointer;
}

.cp-option[aria-selected="true"]{
  background:#f1edff;
}

.cp-icon{
  display:grid;
  place-items:center;
  width:28px;
  height:28px;
  border-radius:8px;
  background:#f2f1f6;
  color:#55566a;
  font-size:12px;
  font-weight:700;
}

.cp-icon::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:999px;
  background:var(--shell-goal,#a1a2b5);
}

.cp-text{
  display:grid;
  min-width:0;
}

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

.cp-text small{
  overflow:hidden;
  color:var(--ads3-muted);
  font-size:12px;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.cp-tag{
  padding:2px 8px;
  border-radius:999px;
  background:#f2f1f6;
  color:#55566a;
  font-size:12px;
  font-weight:600;
  white-space:nowrap;
}

.cp-results.is-grouped .cp-tag{
  display:none;
}

.cp-option.is-waste{--shell-goal:var(--shell-goal-waste)}
.cp-option.is-grow{--shell-goal:var(--shell-goal-grow)}
.cp-option.is-content{--shell-goal:var(--shell-goal-content)}
.cp-option.is-markets{--shell-goal:var(--shell-goal-markets)}
.cp-option.is-insights{--shell-goal:var(--ads3-accent)}

.cp-empty{
  margin:0;
  padding:28px 16px;
  color:var(--ads3-muted);
  text-align:center;
}

.cp-help{
  display:flex;
  flex-wrap:wrap;
  gap:16px;
  padding:10px 18px;
  border-top:1px solid var(--ads3-border);
  color:var(--ads3-muted);
  font-size:12px;
}

@media(max-width:1280px){
  .ads-v3-search span{
    display:none;
  }
}

@media(max-width:1080px){
  .ads-v3-search kbd{
    display:none;
  }
}

/* Narrow screens: the top bar wraps onto several rows, so the page and the
   sidebar start below its measured height (set by shell_nav.js). */
@media(max-width:820px){
  .ads-v3-context{
    flex:1 1 100%;
  }
  .ads-v3-sidebar{
    top:var(--ads-topbar-height,118px);
  }
  html.ads-shell-ready body{
    padding-top:var(--ads-topbar-height,118px)!important;
  }
}

/* Mobile: the sidebar becomes a drawer opened from the top bar. */
@media(max-width:620px){
  .ads-v3-menu-toggle{
    display:inline-grid;
    place-items:center;
    width:40px;
    height:40px;
    margin-right:6px;
    padding:0;
    border:1px solid var(--ads3-border);
    border-radius:10px;
    background:#fff;
    color:var(--ads3-ink);
    cursor:pointer;
  }
  .ads-v3-menu-toggle svg{
    width:18px;
    height:18px;
  }
  /* The drawer has its own "Find any page" button. */
  .ads-v3-search{
    display:none;
  }
  .ads-v3-utilities{
    margin-left:auto;
  }
  .ads-v3-sidebar{
    z-index:1300;
    top:0;
    width:min(280px,86vw);
    visibility:hidden;
    transform:translateX(-100%);
    transition:transform .2s ease,visibility 0s linear .2s;
    box-shadow:0 20px 60px rgba(23,23,31,.22);
  }
  html.ads-sidebar-open .ads-v3-sidebar{
    visibility:visible;
    transform:none;
    transition:transform .2s ease;
  }
  html.ads-sidebar-open .ads-v3-sidebar-backdrop{
    position:fixed;
    z-index:1250;
    inset:0;
    display:block;
    background:rgba(23,23,31,.32);
  }
  .ads-v3-sidebar-search{
    display:flex;
    align-items:center;
    justify-content:space-between;
    min-height:40px;
    padding:0 11px;
    border:1px solid var(--ads3-border);
    border-radius:8px;
    background:#fff;
    color:var(--ads3-muted);
    font-size:13px;
    cursor:pointer;
  }
  .cp-dialog{
    margin-top:16px;
    max-height:calc(100vh - 32px);
  }
}

@media(prefers-reduced-motion:reduce){
  .ads-v3-sidebar{
    transition:none!important;
  }
}

@media print{
  .ads-v3-search,
  .ads-v3-menu-toggle{
    display:none!important;
  }
}
